{{-- Student Timetable Report — one printable sheet per student, 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['students']))
STEP UP ACADEMY OF LEARNING
{{ $title }}
Week: {{ $rangeText }} · {{ $locSummary }} · Generated {{ $generatedAt }}

No students/classes match the current filters.

@endif @foreach($data['students'] as $st)
STEP UP ACADEMY OF LEARNING
{{ $title }}
Week: {{ $rangeText }} · {{ $locSummary }} · Generated {{ $generatedAt }} · Prepared by {{ $preparedBy }}
{{ $st['student_name'] }}
Reference: {{ $st['reference_id'] ?: '—' }} @if($st['grade']) · Grade {{ $st['grade'] }}@endif · Week {{ $fmtDate($st['week_start']) }} to {{ $fmtDate($st['week_end']) }}
Classes
{{ $st['summary']['classes'] }}
Hours
{{ $st['summary']['hours'] }}
Staff
{{ $st['summary']['staff'] }}
Subjects
{{ count($st['summary']['subjects']) }}
Online
{{ $st['summary']['online'] }}
In-Person
{{ $st['summary']['in_person'] }}
Locations
{{ count($st['summary']['locations']) }}
Conflicts
{{ $st['summary']['conflicts'] }}
@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']) }} @if($c['subject']) · {{ $c['subject'] }}@endif · {{ $c['staff_name'] ?: 'Staff TBD' }} · {{ $c['mode'] ?: '—' }} · {{ $c['location'] ?: 'Location: Not assigned' }}
Class ID {{ $c['class_id'] }} · Occurrence {{ $c['occurrence_id'] }}
@endforeach @endif @endforeach @if(!empty($st['summary']['conflicts']))
⚠ {{ $st['summary']['conflicts'] }} scheduling conflict(s) detected — overlapping class times.
@endif
STUDENT / PARENT REVIEW
☐ All classes are correct    ☐ Changes requested    ☐ Follow-up required

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

Notes:
@endforeach