MIF_E31222596/website/resources/views/guru/catatan_kesehatans/index.blade.php

57 lines
2.9 KiB
PHP

<x-guru-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Catatan Kesehatan Santri') }}
</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">
<h1 class="mb-4 text-xl font-bold text-primary">Catatan Kesehatan</h1>
<a href="{{ route('catatan_kesehatans.create') }}" class="btn-primary">Tambah Catatan</a>
@if(session('success'))
<div class="alert-success mb-4">{{ session('success') }}</div>
@endif
<div class="overflow-x-auto">
<table class="table w-full border rounded-lg overflow-hidden">
<thead>
<tr class="table-header">
<th class="px-3 py-2">No</th>
<th class="px-3 py-2">Santri</th>
<th class="px-3 py-2">Kelas</th>
<th class="px-3 py-2">Keluhan</th>
<th class="px-3 py-2">Diagnosis</th>
<th class="px-3 py-2">Saran</th>
<th class="px-3 py-2">Aksi</th>
</tr>
</thead>
<tbody>
@foreach($catatanKesehatans as $catatan)
<tr class="table-row">
<td class="px-3 py-2">{{ $loop->iteration + ($catatanKesehatans->currentPage()-1)*$catatanKesehatans->perPage() }}</td>
<td class="px-3 py-2">{{ $catatan->santri->nama ?? '-' }}</td>
<td class="px-3 py-2">{{ $catatan->kelas->nama_kelas ?? '-' }}</td>
<td class="px-3 py-2">{{ $catatan->keluhan }}</td>
<td class="px-3 py-2">{{ $catatan->diagnosis }}</td>
<td class="px-3 py-2">{{ $catatan->saran }}</td>
<td class="px-3 py-2 space-x-1">
<a href="{{ route('catatan_kesehatans.show', $catatan) }}" class="btn-accent btn-sm">Detail</a>
<!-- <a href="{{ route('catatan_kesehatans.edit', $catatan) }}" class="btn-accent btn-sm">Edit</a>
<form action="{{ route('catatan_kesehatans.destroy', $catatan) }}" method="POST" style="display:inline-block;">
@csrf
@method('DELETE')
<button type="submit" class="btn-primary btn-sm" onclick="return confirm('Yakin hapus?')">Hapus</button>
</form> -->
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $catatanKesehatans->links() }}
</div>
</div>
</div>
</x-guru-layout>