@foreach ($records as $key => $record)
< week {{ $week_number }} |
{{ date('Y', strtotime($dates[0])) }}
>
@php
$height = 0;
$tr = [];
@endphp
@foreach ($sm_weekends as $key => $sm_weekend)
@php
if(moduleStatusCheck('University'))
{
$studentClassRoutine = App\SmWeekend::studentClassRoutineFromRecordUniversity($record->un_academic_id, $record->un_semester_label_id, $sm_weekend->id);
}else {
$studentClassRoutine = App\SmWeekend::studentClassRoutineFromRecord($record->class_id, $record->section_id, $sm_weekend->id);
}
@endphp
@if ($studentClassRoutine->count() > $height)
@php
$height = $studentClassRoutine->count();
@endphp
@endif
{{ @$sm_weekend->name }}
{{ date('d-M-y', strtotime($dates[$key])) }}
|
@endforeach
@php
$used = [];
$tr = [];
@endphp
@foreach ($sm_weekends as $sm_weekend)
@php
$i = 0;
if(moduleStatusCheck('University'))
{
$studentClassRoutine = App\SmWeekend::studentClassRoutineFromRecordUniversity($record->un_academic_id, $record->un_semester_label_id, $sm_weekend->id);
} else {
$studentClassRoutine = App\SmWeekend::studentClassRoutineFromRecord($record->class_id, $record->section_id, $sm_weekend->id);
}
@endphp
@foreach ($studentClassRoutine as $routine)
@php
if (!in_array($routine->id, $used)) {
if (moduleStatusCheck('University')) {
$tr[$i][$sm_weekend->name][$loop->index]['un_semester_label_id'] = $routine->un_semester_label_id;
$tr[$i][$sm_weekend->name][$loop->index]['subject'] = $routine->unSubject ? $routine->unSubject->subject_name : '';
$tr[$i][$sm_weekend->name][$loop->index]['subject_code'] = $routine->unSubject ? $routine->unSubject->subject_code : '';
$tr[$i][$sm_weekend->name][$loop->index]['subject_id'] = $routine->unSubject ? $routine->unSubject->id : null;
} else {
$tr[$i][$sm_weekend->name][$loop->index]['subject'] = $routine->subject ? $routine->subject->subject_name : '';
$tr[$i][$sm_weekend->name][$loop->index]['subject_code'] = $routine->subject ? $routine->subject->subject_code : '';
$tr[$i][$sm_weekend->name][$loop->index]['subject_id'] = $routine->subject ? $routine->subject->id : null;
}
$tr[$i][$sm_weekend->name][$loop->index]['class_room'] = $routine->classRoom ? $routine->classRoom->room_no : '';
$tr[$i][$sm_weekend->name][$loop->index]['teacher'] = $routine->teacherDetail ? $routine->teacherDetail->full_name : '';
$tr[$i][$sm_weekend->name][$loop->index]['start_time'] = $routine->start_time;
$tr[$i][$sm_weekend->name][$loop->index]['end_time'] = $routine->end_time;
$tr[$i][$sm_weekend->name][$loop->index]['is_break'] = $routine->is_break;
$used[] = $routine->id;
$tr[$i][$sm_weekend->name][$loop->index]['routine_id'] = $routine->id;
}
@endphp
@endforeach
@php
$i++;
@endphp
@endforeach
@for ($i = 0; $i < $height; $i++)
@foreach ($tr as $days)
@foreach ($sm_weekends as $key => $sm_weekend)
@php
$lesson_date = $dates[$key];
$classes = gv($days, $sm_weekend->name);
@endphp
@if ($classes && gv($classes, $i))
@if ($classes[$i]['is_break'])
@lang('lesson::lesson.break')
({{ date('h:i A', strtotime(@$classes[$i]['start_time'])) }}
-
{{ date('h:i A', strtotime(@$classes[$i]['end_time'])) }})
@else
@lang('common.time') :
{{ date('h:i A', strtotime(@$classes[$i]['start_time'])) }}
-
{{ date('h:i A', strtotime(@$classes[$i]['end_time'])) }}
{{ $classes[$i]['subject'] }}
({{ $classes[$i]['subject_code'] }})
@if ($classes[$i]['class_room'])
@lang('common.room')
:
{{ $classes[$i]['class_room'] }}
@endif
@if ($classes[$i]['teacher'])
{{ $classes[$i]['teacher'] }}
@endif
@php
$subject_id = $classes[$i]['subject_id'];
$routine_id = $classes[$i]['routine_id'];
if(moduleStatusCheck('University')) {
$un_semester_label_id = $classes[$i]['un_semester_label_id'];
$lessonPlan = DB::table('lesson_planners')
->where('lesson_date',$lesson_date)
->where('un_semester_label_id', $un_semester_label_id)
->where('un_subject_id',$subject_id)
->where('routine_id',$routine_id)
->where('school_id',Auth::user()->school_id)
->first();
} else {
$lessonPlan = DB::table('lesson_planners')
->where('lesson_date', $lesson_date)
->where('class_id', $record->class_id)
->where('section_id', $record->section_id)
->where('subject_id', $subject_id)
->where('routine_id', $routine_id)
->where('academic_id', getAcademicId())
->where('school_id', Auth::user()->school_id)
->first();
}
@endphp
@if ($lessonPlan)
@endif
@endif
@endif
|
@endforeach
@endforeach
@endfor
@endforeach