@extends('layouts.master') @section('title', 'Teaching Load Preview') @section('style') @endsection @section('content') @include('layouts.header') @include('layouts.title')
{{-- ===================================================== --}} {{-- PAGE TITLE --}} {{-- ===================================================== --}}

Teaching Load Preview

Please review all information before sending it for approval.

{{-- ===================================================== --}} {{-- TEACHING LOAD INFORMATION --}} {{-- ===================================================== --}}
Teaching Load Information
{{-- Academic Year --}}
Academic Year
{{ $teachingLoad->teaching_load_year }}
{{-- Semester --}}
Current Semester
Semester {{ $teachingLoad->teaching_load_semester }}
{{-- Teaching Load Status --}}
Teaching Load Status
@if($teachingLoad->teaching_load_status == 'Draft') Draft @elseif($teachingLoad->teaching_load_status == 'Pending') Pending @elseif($teachingLoad->teaching_load_status == 'Approved') Approved @elseif($teachingLoad->teaching_load_status == 'Rejected') Rejected @else {{ $teachingLoad->teaching_load_status ?? '-' }} @endif
{{-- Employee Contract --}}
Employee Contract
@if($fcontract) {{ $fcontract->fcontract_start_date ?? '-' }} - {{ $fcontract->fcontract_end_date ?? '-' }} @else - @endif
{{-- Faculty --}}
Faculty Member
{{ $faculty->faculty_title ?? '' }} {{ $faculty->faculty_firstname ?? '' }} {{ $faculty->faculty_lastname ?? '' }}
{{-- School --}}
School
{{ $faculty->school_name ?? '-' }}
{{-- ===================================================== --}} {{-- WORKLOAD ARRANGEMENT CONTEXT --}} {{-- ===================================================== --}} @if($adcontract_value)
Workload Arrangement Administrative Position Context
Administrative Position
{{ $adcontract_value ->admin_position_name ?? '-' }}
Arrangement Type
{{ $adcontract_value ->adposition_type_name ?? '-' }}
Arrangement Status
{{ $adcontract_value->status ?? '-' }}
Appointment No.
{{ $adcontract_value ->adcontract_no ?? '-' }}
Workload Arrangement and Teaching Load use separate approval workflows.
@endif {{-- ===================================================== --}} {{-- 1. TEACHING LOAD --}} {{-- ===================================================== --}}

1. Teaching Load

a) Lecture
=
12 Credits, 24 Hours/Week
TOR
=
12 Credits, 24 Hours/Week
{{-- ================================================= --}} {{-- 1a Lecture --}} {{-- ================================================= --}} @foreach([1,2,3] as $semester) @php $rows = $lecture[$semester] ?? collect(); @endphp
Academic Year {{ $teachingLoad->teaching_load_year }} - Semester {{ $semester }}
@forelse($rows as $key => $row) @empty @endforelse
No. Course No. Course Portions (%) Sec.No. No. of Students No. of Weeks Lecture (Hr/Wk) Credits Contact (Hr/Wk) Source
{{ $key + 1 }} {{ $row->course_code }} {{ $row->course_name }} {{ $row->course_portions }} {{ $row->course_section }} {{ $row->course_student }} {{ $row->course_week }} {{ $row->course_lecture }} {{ $row->course_credit }} {{ $row->course_contact }} @if(($row->source ?? 'AUTO') == 'AUTO') AUTO @else MANUAL @endif
No lecture data.
@endforeach
{{-- ================================================= --}} {{-- 1b Laboratory --}} {{-- ================================================= --}}
b) Laboratory
@foreach([1,2,3] as $semester) @php $rows = $laboratory[$semester] ?? collect(); @endphp
Academic Year {{ $teachingLoad->teaching_load_year }} - Semester {{ $semester }}
@forelse($rows as $key => $row) @empty @endforelse
No. Course No. Course Portions (%) Sec.No. No. of Students No. of Lecturers Lab.&Lect (Hr/Wk) Credits Contact (Hr/Wk) Source
{{ $key + 1 }} {{ $row->course_code }} {{ $row->course_name }} {{ $row->course_portions }} {{ $row->course_section }} {{ $row->course_student }} {{ $row->course_lab_lect }} {{ $row->course_week }} {{ $row->course_credit }} {{ $row->course_contact }} @if(($row->source ?? 'AUTO') == 'AUTO') AUTO @else MANUAL @endif
No laboratory data.
@endforeach
{{-- ===================================================== --}} {{-- 2. SUPERVISION --}} {{-- ===================================================== --}}

