Class Routine For - {{$teacher->name ?? '--'}}
{{-- Print Button --}}
PDF
{{-- Print Area Start --}}
@php
// শনিবার থেকে শুরু করে দিনের নাম
$days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
// Load off days from database
$offDays = \App\Models\RoutineOffDay::getOffDays();
@endphp
@forelse($shifts as $shift)
@foreach($routineTypes as $routineType)
@foreach($routineSections as $routineSection)
@php
// Check if this combination exists in groupedSlots
$hasSlots = isset($groupedSlots[$shift->id][$routineType->id][$routineSection->id])
&& count($groupedSlots[$shift->id][$routineType->id][$routineSection->id]) > 0;
@endphp
@if($hasSlots)
@php
$timeSlots = $groupedSlots[$shift->id][$routineType->id][$routineSection->id];
@endphp
{{ $shift->name }}
|
{{ $routineType->name }}
@if($routineSection)
|
{{ $routineSection->name }}
@endif
| Day |
@foreach($timeSlots as $slot)
@php
$slotObj = is_array($slot) ? (object)$slot : $slot;
@endphp
{{ $slotObj->name }}
{{ date('h:i A', strtotime($slotObj->start_time)) }} - {{ date('h:i A', strtotime($slotObj->end_time)) }}
|
@endforeach
@foreach($days as $dayIndex => $dayName)
@php
// Skip off days (dayIndex is 0-based, day_of_week is 1-based)
$dayNumber = $dayIndex + 1;
if (in_array($dayNumber, $offDays)) {
continue;
}
@endphp
| {{ $dayName }} |
@foreach($timeSlots as $slot)
@php
$slotObj = is_array($slot) ? (object)$slot : $slot;
$isTiffin = stripos($slotObj->name, 'tiffin') !== false;
$routine = null;
if (
isset($routines[$shift->id][$routineType->id][$routineSection->id][$dayIndex+1][$slotObj->id])
) {
$routine = $routines[$shift->id][$routineType->id][$routineSection->id][$dayIndex+1][$slotObj->id];
}
@endphp
@if($isTiffin)
TIFFIN BREAK
|
@else
@if($routine)
{{ optional($routine->subject)->name ?? 'N/A' }}
{{ optional($routine->class)->name ?? '' }} {{ optional($routine->section)->name ?? '' }}
@else
-
@endif
|
@endif
@endforeach
@endforeach
@endif
@endforeach
@endforeach
@empty
No time slots assigned to this teacher yet.
@endforelse
{{-- Print Area End --}}