2025-04-27 23:36:33 +07:00

123 lines
7.4 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container mx-auto p-8">
<h1 class="text-3xl font-semibold mb-6 text-center">Dashboard Perawat</h1>
<div class="overflow-x-auto p-3">
@if ($pasienHariIni->count() > 0)
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
No. Antrian
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Nama Pasien
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Ruang Pelayanan
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Status
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Tindakan
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($pasienHariIni as $registrasi)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-green-100 text-green-800 rounded-full text-sm font-medium">
#{{ $registrasi->nomor_antrian }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">
{{ $registrasi->pasien->nama_pasien }}
</div>
<div class="text-sm text-gray-500">{{ $registrasi->pasien->nik }}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">
{{ optional($registrasi->ruang_pelayanan)->nama_ruang_pelayanan ?? '-' }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<form action="{{ route('registrasi.status.update', $registrasi->id) }}" method="POST">
@csrf
@method('PUT')
<select name="status" class="border p-2 text-sm text-gray-700 rounded-md">
<option value="menunggu"
{{ $registrasi->status == 'menunggu' ? 'selected' : '' }}>
Menunggu
</option>
<option value="sedang_diproses"
{{ $registrasi->status == 'sedang_diproses' ? 'selected' : '' }}>
Sedang Diproses
</option>
<option value="selesai"
{{ $registrasi->status == 'selesai' ? 'selected' : '' }}>
Selesai
</option>
</select>
<button type="submit" class="bg-blue-500 text-white p-2 ml-2 rounded-md text-xs">
Update
</button>
</form>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<form action="{{ route('tindakan.store') }}" method="POST">
@csrf
<input type="hidden" name="registrasi_id" value="{{ $registrasi->id }}">
<div class="mb-4">
<label for="tindakan_id"
class="block text-sm font-medium text-gray-700">Tindakan</label>
<select name="tindakan_id" id="tindakan_id"
class="border p-2 text-sm text-gray-700 rounded-md w-full">
@foreach ($tindakanList as $tindakan)
<option value="{{ $tindakan->id }}"
{{ old('tindakan_id', $registrasi->tindakan_id) == $tindakan->id ? 'selected' : '' }}>
{{ $tindakan->nama_tindakan }} (Rp
{{ number_format($tindakan->tarif_tindakan, 0, ',', '.') }})
</option>
@endforeach
</select>
</div>
<!-- Input untuk jumlah tindakan -->
<div class="mb-4">
<label for="jumlah_tindakan"
class="block text-sm font-medium text-gray-700">Jumlah Tindakan</label>
<input type="number" name="jumlah_tindakan" id="jumlah_tindakan" min="1"
value="{{ old('jumlah_tindakan', 1) }}"
class="border p-2 text-sm text-gray-700 rounded-md w-full">
</div>
<button type="submit" class="bg-green-500 text-white p-2 ml-2 rounded-md text-xs">
Assign Tindakan
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="p-8 text-center">
<i class="fas fa-info-circle text-gray-400 text-4xl mb-3"></i>
<h4 class="text-lg font-medium text-gray-700">Belum ada pasien terdaftar</h4>
<p class="text-gray-500 mt-1">Data antrian akan muncul setelah pasien mendaftar</p>
</div>
@endif
{{-- {{ $pasienHariIni->links('pagination::tailwind') }} --}}
</div>
</div>
@endsection