@extends('admin.admin_dashboard') @section('customcss') @endsection @section('admin') @php $status = strtolower((string) ($pendingApplication->status ?? 'pending')); $statusClass = match ($status) { 'approved' => 'bg-success', 'rejected' => 'bg-danger', default => 'bg-warning text-dark', }; $photoUrl = null; if (!empty($pendingApplication->photo)) { $photoUrl = \Illuminate\Support\Str::startsWith( $pendingApplication->photo, ['http://', 'https://'] ) ? $pendingApplication->photo : url('core/storage/app/public/' . ltrim($pendingApplication->photo, '/')); } $pendingStudents = $pendingApplication->students ?? collect(); $autoSelectedStudents = $pendingStudents ->filter(function ($student) { return !empty($student->student_id); }) ->unique('student_id') ->values(); $relationshipLabels = [ 'father' => 'Father', 'mother' => 'Mother', 'guardian' => 'Guardian', 'other' => 'Other', ]; $getStudentName = function ($pendingStudent) { $student = $pendingStudent->student; return $student?->student_name ?? $student?->student_name_english ?? $student?->name ?? $student?->full_name ?? 'Student not found'; }; $getStudentCode = function ($pendingStudent) { $student = $pendingStudent->student; return $student?->student_code ?? $student?->student_id ?? $student?->unique_id ?? $pendingStudent->student_id ?? 'N/A'; }; $getSessionName = function ($pendingStudent) { $session = $pendingStudent->session; return $session?->session_name ?? $session?->name ?? $session?->title ?? $session?->year ?? 'N/A'; }; $getClassName = function ($pendingStudent) { $class = $pendingStudent->getRelation('class'); return $class?->class_name ?? $class?->name ?? $class?->title ?? $class?->class_title ?? (!empty($class?->class_code) ? 'Class ' . $class->class_code : 'N/A'); }; $getSectionName = function ($pendingStudent) { $section = $pendingStudent->section; return $section?->section_name ?? $section?->name ?? $section?->title ?? 'N/A'; }; $getGroupName = function ($pendingStudent) { $group = $pendingStudent->group; return $group?->group_name ?? $group?->name ?? $group?->title ?? 'N/A'; }; $getRelationship = function ($pendingStudent) use ($relationshipLabels) { $relationship = strtolower((string) ($pendingStudent->relationship ?? '')); return $relationshipLabels[$relationship] ?? ($relationship ? ucfirst($relationship) : 'N/A'); }; $rejectionReason = $pendingApplication->getAttribute('rejection_reason'); @endphp
{{ ucfirst($status) }}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Back to List @if($status === 'pending')
@endif
@if($photoUrl) {{ $pendingApplication->name }} @else
No Photo
@endif

Parent Application Review

Application ID: #{{ str_pad($pendingApplication->id, 6, '0', STR_PAD_LEFT) }}

Applied Date: {{ $pendingApplication->created_at?->format('d/m/Y h:i A') ?? 'N/A' }}

Parent Basic Information
Full Name {{ $pendingApplication->name ?: 'N/A' }} Application ID #{{ str_pad($pendingApplication->id, 6, '0', STR_PAD_LEFT) }}
Email Address {{ $pendingApplication->email ?: 'N/A' }} Phone Number {{ $pendingApplication->phone ?: 'N/A' }}
Submitted Students Information {{ $pendingStudents->count() }} Students
@if($pendingStudents->isNotEmpty()) @else
কোনো শিক্ষার্থীর তথ্য পাওয়া যায়নি।
@endif
Application Status & Processing Information
Submitted On {{ $pendingApplication->created_at?->format('d M Y, h:i A') ?? 'N/A' }} Current Status {{ ucfirst($status) }}
Last Updated {{ $pendingApplication->updated_at?->format('d M Y, h:i A') ?? 'N/A' }} Updated By {{ $pendingApplication->updatedBy?->name ?? 'System / Not updated yet' }}
@if($status === 'rejected' && !empty($rejectionReason))
Rejection Reason: {{ $rejectionReason }}
@endif
@if($status === 'pending') {{-- Approve Modal --}} {{-- Reject Modal --}} @endif @endsection