@php use App\Models\SchoolSetting; use Illuminate\Support\Facades\Storage; $student = $marksheet->student; $exam = $marksheet->exam; $schoolName = SchoolSetting::get('school_name', ''); $schoolAddress = SchoolSetting::get('school_address', ''); $schoolEstablishedYear = SchoolSetting::get('school_established_year', ''); $schoolAddressLine = collect([ $schoolAddress, $schoolEstablishedYear ? "Established: {$schoolEstablishedYear}" : null, ])->filter()->implode(' | '); $useLogo = (bool) SchoolSetting::get('marksheet_use_logo', '1'); $useWatermark = (bool) SchoolSetting::get('marksheet_use_watermark', '0'); $watermarkText = SchoolSetting::get('marksheet_watermark_text', ''); $footerText = SchoolSetting::get('marksheet_footer_text', ''); $toDataUri = function (?string $path): ?string { if (!$path) { return null; } $disk = Storage::disk('public'); if (!$disk->exists($path)) { return null; } $mime = $disk->mimeType($path) ?: 'image/png'; return 'data:' . $mime . ';base64,' . base64_encode($disk->get($path)); }; $logoDataUri = $useLogo ? $toDataUri(SchoolSetting::get('school_logo')) : null; $sealDataUri = $toDataUri(SchoolSetting::get('school_seal')); $signatureDataUri = $toDataUri(SchoolSetting::get('principal_signature')); $contributionSourceName = $rows->first(fn (array $row) => $row['contribution'] !== null)['contribution']['source_name'] ?? null; @endphp
@if ($useWatermark && $watermarkText)| Student Name | {{ $student->user?->name }} | ||
| Class | {{ $student->class?->name }} | Roll No | {{ sprintf('%02d', $student->roll_no) }} |
| Section | {{ $student->section?->name }} | ||
| Subject | MCQ | Written | Practical | @if ($contributionSourceName){{ $contributionSourceName }} | @endifMarks | Best | Grade |
|---|---|---|---|---|---|---|---|
| {{ $row['subject_name'] }} | {{ $row['mcq_marks'] ?? '-' }} | {{ $row['written_marks'] ?? '-' }} | {{ $row['practical_marks'] ?? '-' }} | @if ($contributionSourceName){{ $row['contribution']['contributed_marks'] ?? '-' }} | @endif@if ($row['is_absent']) Absent @else {{ $row['total_marks'] }} @endif | {{ $row['best_marks'] ?? '-' }} | {{ $row['grade_label'] ?? '-' }} |
| Total Marks | {{ $summary['total_marks'] }} | GPA | {{ $summary['gpa'] }} ({{ $summary['overall_grade_label'] }}) |
| Class Rank | {{ $summary['class_rank'] ?? '-' }} | Section Rank | {{ $summary['section_rank'] ?? '-' }} |
| 1st Position Total Marks | {{ $summary['top_rank_total_marks'] ?? '-' }} | 1st Position GPA | @if ($summary['top_rank_gpa']) {{ $summary['top_rank_gpa'] }} ({{ $summary['top_rank_grade_label'] }}) @else - @endif |
|
Class Teacher |
Guardian |
@if ($sealDataUri)
@else @endif School Seal |
@if ($signatureDataUri)
@else @endif Principal's Signature |