@extends('admin.layout.app') @section('body') @php $defaultDestinationFacultyId = old('destination_faculty_id', $defaultDestinationSemester?->program?->department?->faculty_id ?? $selectedSemester?->program?->department?->faculty_id); $defaultDestinationDepartmentId = old('destination_department_id', $defaultDestinationSemester?->program?->department_id ?? $selectedSemester?->program?->department_id); $defaultDestinationSemesterId = old('destination_semester_id', $defaultDestinationSemester?->id); $defaultDestinationAcademicYear = old('destination_academic_year', $filters['academic_year'] ?? ''); @endphp

{{ __('admin.promote_students_to_next_semester') }}

Filter students, select the eligible records, and promote them in one clear step.

@if($selectedSemester) {{ $selectedSemester->name }} / {{ $selectedSemester->nextSemester ? 'Next: '.$selectedSemester->nextSemester->name : 'Final semester' }} @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
Reset
@if(! $selectedSemester)
Select the current semester to load students for promotion.
@else
@csrf
From
To
@foreach($academicYears as $year) @endforeach
Filtered Students
Only students with a passing semester result can be selected for normal promotion.
@forelse($students as $student) @php $profile = $student->studentRecord; $result = $student->semesterResults->firstWhere('semester_id', $selectedSemester->id); $eligible = $profile && (int) $profile->current_semester_id === (int) $selectedSemester->id && $result && $result->status === 'pass'; @endphp @empty @endforelse
Select Student Current Faculty Current Department Current Semester Academic Year Exam Result Passed / Failed Student Status
{{ $student->name }}
{{ $student->email }}
{{ $profile?->faculty?->name ?? $profile?->program?->department?->faculty?->name ?? '-' }} {{ $profile?->department?->name ?? $profile?->program?->department?->name ?? '-' }} {{ $profile?->currentSemester?->name ?? '-' }} @if($profile?->currentSemester?->nextSemester)
Next: {{ $profile->currentSemester->nextSemester->name }}
@endif
{{ $profile?->academic_year ?? '-' }} @if($result) GPA: {{ $result->gpa ?? '-' }} @else No result @endif @if($result?->status === 'pass') Passed @elseif($result?->status === 'fail') Failed @elseif($result) {{ ucfirst($result->status) }} @else Pending @endif {{ ucfirst($profile?->status ?? '-') }}
No students found for the selected filters.
{{ $students->links('pagination::bootstrap-4') }}
@endif
@if($canExceptionalPromotion)
Exceptional Promotion
Move a specific student directly to another semester with approval details recorded automatically.
Authorized users only
@csrf
@foreach($academicYears as $year) @endforeach
@endif @endsection