@extends('layouts.master') @section('title', 'Teaching Load') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.header') @include('layouts.title')
@yield('title'):{{ $faculty->faculty_title }} {{ $faculty->faculty_name }}

@if (empty($faculty->faculty_picture) || $faculty->faculty_picture === 'profile.jpg') {{-- แสดงอักษรย่อ --}} {{ strtoupper(mb_substr(explode(' ', $faculty->faculty_name)[0], 0, 1) . mb_substr(explode(' ', $faculty->faculty_name)[1] ?? '', 0, 1)) }} @else {{-- แสดงรูป --}} {{ $faculty->faculty_name }} @endif

{{ $faculty->faculty_title }} {{ $faculty->faculty_name }}

{{ $faculty->school_name }} ({{ $faculty->school_shortname }})

@if(!empty($loadviewMode))
@endif {{-- ===================================================== --}} {{-- CONTRACT INFORMATION --}} {{-- ===================================================== --}}

Contract Information

{{-- ================================================= --}} {{-- CONTRACT 1 : EMPLOYEE CONTRACT --}} {{-- ================================================= --}}
{{-- ============================================= --}} {{-- HEADER --}} {{-- ============================================= --}}
Contract 1 Employee Contract
@if($fcontract) @if($fcontract->fcontract_status == 'Active') Active @elseif($fcontract->fcontract_status == 'Expired') Expired @elseif($fcontract->fcontract_status == 'Cancelled') Cancelled @else {{ $fcontract->fcontract_status ?? '-' }} @endif @endif
@if($fcontract) {{-- ============================================= --}} {{-- A. EMPLOYMENT TRACK --}} {{-- ============================================= --}}
A. Employment Track

