@extends('layouts.app') @section('title', $student->name . ' - Student Profile') @section('page-title', 'Student Profile') @section('content')
{{-- Back Button --}} Back to Students {{-- Success Messages --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Profile Header --}}
{{ strtoupper(substr($student->name, 0, 1)) }}

{{ $student->name }}

@if($student->is_active) Active @else Inactive @endif

{{ $student->studentProfile?->schoolClass?->full_name ?? 'No class assigned' }} @if($student->studentProfile?->roll_number) • Roll: {{ $student->studentProfile->roll_number }} @endif @if($student->studentProfile?->admission_number) • Adm: {{ $student->studentProfile->admission_number }} @endif

@if(auth()->user()->isAdmin()) Edit @endif
{{-- Stats Cards --}}

{{ $attendanceStats?->present ?? 0 }}

Days Present

{{ $attendanceStats?->absent ?? 0 }}

Days Absent

{{ $attendanceStats?->late ?? 0 }}

Days Late

@php $total = $attendanceStats?->total_days ?? 0; $present = $attendanceStats?->present ?? 0; $percentage = $total > 0 ? round(($present / $total) * 100, 1) : 0; @endphp

{{ $percentage }}%

Attendance Rate

{{-- Personal Information --}}

Personal Information

Email
{{ $student->email }}
Phone
{{ $student->phone ?? '—' }}
Date of Birth
{{ $student->studentProfile?->dob?->format('d M Y') ?? '—' }}
Gender
{{ ucfirst($student->studentProfile?->gender ?? '—') }}
Blood Group
{{ $student->studentProfile?->blood_group ?? '—' }}
Admission Date
{{ $student->studentProfile?->admission_date?->format('d M Y') ?? '—' }}
@if($student->studentProfile?->address)
Address
{{ $student->studentProfile->address }}
@endif @if($student->studentProfile?->medical_notes)
Medical Notes
{{ $student->studentProfile->medical_notes }}
@endif
{{-- Parent / Guardian --}}

Parent / Guardian

@if($student->studentProfile?->parent) @php $parent = $student->studentProfile->parent; @endphp
Name
{{ $parent->name }}
Email
{{ $parent->email }}
Phone
{{ $parent->phone ?? '—' }}
@else

No parent assigned.

@endif
{{-- Recent Marks --}} @if($recentMarks->isNotEmpty())

Recent Marks

@foreach($recentMarks as $mark) @php $pct = $mark->max_marks > 0 ? round(($mark->marks_obtained / $mark->max_marks) * 100, 1) : 0; $colorClass = $pct >= 80 ? 'text-green-600' : ($pct >= 50 ? 'text-yellow-600' : 'text-red-600'); @endphp @endforeach
Subject Exam Marks Percentage
{{ $mark->subject }} {{ $mark->exam }} {{ $mark->marks_obtained }}/{{ $mark->max_marks }} {{ $pct }}%
@endif
@endsection