@foreach ($psikiater as $data)
    <div class="modal fade" id="exampleModal_{{ $data->id_psikiater }}" tabindex="-1"
        aria-labelledby="exampleModalLabel_{{ $data->id_psikiater }}" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content modal-lg">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="exampleModalLabel_{{ $data->id_psikiater }}">Data Penanganan</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form method="POST" action="{{ route('psikiater.update', $data->id_psikiater) }}"
                        enctype="multipart/form-data">
                        @csrf
                        @method('PATCH')

                        <p class="fw-bold mb-3">KELOLA PENANGANAN</p>

                        <div class="mb-3">
                            <x-input-label for="tanggal" value="TANGGAL" />
                            <x-text-input id="tanggal" type="date" name="tanggal"
                                class="mt-1 block w-full rounded-md" value="{{ old('tanggal', $data->tanggal) }}"
                                required />
                            <x-input-error class="mt-2" :messages="$errors->get('tanggal')" />
                        </div>

                        <div class="max-w-xl mb-3">
                            <x-input-label for="id_siswa" value="NAMA SISWA" />
                            <select id="id_siswa" name="id_siswa" class="mt-1 block w-full rounded-md" required>
                                <option value="">Pilih Siswa</option>
                                @foreach (\App\Models\Siswa::all() as $siswa)
                                    <option value="{{ old('id_siswa', $siswa->id_siswa) }}" selected>
                                        {{ $siswa->nama_siswa }}</option>
                                @endforeach
                            </select>
                            <x-input-error class="mt-2" :messages="$errors->get('id_siswa')" />
                        </div>

                        <div class="mb-3">
                            <x-input-label for="diagnosis_awal" value="DIAGNOSIS AWAL" />
                            <textarea id="diagnosis_awal" rows="3" type="text" name="diagnosis_awal" class="mt-1 block w-full rounded-md"
                                required>{{ old('diagnosis_awal', $data->diagnosis_awal) }}</textarea>
                            <x-input-error class="mt-2" :messages="$errors->get('diagnosis_awal')" />
                        </div>

                        <div class="mb-3">
                            <x-input-label for="penanganan" value="PENANGANAN" />
                            <x-text-input id="penanganan" type="text" name="penanganan"
                                class="mt-1 block w-full rounded-md" value="{{ old('penanganan', $data->penanganan) }}"
                                required />
                            <x-input-error class="mt-2" :messages="$errors->get('penanganan')" />
                        </div>

                        <div class="mb-3">
                            <x-input-label for="resep_obat" value="RESEP OBAT" />
                            <x-text-input id="resep_obat" type="text" name="resep_obat"
                                class="mt-1 block w-full rounded-md" value="{{ old('resep_obat', $data->resep_obat) }}"
                                required />
                            <x-input-error class="mt-2" :messages="$errors->get('resep_obat')" />
                        </div>

                        <div class="text-end">
                            <button type="submit" class="btn px-4 py-2 border border-dark"
                                style="background-color: rgba(87, 7, 65, 1); color: white;">
                                KIRIM
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endforeach
