@php $doctorName = $doctor['full_name'] ?? 'Doctor'; $displayDoctorName = str_starts_with($doctorName, 'Dr.') ? $doctorName : 'Dr. ' . $doctorName; $roomName = $room['room_name'] ?? 'Dental Room 1'; $current = $currentQueue ?? null; $next = $nextQueue ?? null; $currentPatient = $current['patient'] ?? null; $currentAppointment = $current['appointment'] ?? null; $nextPatient = $next['patient'] ?? null; @endphp Waiting Queue
{{ now()->format('D, d M Y') }}
🔔

{{ $roomName }} — Waiting Queue

{{ now()->format('l, d F Y') }}

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Now Serving

{{ $current['queue_number'] ?? '-' }}

{{ $currentPatient['full_name'] ?? 'No active patient' }} @if($currentAppointment) · {{ $currentAppointment['reason'] ?? 'Dental Treatment' }} @endif

Next Up

{{ $next['queue_number'] ?? '-' }}

{{ $nextPatient['full_name'] ?? '-' }}

@forelse($doctorQueues as $q) @php $patient = $q['patient'] ?? []; $appt = $q['appointment'] ?? []; $status = $q['status'] ?? 'waiting'; $statusClass = match($status) { 'done', 'completed' => 'completed', 'active' => 'active', default => 'waiting' }; $statusText = match($status) { 'done', 'completed' => 'Completed', 'active' => 'Called', default => 'Waiting' }; @endphp @empty @endforelse
Queue No. Patient Name Patient ID Treatment Appt Time Status Action
{{ $q['queue_number'] ?? '-' }} {{ $patient['full_name'] ?? 'Unknown Patient' }} {{ $patient['upsi_id'] ?? '-' }} {{ $appt['reason'] ?? 'Dental Treatment' }} {{ !empty($appt['appointment_time']) ? date('g:i A', strtotime($appt['appointment_time'])) : '-' }} {{ $statusText }} @if($status === 'active')
@csrf
@csrf
Record Treatment
@elseif($status === 'waiting')
@csrf
@else View → @endif
No patients in queue for today.