@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 ── --}}
@if($logoBase64)
logo
{{ $exam->academy->name }}
@if($exam->academy->address){{ $exam->academy->address }}
@endif @if($exam->academy->phone)Tel: {{ $exam->academy->phone }}@endif @if($exam->academy->phone && $exam->academy->email)  |  @endif @if($exam->academy->email){{ $exam->academy->email }}@endif
@else
{{ $exam->academy->name }}
@if($exam->academy->address){{ $exam->academy->address }}
@endif @if($exam->academy->phone)Tel: {{ $exam->academy->phone }}@endif @if($exam->academy->phone && $exam->academy->email)  |  @endif @if($exam->academy->email){{ $exam->academy->email }}@endif
@endif
REPORT CARD
{{ $exam->title }}
{{ $exam->date?->format('d M Y') }}
{{-- ── 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
@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 @endforeach
# Subject Total Passing Obtained Status
{{ $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
{{-- ── 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)
Teacher's Remarks
"{{ $result->teacher_remarks }}"
@endif {{-- ── Signature Footer ── --}}
Class Trainer
Principal / Director