Leave Request Preview - HR
{{ $leaveRequest->status === 'Certified' ? 'HR CERTIFIED' : strtoupper($leaveRequest->status) }}
arrow_back Back to HR Dashboard
@if(session('error'))
error {{ session('error') }}
@endif @if(session('success'))
check_circle {{ session('success') }}
@endif

Republic of the Philippines

DEPARTMENT OF AGRICULTURE

Cordillera Administrative Region

BPI Compound, Easter Road, Guisad, Baguio City

Stamp of Date of Receipt
APPLICATION FOR LEAVE
1. OFFICE/DEPARTMENT
2. NAME : (Last) (First) (Middle)
3. DATE OF FILING
4. POSITION
5. SALARY
6. DETAILS OF APPLICATION
6.A TYPE OF LEAVE TO BE AVAILED OF
@php $standardTypes = [ 'Vacation Leave', 'Mandatory/Forced Leave', 'Sick Leave', 'Maternity Leave', 'Paternity Leave', 'Special Privilege Leave', 'Solo Parent Leave', 'Study Leave', '10-Day VAWC Leave', 'Rehabilitation Privilege', 'Special Leave Benefits for Women', 'Special Emergency (Calamity) Leave', 'Adoption Leave' ]; $leaveTypeArray = is_string($leaveRequest->leave_type) && $leaveRequest->leave_type[0] === '[' ? json_decode($leaveRequest->leave_type, true) : (is_array($leaveRequest->leave_type) ? $leaveRequest->leave_type : [$leaveRequest->leave_type]); @endphp @foreach($standardTypes as $type)
@endforeach @foreach($leaveTypeArray as $type) @if(!in_array($type, $standardTypes))
Others:
@endif @endforeach
6.B DETAILS OF LEAVE
In case of Vacation/Special Privilege Leave:
@if($leaveRequest->within_ph_details) @endif
@if($leaveRequest->abroad_details) @endif
In case of Sick Leave:
@if($leaveRequest->in_hospital_details) @endif
@if($leaveRequest->out_patient_details) @endif
In case of Special Leave Benefits for Women:
@if($leaveRequest->special_leave_details) @endif
In case of Study Leave:
Other purpose:
6.C NUMBER OF WORKING DAYS APPLIED FOR
INCLUSIVE DATES
@php $displayed = false; $raw = $leaveRequest->inclusive_dates ?? ''; $ranges = []; // Try to decode JSON if it looks like a JSON array if (is_string($raw) && strlen($raw) > 0 && $raw[0] === '[') { $decoded = json_decode($raw, true); if (is_array($decoded)) { $ranges = $decoded; } } elseif (is_array($raw)) { $ranges = $raw; } elseif (is_string($raw)) { $ranges = explode(',', $raw); } if (count($ranges)) { foreach($ranges as $idx => $range) { $range = trim($range, " \""); $dates = explode(' to ', $range); if(count($dates) === 2) { try { $start = \Carbon\Carbon::parse($dates[0]); $end = \Carbon\Carbon::parse($dates[1]); if ($start->format('M Y') === $end->format('M Y')) { echo $start->format('M j') . '-' . $end->format('j, Y'); } elseif ($start->format('Y') === $end->format('Y')) { echo $start->format('M j') . ' - ' . $end->format('M j, Y'); } else { echo $start->format('M j, Y') . ' - ' . $end->format('M j, Y'); } } catch (Exception $e) { echo $range; } } else { // Format single date as 'M j, Y' try { $single = \Carbon\Carbon::parse($range); echo $single->format('M j, Y'); } catch (Exception $e) { echo $range; } } if ($idx !== count($ranges) - 1) echo ', '; $displayed = true; } } if (!$displayed) { echo $raw; } @endphp
6.D COMMUTATION
@if($leaveRequest->admin_signatory)
Division Chief (2nd Signatory)
@php $adminParts = explode('|', $leaveRequest->admin_signatory); $adminName = $adminParts[0] ?? ''; $adminPosition = $adminParts[1] ?? ''; @endphp
{{ $adminPosition }}
@endif @if($leaveRequest->status === 'Rejected' && isset($certData['rejection_comment']))
block Rejected by HR
Reason: {{ $certData['rejection_comment'] }}
{{ $certData['rejected_by'] ?? '' }} {{ $certData['rejected_at'] ? 'on ' . \Carbon\Carbon::parse($certData['rejected_at'])->format('M d, Y g:i A') : '' }}
@endif @if($leaveRequest->attachments) @php $attachments = is_string($leaveRequest->attachments) ? json_decode($leaveRequest->attachments, true) : $leaveRequest->attachments; @endphp @if(is_array($attachments) && count($attachments) > 0)
ATTACHMENTS
@foreach($attachments as $attachment)
@if(str_contains($attachment['mime_type'] ?? '', 'pdf')) picture_as_pdf @elseif(str_contains($attachment['mime_type'] ?? '', 'image')) image @elseif(str_contains($attachment['mime_type'] ?? '', 'word') || str_contains($attachment['mime_type'] ?? '', 'document')) description @else attach_file @endif
{{ $attachment['filename'] ?? 'Unknown file' }}
{{ isset($attachment['size']) ? number_format($attachment['size'] / 1024, 1) . ' KB' : '' }} @if(isset($attachment['uploaded_at'])) • Uploaded {{ \Carbon\Carbon::parse($attachment['uploaded_at'])->format('M d, Y g:i A') }} @endif
@endforeach
@endif @endif
7. DETAILS OF ACTION ON APPLICATION
@csrf
7.A CERTIFICATION OF LEAVE CREDITS
@php $certData = []; if (isset($leaveRequest->certification_data)) { try { $certData = is_string($leaveRequest->certification_data) ? json_decode($leaveRequest->certification_data, true) : $leaveRequest->certification_data; } catch (\Exception $e) { $certData = []; } } @endphp status !== 'Pending' ? 'readonly' : 'required' }} id="asOfDateInput">
Vacation Leave Sick Leave Remarks
Total Earned status !== 'Pending' ? 'readonly' : '' }}> status !== 'Pending' ? 'readonly' : '' }}>
Less this application status !== 'Pending' ? 'readonly' : '' }}> status !== 'Pending' ? 'readonly' : '' }}> @if($leaveRequest->status === 'Pending') @else @endif
Balance status !== 'Pending' ? 'readonly' : '' }}> status !== 'Pending' ? 'readonly' : '' }}>
HR Signatory: JOY ROSE C. BAWAYAN
Administrative Officer V (HRMO III)
7.C APPROVED FOR:
status !== 'Pending' ? 'readonly' : '' }}> days with pay
status !== 'Pending' ? 'readonly' : '' }}> days without pay
status !== 'Pending' ? 'readonly' : '' }}> others (Specify)
@if($leaveRequest->status === 'Pending') @else print Print Form @endif