@php function getPronoun($gender, $type, $startOfSentence = true): string { $pronoun = ''; if ($type === 'subject') { $pronoun = $gender == 'male' ? 'He' : 'She'; } else if ($type === 'possessive') { $pronoun = $gender == 'male' ? 'His' : 'Her'; }elseif ($type === 'child') { $pronoun = $gender == 'male' ? 'son' : 'daughter'; } return $startOfSentence ? $pronoun : strtolower($pronoun); } if ($companyType === 'UNV'){ $principalLabel = 'Chancellor'; }elseif ($companyType === 'SCL'){ $principalLabel = 'Headmaster'; }else{ $principalLabel = 'Principal'; } function isMozilla(): bool { $userAgent = $_SERVER['HTTP_USER_AGENT']; return str_contains($userAgent, 'Firefox'); } function getOrdinalSuffix(int $num): string { if ($num > 3 && $num < 21) { return 'th' ; } switch ($num % 10) { case 1: return 'st' ; case 2: return 'nd' ; case 3: return 'rd' ; default: return 'th' ; } } $logoImage='' ; if ($studentTransferCertificateFormate->is_visible_logo_image == 1 && $studentTransferCertificateFormate->is_visible_watermark == 1) { $logoImageUrl = asset('images/eims/setting/design_student_certificate/logo_image/' . $studentTransferCertificateFormate->logo_image); $headerLogoUrl = asset('images/eims/setting/design_student_certificate/logo_image/' . $studentTransferCertificateFormate->logo_image); $logoImage = "background-image: url('$logoImageUrl');"; }elseif ($studentTransferCertificateFormate->is_visible_logo_image == 0 && $studentTransferCertificateFormate->is_visible_watermark == 1) { $logoImageUrl = asset('images/company/' . $company->image); $headerLogoUrl = asset('images/company/' . $company->image); $logoImage = "background-image: url('$logoImageUrl');"; } elseif ($studentTransferCertificateFormate->is_visible_logo_image == 1 && $studentTransferCertificateFormate->is_visible_watermark == 0) { $logoImageUrl = asset('images/eims/setting/design_student_certificate/logo_image/' . $studentTransferCertificateFormate->logo_image); $headerLogoUrl = asset('images/eims/setting/design_student_certificate/logo_image/' . $studentTransferCertificateFormate->logo_image); $logoImage = "background-image: url('$logoImageUrl');"; } else{ $headerLogoUrl = asset('images/company/' . $company->image); } @endphp Certificate @foreach($students as $student)
Left Logo @php $studentData = [ "Name" => $student->name ?? '', "ID No" => $student->student_id_no ?? '', "Session" => $student->eims_session->name ?? '', "Phone" => $student->phone_number ?? '', "Address" => $student->eims_student_information->emergency_contact_person_address ?? '', ]; $jsonData = json_encode($studentData, JSON_PRETTY_PRINT); // Format JSON for readability $sessions = $student->eims_session; $last_session = $student->eims_session ? $student->eims_session : null; $results = $student->eims_academic_exam_result; $last_result = $results->isNotEmpty() ? $results->last() : null; $promotions = $student->eims_student_promotion; $last_promotion = $promotions->isNotEmpty() ? $promotions->last() : null; @endphp
{!! nl2br(e($jsonData)) !!}
Serial No: {{$student->student_id_no}}
ID No: {{$student->student_id_no}}

{{$company->name}}

Provisional Certificate
{{$student->eims_program->name}}
@php $sessions = $student->eims_session; $last_session = $student->eims_session ? $student->eims_session : null; $results = $student->eims_academic_exam_result ?? []; $last_result = !empty($results) ? $results->last() : ' '; $promotions = $student->eims_student_promotion; $last_promotion = $promotions->isNotEmpty() ? $promotions->last() : null; @endphp
This is to Certify that {{ $student->name ?? 'N\A' }} successfully completed all the prescribed requirements of the four-year program for the degree of {{ $student->eims_program->name ?? 'N\A' }} under the Department of {{ $student->eims_program->eims_department->name ?? 'N\A' }} from this University in the {{$student->eims_prev_session->name}}.
{{ getPronoun($student?->gender, 'possessive', true) }} cumulative Grade Point Average (CGPA) is {{ $last_result->grade_point ?? 'N/A' }} in the scale of 4.00.
Prepared by:

Verified by:
@if($studentTransferCertificateFormate->is_visible_principal_signature_image == 1) Movable Image @endif @if($studentTransferCertificateFormate->is_visible_vice_principal_signature_image == 1) Movable Image @endif @if($studentTransferCertificateFormate->is_visible_class_teacher_signature_image == 1) Movable Image @endif @if($studentTransferCertificateFormate->is_visible_stamp_image == 1) Movable Image @endif
Controller of Examination

N.B.: Original Certificate shall not be issued unless Provisional Certificate is surrendered
@endforeach