@php // Embed the Gujarati fonts inline (data: URIs) — works in every environment $fontRegular = 'data:font/ttf;base64,' . base64_encode(file_get_contents(resource_path('fonts/NotoSansGujarati-Regular.ttf'))); $fontBold = 'data:font/ttf;base64,' . base64_encode(file_get_contents(resource_path('fonts/NotoSansGujarati-Bold.ttf'))); $logoDataUri = 'data:image/png;base64,' . base64_encode(file_get_contents(resource_path('images/leave-logo.png'))); $employee = $la->employee; $name = trim(($employee?->First_Name ?? '') . ' ' . ($employee?->Last_Name ?? '')) ?: 'Employee'; $code = $employee?->Emp_Code ?? '-'; $fm = strtolower(trim((string) ($employee?->F_M ?? ''))); $salutation = in_array($fm, ['female', 'f']) ? 'Ms.' : 'Mr.'; $profile = $employee?->personalProfile; $designation = $profile?->designation?->Dsg_Desc ?? $profile?->designation?->Dsg_Title ?? '-'; $deptName = 'Ambaji Temple'; $dptIds = $profile?->Dpt_id; if (is_array($dptIds) && count($dptIds)) { $dept = \Illuminate\Support\Facades\DB::table('dept_master')->whereIn('Dpt_id', $dptIds)->first(); if ($dept) { $deptName = trim(($dept->Dpt_Name ?? '') . ' . ' . ($dept->Dpt_Desc ?? '')) ?: 'Ambaji Temple'; } } $leaveType = $la->leaveType?->LT_name ?? 'Casual Leave'; $dateFrom = optional($la->Fr_Date)->format('d/m/Y'); $dateTo = optional($la->To_Date)->format('d/m/Y'); $today = now()->format('d.m.Y'); $days = rtrim(rtrim(number_format((float) $la->Tot_Days, 2), '0'), '.'); $leaveCode = $la->LA_Code ?? ('LA-' . $la->LA_id); $refNo = 'LEV/' . date('mY') . '/Mr._' . str_replace(' ', '_', strtoupper($name)) . '/' . str_pad(abs(crc32($leaveCode . (string) $la->Fr_Date)), 10, '0', STR_PAD_LEFT) . '/1'; $pfx = $la->Prx_HlDy == 1 || $la->Prx_HlDy === true; $sfx = $la->Sfx_HlDy == 1 || $la->Sfx_HlDy === true; $pronoun = in_array($fm, ['female', 'f']) ? 'She' : 'He'; $possessive = in_array($fm, ['female', 'f']) ? 'her' : 'his'; $orgName = $org->Org_Name ?? 'Shri Arasuri Ambaji Mata Devasthan Trust'; @endphp
| {{ $refNo }} | Date : {{ $today }} |
{{ $salutation }} {{ $name }}({{ $code }}), {{ $designation }}, {{ $deptName }} . Ambaji Temple is accorded sanction for {{ $days }} day(s)
| Leave Type | {{ $leaveType }} |
| From / To | {{ $dateFrom }} to {{ $dateTo }} ({{ $days }} day(s)) |
| Head Quarter | Head Quarter from {{ $dateFrom }} to {{ $dateTo }} in {{ $possessive }} favour. |
{{ $pronoun }} is permitted to
suffix holiday(s) with {{ $possessive }} availed leave and with permission to leave
@endif @if ($pfx){{ $pronoun }} is permitted to
prefix holiday(s) with {{ $possessive }} availed leave and with permission to leave
@endifIt is certify that, if {{ $salutation }} {{ $name }}, {{ $designation }} had not availed the leave, {{ $pronoun }} would have been continuing on the same post.
Copy forwarded with compliments to:
1 . {{ $salutation }} {{ $name }},{{ $designation }},{{ $deptName }} . Ambaji Temple.
2 . Shri/Smt Administrator, Administrator . Ambaji Temple.
Disclaimer: This is a system generated document, hence no Signature required.