2. Supervision of Senior Project / Extended Training / Special Problems / Selected Topic / Others

{{-- ================================================= --}} {{-- 2a Senior --}} {{-- ================================================= --}}
a) Senior Project / Extended Training Requirement
@foreach([1,2,3] as $semester) @php $rows = $senior[$semester] ?? collect(); @endphp
Semester {{ $semester }}
@forelse($rows as $key => $row) @empty @endforelse
No. Course No. Course No. of Students Credits Contact (Hr/Wk) Source
{{ $key + 1 }} {{ $row->senior_course_code }} {{ $row->senior_course_name }} {{ $row->senior_student_no }} {{ $row->senior_credits }} {{ $row->senior_contact }} @if(($row->source ?? 'AUTO') == 'AUTO') AUTO @else MANUAL @endif
No Senior Project data.
@endforeach
{{-- ================================================= --}} {{-- 2b Supervision --}} {{-- ================================================= --}}
b) Supervision for Master and Doctoral Students
@foreach([1,2,3] as $semester) @php $rows = $supervision[$semester] ?? collect(); @endphp
Semester {{ $semester }}
@forelse($rows as $key => $row) @empty @endforelse
No. Student Code Name Level No. of Students Credits Contact (Hr/Wk) Source
{{ $key + 1 }} {{ $row->supervision_student_code }} {{ $row->supervision_title }} {{ $row->supervision_fullname }} {{ $row->supervision_level }} {{ $row->supervision_student_no }} {{ $row->supervision_credits }} {{ $row->supervision_contact }} @if(($row->source ?? 'AUTO') == 'AUTO') AUTO @else MANUAL @endif
No supervision data.
@endforeach
{{-- ===================================================== --}} {{-- 3. INTERNAL COMMITTEES --}} {{-- ===================================================== --}}

3. Internal Committees

@forelse($committee as $key => $row) @empty @endforelse
No. Internal Committees Name Document
{{ $key + 1 }} {{ $row->ic_name ?? '-' }} @if(!empty($row->ic_documents)) View File @else - @endif
No Internal Committees found.
{{-- ===================================================== --}} {{-- 4. TIMETABLE --}} {{-- ===================================================== --}}

4. Timetable

