@extends('adminlte::page') @section('title', 'My Children\'s Results') @section('content_header')
| Admission No | Student Name | Class | Exam | Total Points | GPA | Division | Position | Actions | + @forelse($students as $student) @php // Fetch student results for the selected exam (or latest) $studentResult = null; $examId = request('exam_id'); if ($examId) { $studentResult = \App\Models\StudentResult::where('student_id', $student->id) ->where('exam_id', $examId) ->first(); } else { // Get the most recent result (optional) $studentResult = \App\Models\StudentResult::where('student_id', $student->id) ->latest('created_at') ->first(); } @endphp +{{ $student->admission_no }} |
{{ $student->full_name }} {{ $student->email ?? '' }} |
{{ $student->class->name ?? 'N/A' }} | {{ $studentResult ? ($studentResult->exam->name ?? 'N/A') : 'N/A' }} | {{ $studentResult->total_points ?? '-' }} | {{ number_format($studentResult->gpa ?? 0, 2) }} | @if($studentResult) @php $divisionClass = match($studentResult->division) { 'I' => 'success', 'II' => 'primary', 'III' => 'warning', 'IV' => 'danger', default => 'secondary' }; @endphp {{ $studentResult->division }} @else - @endif | {{ $studentResult->position ?? '-' }} | Details | + @emptyNo students found. | @endforelse
|---|
| Subject | Mark | Grade | Point | Remark | + @foreach($marks as $mark) @php $grade = \App\Models\Grade::where('min_mark', '<=', $mark->mark) ->where('max_mark', '>=', $mark->mark) ->first(); @endphp
|---|---|---|---|---|
| {{ $mark->subject->name }} | {{ $mark->mark }} | {{ $grade->name ?? '-' }} | {{ $grade->point ?? 0 }} | {{ $grade->description ?? '-' }} |