@extends('layouts.app') @section('title', $student->full_name) @section('breadcrumb', 'Students › ' . $student->full_name) @section('content')
{{-- ── LEFT: Biodata card ──────────────────────────────────────────── --}}
{{-- Profile Card --}}
{{ strtoupper(substr($student->first_name,0,1).substr($student->last_name,0,1)) }}
{{ $student->full_name }}
{{ $student->mcss_student_id }}
{{ ucfirst(str_replace('_',' ', $student->status)) }}
@foreach([ ['bi-calendar3', 'Date of Birth', $student->date_of_birth?->format('M d, Y').' (Age '.$student->age.')'], ['bi-gender-ambiguous','Gender', ucfirst($student->gender ?? '—')], ['bi-flag', 'Nationality', $student->nationality], ['bi-map', 'County of Origin', $student->county_of_origin ?? '—'], ['bi-telephone', 'Home Phone', $student->home_phone ?? '—'], ['bi-building', 'Current School', optional($student->currentSchool)->name ?? '—'], ] as [$icon, $label, $value])
{{ $label }}
{{ $value }}
@endforeach
{{-- Guardian Card --}}
Guardian Information
@foreach([ ['Name', $student->guardian_name ?? '—'], ['Relationship', $student->guardian_relationship ?? '—'], ['Phone', $student->guardian_phone ?? '—'], ['Email', $student->guardian_email ?? '—'], ['Occupation', $student->guardian_occupation ?? '—'], ['Address', $student->guardian_address ?? '—'], ] as [$label, $value])
{{ $label }} {{ $value }}
@endforeach
{{-- Actions --}} @if(auth()->user()->isAdminLevel())
Edit Biodata View / Issue Transcript @php $activeTerm = app('current_school')?->currentSession?->currentTerm; @endphp @if($activeTerm) Report Card @endif @if($student->status === 'enrolled') Initiate Transfer @endif
@endif
{{-- ── RIGHT: Academic history + Transfers ─────────────────────────── --}}
{{-- Tab nav --}}
{{-- Academic History --}}
@forelse($student->enrollments as $enrollment)
{{ $enrollment->academicSession->name }} — {{ optional($enrollment->classArm)->full_name ?? '—' }} @ {{ $enrollment->school->name }}
@if($enrollment->session_gpa) GPA {{ $enrollment->session_gpa }} @endif @if($enrollment->position_in_class) Position {{ $enrollment->position_in_class }} @endif {{ ucfirst(str_replace('_',' ', $enrollment->status)) }}
@php $byTerm = $enrollment->termResults->groupBy('term_id'); @endphp @if($byTerm->isEmpty())

No results recorded for this session yet.

@else @foreach($byTerm as $termId => $results)
{{ $results->first()->term->name }} @if($results->whereNull('is_absent')->avg('grade_point')) — Term GPA: {{ round($results->avg('grade_point'), 2) }} @endif
@foreach($results as $r) is_absent) style="opacity:.6;" @endif> @endforeach
Subject CA1 CA2 Exam Total Grade Remark
{{ $r->subject->name }} {{ $r->ca1_score ?? '—' }} {{ $r->ca2_score ?? '—' }} {{ $r->is_absent ? 'ABS' : ($r->exam_score ?? '—') }} {{ $r->total_score ?? '—' }} {{ $r->grade_letter ?? '—' }} {{ $r->remark ?? '—' }}

@endforeach @endif
@empty
No academic records found.
@endforelse
{{-- Transfer History --}}
@forelse($student->transfers as $transfer) @empty @endforelse
Ref From To Reason Date Status
{{ $transfer->transfer_ref }} {{ $transfer->fromSchool->code }} {{ $transfer->toSchool->code }} {{ Str::limit($transfer->reason, 60) }} {{ $transfer->requested_at->format('M d, Y') }} {{ ucfirst($transfer->status) }}
No transfer history.
{{-- Medical --}}
Blood Group
{{ $student->blood_group ?? '—' }}
Disability / Special Needs
{{ $student->disability ?? 'None recorded' }}
Medical Notes
{{ $student->medical_notes ?? 'No medical notes on file.' }}
{{-- end tab-content --}}
@endsection