{{-- Employment Track --}}
Employment Track
{{ $fcontract->employment_name ?? '-' }}
{{-- ========================================= --}} {{-- REGULAR --}} {{-- ========================================= --}} @if($fcontract->fcontract_emp_id == 1)
Regular Option
@if($fcontract->fcontract_regular_option == 1) I. Contract Type (1-60) @elseif($fcontract->fcontract_regular_option == 2) II. Contract Range (after 60) @else - @endif
{{-- Contract Type --}} @if($fcontract->fcontract_regular_option == 1)
Contract Type
{{ $fcontract->contract_type ?? '-' }}
Contract No.
{{ $fcontract->contract_no ?? '-' }}
@endif {{-- Contract Range --}} @if($fcontract->fcontract_regular_option == 2)
Contract Range
{{ $fcontract->age_type_name ?? '-' }}
Contract No.
{{ $fcontract->age_type_no ?? '-' }}
@endif @endif {{-- ========================================= --}} {{-- TEACHING ORIENTED --}} {{-- ========================================= --}} @if($fcontract->fcontract_emp_id == 2)
Teaching Oriented Type
{{ $fcontract->teaching_type_name ?? '-' }}
Contract No.
{{ $fcontract->teaching_type_no ?? '-' }}
@endif {{-- ========================================= --}} {{-- MISSION BASED --}} {{-- ========================================= --}} @if($fcontract->fcontract_emp_id == 3)
Mission Based Type
{{ $fcontract->mission_type_name ?? '-' }}
Contract No.
{{ $fcontract->mission_type_no ?? '-' }}
@endif
{{-- ================================================= --}} {{-- REGULAR : CONTRACT TYPE TABLE --}} {{-- ================================================= --}} @if( $fcontract->fcontract_emp_id == 1 && $fcontract->fcontract_regular_option == 1 )
Workload Arrangement Table for Regular Faculty Members
@foreach($contracts as $type) @endforeach @forelse($WArrangements as $index => $w) @foreach($contracts as $type) @php $value = $regulars ->where( 'regular_name', $w->WArrangement_id ) ->where( 'regular_contract_id', $type->contract_id ) ->first(); @endphp @endforeach @empty @endforelse
No. Workload Arrangement Unit {{ $type->contract_type }}
{{ $index + 1 }} {{ $w->WArrangement_title ?? '-' }} {{ $w->unit_name ?? '-' }} {{ $value->regular_value ?? '-' }}
No Workload Arrangement data.
@endif {{-- ================================================= --}} {{-- REGULAR : CONTRACT RANGE TABLE --}} {{-- ================================================= --}} @if( $fcontract->fcontract_emp_id == 1 && $fcontract->fcontract_regular_option == 2 )
Workload Arrangement Table for Age Range (Special)
@foreach($age_types as $type) @endforeach @forelse($WAages as $index => $w) @foreach($age_types as $type) @php $value = $wages ->where( 'wage_name', $w->WAage_id ) ->where( 'wage_type_id', $type->age_type_id ) ->first(); @endphp @endforeach @empty @endforelse
No. Workload Arrangement Unit {{ $type->age_type_name }}
{{ $index + 1 }} {{ $w->WAage_title ?? '-' }} {{ $w->unit_name ?? '-' }} {{ $value->wage_value ?? '-' }}
No Workload Arrangement data.
@endif {{-- ================================================= --}} {{-- TEACHING ORIENTED TABLE --}} {{-- ================================================= --}} @if($fcontract->fcontract_emp_id == 2)
Workload Arrangement Table for Teaching Oriented
@foreach($teaching_types as $type) @endforeach @forelse($WATeachings as $index => $w) @foreach($teaching_types as $type) @php $value = $teachings ->where( 'teaching_name', $w->WATeaching_id ) ->where( 'teaching_type_id', $type->teaching_type_id ) ->first(); @endphp @endforeach @empty @endforelse
No. Workload Arrangement Unit {{ $type->teaching_type_name }}
{{ $index + 1 }} {{ $w->WATeaching_title ?? '-' }} {{ $w->unit_name ?? '-' }} {{ $value->teaching_value ?? '-' }}
No Workload Arrangement data.
@endif {{-- ================================================= --}} {{-- MISSION BASED TABLE --}} {{-- ================================================= --}} @if($fcontract->fcontract_emp_id == 3)
Workload Arrangement Table for Mission Based
@forelse($WAMissions as $index => $w) @php $value = $missionValues ->where( 'value_WAMission_id', $w->WAMission_id ) ->first(); @endphp @empty @endforelse
No. Workload Arrangement Unit Value
{{ $index + 1 }} {{ $w->WAMission_title ?? '-' }} {{ $w->unit_name ?? '-' }}
{{ $value->value_score ?? '-' }}
No Mission Based data.
@endif {{-- ============================================= --}} {{-- B. ACADEMIC RANK --}} {{-- ============================================= --}}
B. Academic Rank
Academic Rank
{{ $fcontract->academic_rank_name ?? '-' }}
{{-- ============================================= --}} {{-- C. AFFILIATED FUND --}} {{-- ============================================= --}}
C. Affiliated Fund
Affiliated Fund
{{ $fcontract->fund_name ?? '-' }}
{{-- ============================================= --}} {{-- D. PERIOD --}} {{-- ============================================= --}}
D. Period
Start Date
{{ $fcontract->fcontract_start_date ?? '-' }}
End Date
{{ !empty($fcontract->fcontract_end_date) ? $fcontract->fcontract_end_date : 'No End Date' }}
Status
{{ $fcontract->fcontract_status ?? '-' }}
{{-- ============================================= --}} {{-- REQUIRED DOCUMENTS --}} {{-- ============================================= --}}
Required Documents
Academic Rank Appointment
@if(!empty($fcontract->fcontract_doc_rank)) View File @else - @endif
TOR
@if(!empty($fcontract->fcontract_doc_tor)) View File @else - @endif
{{-- ============================================= --}} {{-- REMARK --}} {{-- ============================================= --}}
Remark
{{ $fcontract->fcontract_remark ?: '-' }}
@else
Employee Contract information not found.
@endif
{{-- ================================================= --}} {{-- CONTRACT 2 : ADMINISTRATIVE POSITION CONTRACT --}} {{-- ================================================= --}}
Contract 2 Administrative Position Contract
@if($adcontract_value) @if($adcontract_value->status == 'Approved') Approved @elseif($adcontract_value->status == 'Rejected') Rejected @elseif($adcontract_value->status == 'Pending') Pending @else {{ $adcontract_value->status ?: 'Draft' }} @endif @endif
@if($adcontract_value && $adcontract) {{-- ================================================= --}} {{-- ARRANGEMENT APPROVAL PROGRESS --}} {{-- ================================================= --}}