@foreach([1,2,3] as $semester) @php $rows = $timetable[$semester] ?? collect(); $regularRows = $rows ->filter(function ($row) { return trim( $row->timetable_activity ?? '' ) === 'Regular Teaching Schedule'; }) ->values(); $extraRows = $rows ->filter(function ($row) { return trim( $row->timetable_activity ?? '' ) === 'Extra Teaching Schedule'; }) ->values(); $scheduleGroups = [ 'Regular Teaching Schedule' => $regularRows, 'Extra Teaching Schedule' => $extraRows ]; @endphp
Teaching Schedule Preview - Semester {{ $semester }}
@foreach($scheduleGroups as $scheduleName => $gridRows)
@if($scheduleName == 'Regular Teaching Schedule') Regular @else Extra @endif
{{ $scheduleName }}
@if($gridRows->isEmpty())
No {{ $scheduleName }} found for Semester {{ $semester }}.
@else @php $days = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ]; $timeToMinutes = function ($time) { if (empty($time)) { return null; } $time = substr($time, 0, 5); [$hour, $minute] = array_map( 'intval', explode(':', $time) ); return ($hour * 60) + $minute; }; $slotMinutes = 30; $minStart = $gridRows ->map(function ($row) use ($timeToMinutes) { return $timeToMinutes( $row->timetable_time_start ); }) ->filter(function ($value) { return $value !== null; }) ->min(); $maxEnd = $gridRows ->map(function ($row) use ($timeToMinutes) { return $timeToMinutes( $row->timetable_time_end ); }) ->filter(function ($value) { return $value !== null; }) ->max(); $gridStart = $minStart ?? (8 * 60); $gridEnd = $maxEnd ?? (17 * 60); $gridStart = floor( $gridStart / $slotMinutes ) * $slotMinutes; $gridEnd = ceil( $gridEnd / $slotMinutes ) * $slotMinutes; $slotCount = ($gridEnd - $gridStart) / $slotMinutes; @endphp
@for($slot = 0; $slot < $slotCount; $slot++) @php $startMinutes = $gridStart + ($slot * $slotMinutes); $endMinutes = $startMinutes + $slotMinutes; $startHour = floor($startMinutes / 60); $startMinute = $startMinutes % 60; $endHour = floor($endMinutes / 60); $endMinute = $endMinutes % 60; $startLabel = sprintf( '%02d:%02d', $startHour, $startMinute ); $endLabel = sprintf( '%02d:%02d', $endHour, $endMinute ); @endphp @endfor @foreach($days as $day) @php $dayRows = $gridRows ->filter(function ($row) use ($day) { return strtoupper( trim( $row->timetable_date ) ) === strtoupper($day); }) ->sortBy( 'timetable_time_start' ) ->values(); $position = 0; @endphp @while($position < $slotCount) @php $slotStart = $gridStart + ( $position * $slotMinutes ); $classes = $dayRows ->filter( function ($row) use ( $timeToMinutes, $slotStart, $slotMinutes, $gridStart ) { $start = $timeToMinutes( $row->timetable_time_start ); if ($start === null) { return false; } $normalizedStart = $gridStart + floor( ( $start - $gridStart ) / $slotMinutes ) * $slotMinutes; return $normalizedStart == $slotStart; } ); $hasClass = $classes->count() > 0; @endphp @if($hasClass) @php $classMaxEnd = $classes ->map( function ($row) use ($timeToMinutes) { return $timeToMinutes( $row->timetable_time_end ); } ) ->filter() ->max(); $duration = max( $slotMinutes, $classMaxEnd - $slotStart ); $colspan = (int) ceil( $duration / $slotMinutes ); $remainingSlots = $slotCount - $position; $colspan = min( $colspan, $remainingSlots ); @endphp @php $position += $colspan; @endphp @elseif($slotStart == (12 * 60)) @php $remainingSlots = $slotCount - $position; $lunchColspan = min( 2, $remainingSlots ); @endphp @php $position += $lunchColspan; @endphp @else @php $position++; @endphp @endif @endwhile @endforeach
Day / Time
{{ $startLabel }}
-
{{ $endLabel }}
{{ $day }} @foreach($classes as $class)
{{ $class->timetable_course_code }}
{{ $class->timetable_course_name }}
{{ substr( $class->timetable_time_start, 0, 5 ) }} - {{ substr( $class->timetable_time_end, 0, 5 ) }}
@if(!empty($class->timetable_room))
Room: {{ $class->timetable_room }}
@endif
@if( $class->timetable_teaching_type == 'Lecture' ) Lecture @elseif( $class->timetable_teaching_type == 'Laboratory' ) Laboratory @endif
@endforeach
Lunch
12:00 - 13:00
 
@endif
@endforeach
@endforeach
{{-- ===================================================== --}} {{-- ACTION --}} {{-- ===================================================== --}}
{{-- Back --}} Back to Edit {{-- Send Approve --}}
@csrf
@endsection