@php $cards = $cards ?? []; @endphp
@foreach($cards as $idx => $c)
@php
$reg = $c['reg'] ?? null;
$student = $reg?->student;
$group = $reg?->group;
$session = $reg?->session;
$examClass = $c['exam_class'] ?? 'nine';
$examType = match($examClass) {
'six' => 'PEC',
'eight' => 'JSC',
'nine' => 'SSC',
'eleven' => 'HSC',
default => 'Board Registration'
};
$examFullName = match($examClass) {
'six' => 'Primary Education Completion',
'eight' => 'Junior School Certificate',
'nine' => 'Secondary School Certificate',
'eleven' => 'Higher Secondary Certificate',
default => 'Board Registration'
};
$item = $c['item'] ?? null;
$subjects = is_array($c['subjects'] ?? null) ? $c['subjects'] : [];
$caSubjects = is_array($c['ca_subjects'] ?? null) ? $c['ca_subjects'] : [];
$total = count($subjects);
$mid = (int)ceil($total / 2);
$left = array_slice($subjects, 0, $mid);
$right = array_slice($subjects, $mid);
$logoPath = $school?->school_logo ? asset('storage/' . $school->school_logo) : '';
$photoPath = $student?->student_photo ? asset('storage/' . $student->student_photo) : '';
$principalName = $school?->principal_name ?? 'Principal';
$schoolName = $school?->school_name ?? 'SMART SCHOOL';
$principalSigPath = $school?->principal_signature ? asset('storage/' . $school->principal_signature) : '';
$dupStyle = $c['dup_style'] ?? 'ssc';
$dup = $item?->duplicate_row_data ?? null;
if (is_string($dup)) $dup = json_decode($dup, true);
$dupRaw = is_array($dup) ? ($dup['raw_text'] ?? '') : '';
@endphp
Subject Code and Name
| Code - Name |
Code - Name |
@php $rows = max(count($left), count($right)); @endphp
@if($rows === 0)
| No subject found |
@else
@for($r=0; $r<$rows; $r++)
| @if(isset($left[$r])) {{ $left[$r]['code'] ?? '' }} - {{ $left[$r]['name'] ?? '' }} @endif |
@if(isset($right[$r])) {{ $right[$r]['code'] ?? '' }} - {{ $right[$r]['name'] ?? '' }} @endif |
@endfor
@endif
@if(!empty($caSubjects))
C.A. Subjects
| Code - Name |
@foreach($caSubjects as $ca)
| {{ $ca['code'] ?? '' }} - {{ $ca['name'] ?? '' }} |
@endforeach
@endif
@if(!empty($dupRaw))
*Board information.
@include('admin.board_registration.print.partials.duplicate_header', ['style' => $dupStyle])
@include('admin.board_registration.print.partials.duplicate_row', [
'style' => $dupStyle,
'idx' => $idx,
'item' => $item,
'student' => $student,
'session' => $session,
'group' => $group,
'subjects' => $subjects
])
*All of the above information is correct.
@endif
@if($principalSigPath)

@endif
{{ $principalName }}
Principal
{{ $schoolName }}
@endforeach