Workload Arrangement Approval

Academic Year {{ $adcontract_value->adcontract_value_year }} / Semester {{ $adcontract_value->adcontract_value_semester }}
@if($arrangementFlows->count() > 0)
@foreach($arrangementFlows as $flow) @php $flowStatus = strtolower( $flow->flow_status ?? '' ); $buttonClass = 'btn-waiting-flow'; if ($flowStatus == 'success') { $buttonClass = 'btn-success-flow'; } elseif ($flowStatus == 'pending') { $buttonClass = 'btn-pending-flow'; } elseif( $flowStatus == 'reject' || $flowStatus == 'rejected' ) { $buttonClass = 'btn-reject-flow'; } $approverName = trim( ($flow->approver_title ?? '') . ' ' . ($flow->approver_firstname ?? '') . ' ' . ($flow->approver_lastname ?? '') ); if ($flow->flow_order == 1) { $approverName = trim( ($faculty->faculty_title ?? '') . ' ' . ($faculty->faculty_firstname ?? '') . ' ' . ($faculty->faculty_lastname ?? '') ); } @endphp
{{ str_pad( $flow->flow_order, 2, '0', STR_PAD_LEFT ) }}
@if($flowStatus == 'success') Completed @elseif($flowStatus == 'pending') Pending Review @elseif( $flowStatus == 'waiting' && $flow->flow_result == 'Approved' ) Recommend Approval @elseif( $flowStatus == 'waiting' && $flow->flow_result == 'Disapproved' ) Recommend Rejection @elseif( $flowStatus == 'reject' || $flowStatus == 'rejected' ) Rejected @else Waiting for Previous Step @endif
{{ $approverName ?: '-' }}
({{ $flow->flow_actor ?? '-' }})
@if( $flowStatus == 'pending' || $flowStatus == 'waiting' )
Current Step
@endif
@endforeach
@else
No approval workflow found.
@endif {{-- ================================================= --}} {{-- A. POSITION --}} {{-- ================================================= --}}
A. Position
Administrative Position
{{ $adcontract->admin_position_name ?? '-' }}
Sub Position
{{ $adcontract->admin_position_sub_name ?? '-' }}
Appointment No.
{{ $adcontract->adcontract_no ?? '-' }}
{{-- ================================================= --}} {{-- B. WORKLOAD ARRANGEMENT --}} {{-- ================================================= --}}
B. Workload Arrangement for Administrative Position Type
Academic Year
{{ $adcontract_value->adcontract_value_year ?? '-' }}
Semester
{{ $adcontract_value->adcontract_value_semester ?? '-' }}
Administrative Position Type
{{ $adposition_type->adposition_type_name ?? '-' }}
{{-- ================================================= --}} {{-- ADMINISTRATIVE POSITION TYPE TABLE --}} {{-- ================================================= --}}
Administrative Position Type
@foreach($adposition_types as $type) @endforeach @forelse($Wadpositions as $index => $w) @foreach($adposition_types as $type) @php $value = $wpositions ->where( 'wposition_name', $w->Wadposition_id ) ->where( 'wposition_type_id', $type->adposition_type_id ) ->first(); @endphp @endforeach @empty @endforelse
No. Workload Arrangement Unit {{ $type->adposition_type_name }}
{{ $index + 1 }} {{ $w->Wadposition_title ?? '-' }} {{ $w->unit_name ?? '-' }} {{ $value->wposition_value ?? '-' }}
No Administrative Position Type data.
{{-- ================================================= --}} {{-- C. PERIOD --}} {{-- ================================================= --}}
C. Period
Start Date
{{ $adcontract->adcontract_start_date ?? '-' }}
End Date
{{ !empty($adcontract->adcontract_end_date) ? $adcontract->adcontract_end_date : 'No End Date' }}
{{-- ================================================= --}} {{-- APPROVAL HISTORY --}} {{-- ================================================= --}} @if($arrangementFlows->count() > 0)
Approval History
@foreach($arrangementFlows as $flow) @php $historyStatus = strtolower( $flow->flow_status ?? '' ); $historyDate = $flow->flow_updated ?? $flow->flow_created; $actorName = trim( ($flow->approver_title ?? '') . ' ' . ($flow->approver_firstname ?? '') . ' ' . ($flow->approver_lastname ?? '') ); if ($flow->flow_order == 1) { $actorName = trim( ($faculty->faculty_title ?? '') . ' ' . ($faculty->faculty_firstname ?? '') . ' ' . ($faculty->faculty_lastname ?? '') ); } @endphp @if( in_array( $historyStatus, [ 'success', 'reject', 'rejected' ] ) )
@if($historyDate) {{ \Carbon\Carbon::parse( $historyDate )->format( 'd M Y H:i' ) }} @else - @endif
@if($flow->flow_order == 1) {{ $flow->flow_activity ?? 'Requested' }} @elseif($historyStatus == 'success') {{ $flow->flow_activity ?? 'Approved' }} @else Rejected @endif by {{ $actorName ?: '-' }} @if(!empty($flow->flow_comment))
{{ $flow->flow_comment }}
@endif
@endif @endforeach
@endif @else
No Administrative Position / Workload Arrangement found for Academic Year {{ $teachingLoad->teaching_load_year }} Semester {{ $teachingLoad->teaching_load_semester }}.
@endif

