Weekly Appointments Report

{{ $clinic->name }}

{{ $startOfWeek->format('M j, Y') }} - {{ $endOfWeek->format('M j, Y') }}
Total
{{ $stats['total'] }}
Confirmed
{{ $stats['confirmed'] }}
Completed
{{ $stats['completed'] }}
Cancelled
{{ $stats['cancelled'] }}
@php $currentDate = $startOfWeek->copy(); @endphp @while($currentDate <= $endOfWeek) @php $dateStr = $currentDate->format('Y-m-d'); $dayAppointments = $appointmentsByDate->get($dateStr, collect()); @endphp
{{ $dayAppointments->count() }} {{ $dayAppointments->count() == 1 ? 'Appointment' : 'Appointments' }}

{{ $currentDate->format('l, F j, Y') }}

@if($dayAppointments->count() > 0) @foreach($dayAppointments as $index => $apt) @endforeach
# Time Patient Name IC Number Phone Nurse Status
{{ $index + 1 }} {{ $apt->slot_label }} {{ $apt->mother->name }} {{ $apt->mother->expectantMother->ic_number ?? 'N/A' }} {{ $apt->mother->expectantMother->phone_number ?? $apt->mother->phone_number ?? 'N/A' }} {{ $apt->assignedNurse->name ?? 'Not assigned' }} {{ ucfirst($apt->status) }}
@else
No appointments scheduled
@endif
@php $currentDate->addDay(); @endphp @endwhile