@extends('layouts.app') @section('title', 'Academic Year Details') @section('content') @php $today = now(); $totalDays = $academicYear->start_date->diffInDays($academicYear->end_date) + 1; $elapsedDays = 0; $remainingDays = $totalDays; if ($today->between($academicYear->start_date, $academicYear->end_date)) { $elapsedDays = $academicYear->start_date->diffInDays($today) + 1; $remainingDays = max($academicYear->end_date->diffInDays($today), 0); } elseif ($today->greaterThan($academicYear->end_date)) { $elapsedDays = $totalDays; $remainingDays = 0; } $progress = $totalDays > 0 ? min(round(($elapsedDays / $totalDays) * 100, 1), 100) : 0; $hasStarted = $today->greaterThanOrEqualTo($academicYear->start_date); $hasEnded = $today->greaterThan($academicYear->end_date); if ($hasEnded) { $periodStatus = 'Completed'; $periodBadge = 'badge-secondary'; } elseif ($hasStarted) { $periodStatus = 'In Progress'; $periodBadge = 'badge-success'; } else { $periodStatus = 'Upcoming'; $periodBadge = 'badge-info'; } @endphp
{{-- ============================================================ Page Header ============================================================ --}}

{{ $academicYear->name }}

@if($academicYear->is_current) Current @endif @if($academicYear->is_active) Active @else Inactive @endif

Academic year information and session overview.

All Academic Years @can('academic-years.edit') Edit Academic Year @endcan
{{-- ============================================================ Summary Cards ============================================================ --}}
{{-- Start Date --}}

Start Date

{{ $academicYear->start_date->format('d M Y') }}

{{-- End Date --}}

End Date

{{ $academicYear->end_date->format('d M Y') }}

{{-- Duration --}}

Duration

{{ number_format($totalDays) }} days

{{-- Period Status --}}

Period Status

{{ $periodStatus }}
{{-- ============================================================ Main Information ============================================================ --}}
{{-- Academic Year Details --}}

Academic Year Information

General information about this academic session.

{{-- Name --}}
Academic Year
{{ $academicYear->name }}
{{-- Status --}}
Record Status
@if($academicYear->is_active) Active @else Inactive @endif
{{-- Start Date --}}
Start Date
{{ $academicYear->start_date->format('l, d F Y') }}
{{-- End Date --}}
End Date
{{ $academicYear->end_date->format('l, d F Y') }}
{{-- Duration --}}
Total Duration
{{ number_format($totalDays) }} days
{{-- Current --}}
Current Academic Year
@if($academicYear->is_current) Yes @else No @endif
{{-- Created --}}
Created At
{{ $academicYear->created_at?->format('d M Y, h:i A') ?? '—' }}
{{-- Last Updated --}}
Last Updated
{{ $academicYear->updated_at?->format('d M Y, h:i A') ?? '—' }}
{{-- ======================================================== Session Status ======================================================== --}}

Session Progress

Current progress of this academic year.

{{-- Percentage --}}

Progress

{{ number_format($progress, 1) }}%

{{ $periodStatus }}
{{-- Progress Bar --}}
{{-- Stats --}}

Elapsed

{{ number_format($elapsedDays) }} days

Remaining

{{ number_format($remainingDays) }} days

{{-- Timeline --}}
{{-- Start --}}

Academic Year Starts

{{ $academicYear->start_date->format('d M Y') }}

{{-- Current --}} @if(!$hasEnded && $hasStarted)

Today

{{ now()->format('d M Y') }}

@endif {{-- End --}}

Academic Year Ends

{{ $academicYear->end_date->format('d M Y') }}

{{-- ============================================================ Related Academic Information ============================================================ --}}
{{-- Academic Structure --}}

Academic Structure

Related records for this academic session.

{{-- Classes --}}

School Classes

Classes configured for the school

@can('school-classes.view') @endcan
{{-- Sections --}}

Sections

Class section configuration

@can('sections.view') @endcan
{{-- Holidays --}}

Holidays

Holidays within this academic period

@can('holidays.view') @endcan
{{-- Record Management --}}

Record Management

Manage this academic year record.

@can('academic-years.edit')

Edit Academic Year

Update dates, status and academic year information.

@endcan @can('academic-years.delete') @if(!$academicYear->is_current)
@csrf @method('DELETE')
@else

Current academic year

The current academic year should not be deleted. Set another academic year as current before removing this record.

@endif @endcan
@endsection @push('scripts') @endpush