{{-- Staff Timetable Report — one printable sheet per staff, landscape --}} {{ $title }} @php $to12h = function ($t) { if (!$t) return ''; try { return \Carbon\Carbon::parse($t)->format('g:i A'); } catch (\Throwable $e) { return $t; } }; $fmtDate = function ($d) { if (!$d) return ''; try { return \Carbon\Carbon::parse($d)->format('D, M j, Y'); } catch (\Throwable $e) { return $d; } }; $locFilter = $filters['location_ids'] ?? ($filters['location_id'] ?? null); $locSummary = 'All permitted locations'; if (is_array($locFilter) && !empty($locFilter)) { $names = \Illuminate\Support\Facades\DB::table('location_tables')->whereIn('id', $locFilter)->pluck('location_name')->all(); if (!empty($names)) $locSummary = count($names) === 1 ? ('Location: ' . $names[0]) : ('Locations: ' . implode(', ', $names)); } $rangeText = $fmtDate($data['range']['from'] ?? null) . ' — ' . $fmtDate($data['range']['to'] ?? null); @endphp @if(empty($data['staff']))
STEP UP ACADEMY OF LEARNING
{{ $title }}
Week: {{ $rangeText }} · {{ $locSummary }} · Generated {{ $generatedAt }}

No staff/classes match the current filters.

@endif @foreach($data['staff'] as $st)
STEP UP ACADEMY OF LEARNING
{{ $title }}
Week: {{ $rangeText }} · {{ $locSummary }} · Generated {{ $generatedAt }} · Prepared by {{ $preparedBy }}
{{ $st['staff_name'] }}
Week {{ $fmtDate($st['week_start']) }} to {{ $fmtDate($st['week_end']) }}
Classes
{{ $st['summary']['classes'] }}
Students
{{ $st['summary']['students'] }}
Hours
{{ $st['summary']['teaching_hours'] }}
Online
{{ $st['summary']['online'] }}
In-Person
{{ $st['summary']['in_person'] }}
Hybrid
{{ $st['summary']['hybrid'] }}
Zero-Student
{{ $st['summary']['zero_student'] }}
Locations
{{ count($st['summary']['locations']) }}
@php $daysWithClasses = array_values(array_filter($st['days'], fn($d) => !empty($d['classes']))); @endphp @if(empty($daysWithClasses))
No classes found for the selected week and filters.
@endif @foreach($daysWithClasses as $day)
{{ \Carbon\Carbon::parse($day['date'])->format('l, M j') }}
@if(false) @else @foreach($day['classes'] as $c)
☐ {{ $to12h($c['start_time']) }} – {{ $to12h($c['end_time']) }} · {{ $c['mode'] ?: '—' }} · {{ $c['location'] ?: 'Location: Not assigned' }} @if(empty($c['students'])) · ⚠ No students @endif
Class ID {{ $c['class_id'] }} · Occurrence {{ $c['occurrence_id'] }} · Capacity {{ $c['enrolled_count'] }}/{{ $c['capacity'] ?? '—' }} @if($c['program_type']) · {{ $c['program_type'] }}@endif @if($c['class_type']) · {{ $c['class_type'] }}@endif
@if(empty($c['students'])) No students assigned @else
    @foreach($c['students'] as $s)
  • ☐ {{ $s['student_name'] }} @if(!empty($s['grade'])) — GR {{ $s['grade'] }}@endif @if(!empty($s['subject'])) — {{ $s['subject'] }}@endif @php $b = $s['billing'] ?? null; @endphp @if($b && ($b['type'] ?? null)) — {{ $b['label'] }} — {{ $b['formatted_amount'] ? ($b['formatted_amount'] . ($b['frequency_label'] ?? '')) : 'Amount not set' }} @elseif($b) — Billing not configured @endif @if(!empty($s['reference_id'])) ({{ $s['reference_id'] }})@endif
  • @endforeach
@endif
@endforeach @endif @endforeach
ADMIN REVIEW
☐ All classes are correct    ☐ Corrections are marked above    ☐ Follow-up required

Reviewed by: ______________________   Date: _____________________   Signature/Initials: _______________

General Notes:
@endforeach