@extends('layouts.master') @section('title', 'View Workload Arrangement For Administrative Position') @section('style') @endsection @section('script') @section('script') @endsection @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 }})

II. Administative Position

{{-- ===================================================== --}} {{-- ARRANGEMENT APPROVAL PROGRESS --}} {{-- ===================================================== --}}

Workload Arrangement Approval

Academic Year {{ $adcontract->adcontract_value_year }} / Semester {{ $adcontract->adcontract_value_semester }}
@php $arrangementStatus = $adcontract->status ?? null; @endphp @if($arrangementStatus == 'Approved') Approved @elseif($arrangementStatus == 'Rejected') Rejected @elseif($arrangementStatus == 'Pending') Pending @else {{ $arrangementStatus ?: 'Draft' }} @endif
@if($flows->count() > 0)
@foreach($flows 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 ?? '') ); /* |-------------------------------------------------------------------------- | Step 1 = Faculty |-------------------------------------------------------------------------- */ 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
Administrative Position : {{ $adcontract->admin_position_name }}
Sub Position : {{ $adcontract->admin_position_sub_name }}
Appointment No. : {{ $adcontract->adcontract_no }}


B. Workload Arrangement for Administrative Position Type
Academic Year : {{ $adcontract->adcontract_value_year }}
Semester : {{ $adcontract->adcontract_value_semester }}
Administrative Position Type : {{ $adcontract->adposition_type_name }}
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
Start Date : {{ $adcontract->adcontract_start_date }}
End Date : {{ $adcontract->adcontract_end_date }}
{{-- ===================================================== --}} {{-- APPROVAL HISTORY --}} {{-- ===================================================== --}}
Approval History
@foreach($flows 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
@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 {{-- ===================================================== --}} {{-- REVIEW ACTION --}} {{-- ===================================================== --}}
{{-- ================================================= --}} {{-- RECOMMEND APPROVAL --}} {{-- ================================================= --}} @if( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Approved' ) {{-- เลือก Approval อยู่แล้ว --}} @else {{-- ยังไม่ได้เลือก หรือเปลี่ยนใจจาก Rejection --}} @endif {{-- ================================================= --}} {{-- RECOMMEND REJECTION --}} {{-- ================================================= --}} @if( $currentFlow->flow_status == 'Waiting' && $currentFlow->flow_result == 'Disapproved' ) {{-- เลือก Rejection อยู่แล้ว --}} @else {{-- ยังไม่ได้เลือก หรือเปลี่ยนใจจาก Approval --}} @endif
{{-- ===================================================== --}} {{-- FORM : APPROVAL --}} {{-- ===================================================== --}}
@csrf
{{-- ===================================================== --}} {{-- FORM : REJECTION --}} {{-- ===================================================== --}}
@csrf
{{-- ===================================================== --}} {{-- REJECTION MODAL --}} {{-- ===================================================== --}} @endif
@include('layouts.footer') @endsection