@php $tenant = \App\Support\Facades\Tenancy::get(); $brandStyle = $tenant->brand_primary_color ? ":root { --color-brand-600: {$tenant->brand_primary_color}; } .dark { --color-brand-600: {$tenant->brand_primary_color}; }" : null; // Rows are the distinct (day, start_time) time bands actually defined, ordered by // start time; columns are the days that have at least one slot, rotated to start // from the school's own week-start day (Tenant::week_start_day) instead of always // Monday — matches the same ordering used on the Timetable Slots page. $weekStartDay = $tenant->week_start_day ?? 1; $daysPresent = $slots->pluck('day_of_week')->unique()->values() ->sortBy(fn ($day) => ($day - $weekStartDay + 7) % 7) ->values(); $timeBands = $slots->pluck('start_time')->map(fn ($t) => $t->format('H:i'))->unique()->sort()->values(); @endphp
@if(($view === 'section' && $sectionId) || ($view === 'teacher' && $teacherId)) @php $pdfParams = [ 'view' => $view, 'section_id' => $sectionId, 'teacher_user_id' => $teacherId, 'academic_session_id' => $sessionId, ]; @endphp View PDF Download PDF @endif All Class Routines
@if($view === 'section')
@else
@endif
@if($view === 'section' && $selectedSection) @if($selectedSection->shift)

Showing only {{ $selectedSection->shift->name }} shift periods — the shift this section is assigned to.

@else

This section has no shift assigned, so periods from every shift are shown. Assign one on the section's settings to narrow this down.

@endif @endif @if($slots->isEmpty())
No timetable slots defined yet. Create some first.
@elseif($view === 'section' && ! $sectionId)
Create a class and section first.
@elseif($view === 'teacher' && ! $teacherId)
Select a teacher to view their schedule.
@else
@foreach($daysPresent as $day) @endforeach @foreach($timeBands as $band) @php $bandEndTime = $slots->first(fn($s) => $s->start_time->format('H:i') === $band)?->end_time->format('H:i'); @endphp @foreach($daysPresent as $day) @php $slot = $slots->first(fn($s) => $s->day_of_week === $day && $s->start_time->format('H:i') === $band); @endphp @endforeach @endforeach
Time
{{ \App\Models\TimetableSlot::DAYS[$day] }} @if($view === 'section' && $sectionId) @endif
{{ $band }}{{ $bandEndTime ? ' - '.$bandEndTime : '' }} @if($slot) @else — @endif
@endif

—

Subjects already scheduled elsewhere on this day for this section are disabled to prevent duplicates.

To change the teacher, edit it on Course Offerings — that updates the teacher everywhere this subject/section is taught, not just this one period.

@if($rooms->isEmpty())

No rooms set up for this branch yet — manage them from Rooms.

@endif

Marks this period as a break so it can't be assigned a class, and shows this label on the routine instead.

Remove this scheduled class?

This will remove the class from this slot. You can reassign it again afterwards.

Copy to…

@csrf @if($sectionId) @endif
@foreach($days as $value => $label) @endforeach

Every filled period on copies into the matching time slot on the day(s) you pick. Already-filled or conflicting slots on the target day are skipped, never overwritten.

Clear this entire routine?

@if($view === 'section' && $selectedSection) This removes every scheduled class for {{ $selectedSection->label() }} in the selected academic session, and resets any break periods (Tiffin/Namaz etc.) on its {{ $selectedSection->shift?->name ?? 'assigned' }} shift back to normal periods — affecting every other section on that shift too. This can't be undone. @else This removes every scheduled class for this teacher in the selected academic session. This can't be undone. @endif

@csrf @method('DELETE') @if($view === 'section') @else @endif