Teaching Load Approval

Academic Year {{ $teachingLoad->teaching_load_year }} / Semester {{ $teachingLoad->teaching_load_semester }}
@php $status = $teachingLoad->teaching_load_status; @endphp @if($status == 'Approved') Approved @elseif($status == 'Rejected') Rejected @elseif($status == 'Pending') Pending @else {{ $status }} @endif
{{-- =========================================== --}} {{-- Workflow Progress --}} {{-- =========================================== --}}
@foreach($teachingLoadFlows as $flow) @php $flowStatus = strtolower( $flow->flow_status ?? '' ); $buttonClass = 'btn-waiting-flow'; if ($flowStatus == 'success') { $buttonClass = 'btn-success-flow'; } elseif ($flowStatus == 'pending') { $buttonClass = 'btn-pending-flow'; } elseif ( $flowStatus == 'reject' || $flowStatus == 'rejected' ) { $buttonClass = 'btn-reject-flow'; } $approverName = trim( ($flow->approver_title ?? '') . ' ' . ($flow->approver_firstname ?? '') . ' ' . ($flow->approver_lastname ?? '') ); @endphp
{{ str_pad( $flow->flow_order, 2, '0', STR_PAD_LEFT ) }}
@if( $flowStatus == 'success' ) Completed @elseif( $flowStatus == 'pending' ) Pending Review @elseif( $flowStatus == 'waiting' && $flow->flow_result == 'Approved' ) Recommend Approval @elseif( $flowStatus == 'waiting' && $flow->flow_result == 'Disapproved' ) Recommend Rejection @elseif( $flowStatus == 'reject' || $flowStatus == 'rejected' ) Rejected @else Waiting for Previous Step @endif
@if(!empty($approverName)) {{ $approverName }} @else - @endif
({{ $flow->flow_actor }})
@if( $flowStatus == 'pending' || $flowStatus == 'waiting' )
Current Step
@endif
@endforeach
{{-- =========================================== --}} {{-- Workflow History --}} {{-- =========================================== --}}
@foreach($teachingLoadFlows as $flow) @php // วันที่ของ step $historyDate = $flow->flow_updated ?? $flow->flow_created; // ชื่อคนที่ทำรายการ $actorName = trim( ($flow->approver_title ?? '') . ' ' . ($flow->approver_firstname ?? '') . ' ' . ($flow->approver_lastname ?? '') ); // ถ้าเป็น Faculty step แรก // ใช้ชื่อเจ้าของ Teaching Load if ($flow->flow_order == 1) { $actorName = trim( ($faculty->faculty_title ?? '') . ' ' . ($faculty->faculty_firstname ?? '') . ' ' . ($faculty->faculty_lastname ?? '') ); } @endphp {{-- แสดงเฉพาะ step ที่เกิด action แล้ว --}} @if( in_array( $flow->flow_status, [ 'Success', 'Reject', 'Rejected' ] ) )
{{-- วันที่ --}}
@if($historyDate) {{ \Carbon\Carbon::parse($historyDate) ->format('d M Y H:i') }} @else - @endif
{{-- ================================= --}} {{-- Faculty Request --}} {{-- ================================= --}} @if($flow->flow_order == 1) {{ $flow->flow_activity ?? 'Requested' }} {{-- ================================= --}} {{-- Approved / Verify --}} {{-- ================================= --}} @elseif($flow->flow_status == 'Success') {{ $flow->flow_activity ?? 'Approved' }} {{-- ================================= --}} {{-- Rejected --}} {{-- ================================= --}} @elseif( $flow->flow_status == 'Reject' || $flow->flow_status == 'Rejected' ) Rejected @endif by {{ $actorName ?: '-' }} {{-- Comment --}} @if(!empty($flow->flow_comment))
{{ $flow->flow_comment }}
@endif
@endif @endforeach

