@extends('layouts.guru')
@section('content')
<x-slot name="header">
    <h2 class="font-semibold text-xl text-gray-800 leading-tight">
        {{ __('Tambah catatan kesehatan') }}
    </h2>
</x-slot>

<div class="py-12">
    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
        <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
            <div class="p-6">



    <div class="card max-w-xl mx-auto p-6">
        <h2 class="text-xl font-bold text-primary mb-4">Tambah Catatan Kesehatan</h2>
        <form action="{{ route('catatan_kesehatans.store') }}" method="POST">
            @csrf
            <div class="mb-3">
                <label class="font-semibold">Santri</label>
                <select name="santri_id" class="form-control rounded" required>
                    <option value="">Pilih Santri</option>
                    @foreach($santris as $s)
                        <option value="{{ $s->id }}" {{ old('santri_id')==$s->id?'selected':'' }}>{{ $s->nama }}</option>
                    @endforeach
                </select>
                @error('santri_id')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="mb-3">
                <label class="font-semibold">Kelas</label>
                <select name="kelas_id" class="form-control rounded" required>
                    <option value="">Pilih Kelas</option>
                    @foreach($kelas as $k)
                        <option value="{{ $k->id }}" {{ old('kelas_id')==$k->id?'selected':'' }}>{{ $k->nama_kelas }}</option>
                    @endforeach
                </select>
                @error('kelas_id')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="mb-3">
                <label class="font-semibold">Keluhan</label>
                <input type="text" name="keluhan" class="form-control rounded" value="{{ old('keluhan') }}" required>
                @error('keluhan')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="mb-3">
                <label class="font-semibold">Diagnosis</label>
                <input type="text" name="diagnosis" class="form-control rounded" value="{{ old('diagnosis') }}">
                @error('diagnosis')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="mb-3">
                <label class="font-semibold">Saran</label>
                <input type="text" name="saran" class="form-control rounded" value="{{ old('saran') }}">
                @error('saran')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="flex gap-2 mt-4">
                <button type="submit" class="btn-primary">Simpan</button>
                <a href="{{ route('catatan_kesehatans.index') }}" class="btn-accent">Kembali</a>
            </div>
        </form>
    
            
</div>
@endsection 
