Civil Service Form No. 6
Revised 2020
Department of Agriculture Logo
Republic of the Philippines
DEPARTMENT OF AGRICULTURE
Cordillera Administrative Region
BPI Compound, Easter Road, Guisad, Baguio City
APPLICATION FOR LEAVE
1. OFFICE/DEPARTMENT
{{ $leave->office ?? 'Department of Agriculture' }}
2. NAME
{{ $leave->user->name ?? '' }}
3. DATE OF FILING
{{ \Carbon\Carbon::parse($leave->created_at)->format('F j, Y') }}
4. POSITION
{{ $leave->position ?? $leave->user->position ?? 'Employee' }}
5. SALARY
{{ $leave->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($leave->leave_type) && $leave->leave_type[0] === '[' ? json_decode($leave->leave_type, true) : (is_array($leave->leave_type) ? $leave->leave_type : [$leave->leave_type]); @endphp
@foreach($standardTypes as $type)
@endforeach @foreach($leaveTypeArray as $type) @if(!in_array($type, $standardTypes))
@endif @endforeach
6.B DETAILS OF LEAVE
In case of Vacation/Special Privilege Leave:
within_ph) && $leave->within_ph === 'Yes' ? 'checked' : '' }} disabled>
abroad) && $leave->abroad === 'Yes' ? 'checked' : '' }} disabled>
In case of Sick Leave:
in_hospital) && $leave->in_hospital === 'Yes' ? 'checked' : '' }} disabled>
out_patient) && $leave->out_patient === 'Yes' ? 'checked' : '' }} disabled>
In case of Special Leave Benefits for Women:
In case of Study Leave:
completion_masters) && $leave->completion_masters === 'Yes' ? 'checked' : '' }} disabled>
bar_exam) && $leave->bar_exam === 'Yes' ? 'checked' : '' }} disabled>
Other purpose:
monetization) && $leave->monetization === 'Yes' ? 'checked' : '' }} disabled>
terminal_leave) && $leave->terminal_leave === 'Yes' ? 'checked' : '' }} disabled>
6.C NUMBER OF WORKING DAYS APPLIED FOR
{{ $leave->num_days ?? '' }}
6.D INCLUSIVE DATES
@php $displayed = false; if(isset($leave->inclusive_dates) && is_array($leave->inclusive_dates)) { foreach($leave->inclusive_dates as $idx => $range) { $dates = explode(' to ', $range); if(count($dates) === 2) { $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'); } } else { echo $range; } if ($idx !== count($leave->inclusive_dates) - 1) echo ', '; $displayed = true; } } elseif(isset($leave->inclusive_dates) && is_string($leave->inclusive_dates)) { $ranges = explode(',', $leave->inclusive_dates); foreach($ranges as $idx => $range) { $dates = explode(' to ', trim($range)); if(count($dates) === 2) { $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'); } } else { // Format single date as 'M j, Y' try { $single = \Carbon\Carbon::parse($range); echo $single->format('M j, Y'); } catch (Exception $e) { echo trim($range); } } if ($idx !== count($ranges) - 1) echo ', '; $displayed = true; } } if (!$displayed) { echo $leave->inclusive_dates ?? ''; } @endphp
6.E COMMUTATION
commutation) && $leave->commutation === 'Not Requested' ? 'checked' : '' }} disabled>
commutation) && $leave->commutation === 'Requested' ? 'checked' : '' }} disabled>
{{ $leave->user->name ?? '' }}
(Signature of Applicant)
@if($leave->status === 'Certified')
7. DETAILS OF ACTION ON APPLICATION
7.A CERTIFICATION OF LEAVE CREDITS
@php $certData = []; if (isset($leave->certification_data)) { try { $certData = is_string($leave->certification_data) ? json_decode($leave->certification_data, true) : $leave->certification_data; } catch (\Exception $e) { $certData = []; } } @endphp
As of: {{ isset($certData['as_of_date']) ? \Carbon\Carbon::parse($certData['as_of_date'])->format('F j, Y') : '' }}
Vacation Leave Sick Leave
Total Earned {{ $certData['vl_earned'] ?? '-' }} {{ $certData['sl_earned'] ?? '-' }}
Less this application {{ $certData['vl_less'] ?? '-' }} {{ $certData['sl_less'] ?? '-' }}
Balance {{ $certData['vl_balance'] ?? '-' }} {{ $certData['sl_balance'] ?? '-' }}
@php $hrName = $certData['hr_officer'] ?? 'JOY ROSE C. BAWAYAN'; $hrPosition = $certData['hr_position'] ?? 'Administrative Officer V (HRMO III)'; // Handle new combined format if present if (isset($certData['hr_signatory'])) { $hrParts = explode('|', $certData['hr_signatory']); if (count($hrParts) > 1) { $hrName = $hrParts[0]; $hrPosition = $hrParts[1]; } } @endphp
{{ $hrName }}
{{ $hrPosition }}
7.B RECOMMENDATION
{{ $certData['other_remarks'] ?? '' }}
{{ $certData['other_remarks2'] ?? '' }}
{{ $certData['other_remarks3'] ?? '' }}
@php $adminName = $certData['admin_chief'] ?? 'AIDA Y. PAGTAN'; $adminPosition = $certData['admin_position'] ?? 'Chief, Administrative and Finance Division'; // Handle new combined format if present if (isset($certData['admin_signatory'])) { $adminParts = explode('|', $certData['admin_signatory']); if (count($adminParts) > 1) { $adminName = $adminParts[0]; $adminPosition = $adminParts[1]; } } @endphp
{{ $adminName }}
{{ $adminPosition }}
7.C APPROVED FOR:
{{ $certData['days_with_pay'] ?? ($leave->num_days ?? '___') }} days with pay
{{ $certData['days_without_pay'] ?? '___' }} days without pay
{{ $certData['others_specify'] ?? '___' }} others (Specify)
7.D DISAPPROVED DUE TO:
{{ $certData['disapproval_reason1'] ?? '' }}
{{ $certData['disapproval_reason2'] ?? '' }}
@php $directorName = $certData['director'] ?? 'Atty. JENNILYN M. DAWAYAN, CESO IV'; $directorPosition = $certData['director_position'] ?? 'Regional Executive Director'; // Handle new combined format if present if (isset($certData['director_signatory'])) { $directorParts = explode('|', $certData['director_signatory']); if (count($directorParts) > 1) { $directorName = $directorParts[0]; $directorPosition = $directorParts[1]; } } @endphp
{{ $directorName }}
{{ $directorPosition }}
@endif