@extends('layouts.app')
@section('title', 'Batch Report Cards')
@section('breadcrumb', 'Report Cards › Batch Print')
@section('content')
Batch Report Cards
{{ $term->name }} • {{ $school->name }} •
{{ $enrollments->count() }} student(s)
{{-- One report card per student, page-break between them --}}
@foreach($enrollments as $enrollment)
@php
$student = $enrollment->student;
$results = $enrollment->termResults;
$attendance = $enrollment->attendanceRecord->first();
$validR = $results->where('is_absent',false)->whereNotNull('grade_point');
$termGpa = $validR->count() > 0 ? round($validR->avg('grade_point'),2) : null;
$termAvg = $validR->count() > 0 ? round($validR->avg('total_score'),1) : null;
$passed = $results->where('grade_letter','!=','F')->where('is_absent',false)->count();
$failed = $results->where('grade_letter','F')->count();
$classSize = $enrollment->classArm
? \App\Models\Enrollment::where('class_arm_id',$enrollment->class_arm_id)->where('status','active')->count()
: 0;
@endphp
{{-- Header --}}
{{-- Student Info --}}
Student Name
{{ $student->full_name }}
MCSS Student ID
{{ $student->mcss_student_id }}
Class / Arm
{{ $enrollment->classArm?->full_name ?? '—' }}
Session
{{ $enrollment->academicSession->name }}
Gender
{{ ucfirst($student->gender ?? '—') }}
{{-- Results --}}
Academic Performance
| Subject | CA1 | CA2 | Exam | Total | Grade | GPA | Remark |
@foreach($results->sortBy('subject.name') as $result)
is_absent)class="rc-absent"@endif>
| {{ $result->subject?->name }} |
{{ $result->ca1_score ?? '—' }} |
{{ $result->ca2_score ?? '—' }} |
{{ $result->is_absent ? 'ABS' : ($result->exam_score ?? '—') }} |
{{ $result->total_score ?? '—' }} |
{{ $result->grade_letter ?? '—' }} |
{{ $result->grade_point ?? '—' }} |
@endforeach
| Term Summary: |
{{ $termAvg ?? '—' }} |
— |
{{ $termGpa ?? '—' }} |
{{ $enrollment->position_in_class ? "Pos: {$enrollment->position_in_class}/{$classSize}" : '—' }} |
{{-- Bottom Summary --}}
Term GPA
{{ $termGpa ?? '—' }}
Average
{{ $termAvg ?? '—' }}%
Position
{{ $enrollment->position_in_class ? "{$enrollment->position_in_class}/{$classSize}" : '—' }}
Attendance
@if($attendance){{ $attendance->days_present }}/{{ $attendance->days_school_opened }}d ({{ $attendance->attendance_percent }}%)@else —@endif
Grading Key: A(90-100) B+(80-89) B(70-79) C+(60-69) C(50-59) D(40-49) F(0-39)
Principal's Signature & Stamp
Parent / Guardian Signature
@endforeach
@endsection
@push('styles')
@endpush