{{-- DUTY ROSTER — PRINTABLE VIEW ──────────────────────────── Standalone page (no app layout) optimized for paper. Opens in a new tab, auto-triggers the browser's print dialog so the user can either print directly or save as PDF (most browsers offer "Save as PDF" as a destination in the print dialog — that's how the user "downloads" the rota for emailing to staff). Receives: $weekStart, $weekEnd, $weekDates, $rosterGrid (2D [shift][date]=>[entries]), $filterDeptName (or null), $hospitalName, $generatedAt, $generatedBy. --}} Duty Roster — Week of {{ $weekStart->format('d M Y') }} {{-- Toolbar (visible on screen, hidden when printing) --}} {{-- Header --}} {{-- Main rota table --}} @foreach($weekDates as $d) @php $isToday = $d->isToday(); @endphp @endforeach @php $shifts = [ 'day' => ['label' => 'Day Shift', 'time' => '8:00 AM – 8:00 PM'], 'night' => ['label' => 'Night Shift', 'time' => '8:00 PM – 8:00 AM'], ]; @endphp @foreach($shifts as $shiftKey => $meta) @foreach($weekDates as $d) @php $isToday = $d->isToday(); $entries = $rosterGrid[$shiftKey][$d->toDateString()] ?? []; @endphp @endforeach @endforeach
Shift {{ $d->format('D') }} {{ $d->format('d M') }}
{{ strtoupper($meta['label']) }} {{ $meta['time'] }} @forelse($entries as $entry) @php $isLocum = $entry->assignee_type === 'locum'; $name = $entry->assignee_name; $deptName = $entry->department->name ?? '—'; @endphp
{{ $name }} @if($isLocum)L@endif
{{ $deptName }}
@empty
@endforelse
{{-- Legend --}}
Full-time staff Locum (L) Today
{{-- Footer --}}