{{-- Approval Progress --}} {{-- Teaching Load Information --}}
Academic Year {{ $teachingLoad->teaching_load_year }} Semester {{ $teachingLoad->teaching_load_semester }}
{{-- ===================================================== --}} {{-- 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) {{-- No. --}} {{-- Internal Committee Name --}} {{-- Document --}} @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
{{-- ===================================================== --}} {{-- TEACHING LOAD REVIEW ACTION --}} {{-- ===================================================== --}} @if($currentFlow) {{-- ================================================= --}} {{-- CURRENT RECOMMENDATION --}} {{-- ================================================= --}} @if( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Approved' )
Current Recommendation: Approval
Your recommendation has been saved, but the request has not been submitted yet.
You may change your recommendation before submitting it from the All Request page.
@elseif( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Disapproved' )
Current Recommendation: Rejection
@if( !empty( $currentFlow->flow_comment ) )
Reason: {{ $currentFlow->flow_comment }}
@endif
Your recommendation has been saved, but the request has not been submitted yet.
You may change your recommendation before submitting it from the All Request page.
@endif {{-- ================================================= --}} {{-- BUTTONS --}} {{-- ================================================= --}}
{{-- ============================================= --}} {{-- APPROVAL --}} {{-- ============================================= --}} @if( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Approved' ) @else @endif {{-- ============================================= --}} {{-- REJECTION --}} {{-- ============================================= --}} @if( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Disapproved' ) @else @endif
{{-- ================================================= --}} {{-- APPROVAL FORM --}} {{-- ================================================= --}}
@csrf
{{-- ================================================= --}} {{-- REJECTION FORM --}} {{-- ================================================= --}}
@csrf
{{-- ================================================= --}} {{-- REJECTION MODAL --}} {{-- ================================================= --}} @endif
@include('layouts.footer') @endsection