@php
// Generate a light tint of the brand color for Pass badge background
$hex = ltrim($brandColor, '#');
$br = hexdec(substr($hex, 0, 2));
$bg = hexdec(substr($hex, 2, 2));
$bb = hexdec(substr($hex, 4, 2));
$lightBrand = sprintf('#%02x%02x%02x',
(int)round($br + (255 - $br) * 0.88),
(int)round($bg + (255 - $bg) * 0.88),
(int)round($bb + (255 - $bb) * 0.88)
);
@endphp
@php
$exePath = public_path('exesync-wordmark-black.png');
$exe64 = file_exists($exePath) ? 'data:image/png;base64,' . base64_encode(file_get_contents($exePath)) : null;
@endphp
{{-- ── Header ── --}}
{{-- ── Pass / Fail badge ── --}}
@if($result)
@if($result->is_passed)
✓ PASS
@else
✗ FAIL
@endif
@endif
{{-- ── Student Details ── --}}
Student Details
Student Name
{{ $student->name }}
Roll Number
{{ $student->roll_number ?? '—' }}
Class / Section
{{ $exam->class->name }}{{ $exam->class->section ? ' – ' . $exam->class->section : '' }}
Exam Date
{{ $exam->date?->format('d M Y') }}
@if(!empty($groupName))
Subject Group
{{ $groupName }}
@endif
{{-- ── Subject-wise Marks ── --}}
Subject-wise Performance
| # |
Subject |
Total |
Passing |
Obtained |
Status |
@foreach($exam->examSubjects as $i => $es)
@php
$m = $marks->firstWhere('subject_id', $es->subject_id);
$obtained = $m && !$m->is_absent ? (float)$m->obtained_marks : null;
$isAbsent = $m && $m->is_absent;
$passed = !$isAbsent && $obtained !== null && $obtained >= $es->passing_marks;
@endphp
| {{ $i + 1 }} |
{{ $es->subject->name }} |
{{ $es->total_marks }} |
{{ $es->passing_marks }} |
@if($isAbsent)
Absent
@elseif($obtained !== null)
{{ $obtained }}
@else
—
@endif
|
@if($isAbsent)
Abs
@elseif($obtained !== null)
{{ $passed ? 'Pass' : 'Fail' }}
@else
—
@endif
|
@endforeach
{{-- ── Result Summary ── --}}
@if($result)
Result Summary
| Total Marks |
{{ $result->total_marks }} |
| Marks Obtained |
{{ $result->total_obtained }} |
| Percentage |
{{ $result->percentage }}% |
| Grade |
{{ $result->grade }} |
| Position in Class |
{{ $result->position ? '#' . $result->position : '—' }} |
| Overall Result |
{{ $result->is_passed ? 'PASS' : 'FAIL' }} |
@endif
{{-- ── Teacher Remarks ── --}}
@if($result?->teacher_remarks)
@endif
{{-- ── Signature Footer ── --}}