@extends('layouts.app') @section('content')
@include('layouts.left-menu')
{{-- Profile Header --}}
@if (isset($student->photo)) Profile photo @else Profile photo @endif

{{$student->first_name}} {{$student->last_name}}

@if($promotion_info)

ID Card: {{$promotion_info->id_card_number ?? 'N/A'}}

{{$promotion_info->section->schoolClass->class_name ?? $promotion_info->schoolClass->class_name ?? 'N/A'}} {{$promotion_info->section->section_name ?? 'N/A'}} {{$promotion_info->schoolSession->session_name ?? 'N/A'}}
@else

No enrollment record found

@endif
{{-- Statistics Cards --}}

Total Paid

Rs. {{number_format($total_paid, 2)}}

Outstanding Balance

Rs. {{number_format($total_balance, 2)}}

Attendance Rate

{{$attendance_rate}}%

{{$total_attendance}} total

Payment Type

@if($active_payment_profile) {{ $active_payment_profile->getPaymentTypeName() }} @else Not Set @endif
{{-- Left Column --}}
{{-- Student Information --}}
Personal Information
Email {{$student->email}}
Phone {{$student->phone}}
Gender {{$student->gender}}
Birthday {{$student->birthday}}
Blood Type {{$student->blood_type}}
Nationality {{$student->nationality}}
Religion {{$student->religion}}
{{-- Address Information --}}
Address

{{$student->address}}

@if($student->address2)

{{$student->address2}}

@endif

{{$student->city}}, {{$student->zip}}

{{-- Parents Information --}}
Parents' Information
Father's Name {{$student->parent_info->father_name}}
Father's Phone {{$student->parent_info->father_phone}}
Mother's Name {{$student->parent_info->mother_name}}
Mother's Phone {{$student->parent_info->mother_phone}}
Address {{$student->parent_info->parent_address}}
{{-- Right Column --}}
{{-- Current Payment Profile --}} @if($active_payment_profile)
Current Payment Profile
@if(auth()->user()->role == 'admin') @if($active_payment_profile->balance_remaining > 0) Pay @else Fully Paid @endif @endif

Admission Fee

Rs. {{number_format($active_payment_profile->admission_fee_amount, 2)}}
{{ $active_payment_profile->admission_fee_paid ? 'Paid' : 'Unpaid' }}
@if($active_payment_profile->payment_type === \App\Models\StudentPaymentProfile::TYPE_MONTHLY)

Monthly Fee

Rs. {{number_format($active_payment_profile->recurring_fee_amount, 2)}}

Recurring

@elseif($active_payment_profile->payment_type === \App\Models\StudentPaymentProfile::TYPE_ANNUAL)

Annual Fee

Rs. {{number_format($active_payment_profile->recurring_fee_amount, 2)}}

Recurring

@endif

Current Balance

Rs. {{number_format($active_payment_profile->calculateBalance(), 2)}}

Owed - Paid

@if($active_payment_profile->admission_voucher_number)
Voucher: {{$active_payment_profile->admission_voucher_number}} @if($active_payment_profile->admission_voucher_issued_date) | Issued: {{$active_payment_profile->admission_voucher_issued_date}} @endif
@endif
@else {{-- No Payment Profile --}}
Current Payment Profile
No payment profile found for this student in the current session. @if(auth()->user()->role == 'admin') Please enroll the student or switch to the correct session. @endif
@endif {{-- Payment Transactions --}}
Payment Transactions
@if($payment_transactions->count() > 0)
@foreach($payment_transactions as $transaction) @endforeach
Date Type Session Amount Receipt
{{$transaction->transaction_date}} {{ $transaction->getTransactionTypeName() }} {{ $transaction->promotion->schoolSession->session_name ?? 'N/A' }} Rs. {{number_format($transaction->amount_paid, 2)}} @if($transaction->transaction_number) {{$transaction->transaction_number}} @endif
Total Paid: Rs. {{number_format($total_paid, 2)}}
@else

No payment transactions yet

@endif
{{-- Promotion History --}}
Promotion History
@foreach($promotion_history as $index => $promotion)
{{$promotion->schoolClass->class_name ?? 'N/A'}} - {{$promotion->section->section_name ?? 'N/A'}} @if($index === 0) Current @endif

Session: {{$promotion->schoolSession->session_name ?? 'N/A'}}

ID Card: {{$promotion->id_card_number ?? 'N/A'}}

@if($promotion->paymentProfile)
Payment Type {{$promotion->paymentProfile->getPaymentTypeName()}}
@endif
@endforeach
{{-- Academic Information --}}
Academic Information
@if($promotion_info)
Board Registration No. {{$student->academic_info->board_reg_no ?? 'Not Set'}}
Current Class {{$promotion_info->section->schoolClass->class_name ?? $promotion_info->schoolClass->class_name ?? 'N/A'}}
Current Section {{$promotion_info->section->section_name ?? 'N/A'}}
Current Session {{$promotion_info->schoolSession->session_name ?? 'N/A'}}
@else
This student has no enrollment/promotion record. Please enroll the student first.
@endif
@include('layouts.footer')
@endsection