@extends('layouts.dashboard') @section('title', 'Admin Dashboard') @section('page-content')

Admin Dashboard

Welcome back, {{ auth()->user()->name }}

@if($currentYear) {{ $currentYear->name }} @endif @if($currentSemester) {{ $currentSemester->name }} @endif

Total Students

{{ number_format($stats['total_students']) }}

{{ number_format($stats['active_students']) }} active

Total Staff

{{ number_format($stats['total_staff']) }}

{{ number_format($stats['active_staff']) }} active

Programs

{{ number_format($stats['total_programs']) }}

{{ number_format($stats['total_courses']) }} courses

Pending Applications

{{ number_format($stats['pending_applications']) }}

Review now →

Today's Attendance

{{ $todayAttendance['total_sessions'] > 0 ? number_format($todayAttendance['percentage'], 1) : '0' }}%

@if($todayAttendance['total_sessions'] > 0)
Present: {{ number_format($todayAttendance['present']) }} Absent: {{ number_format($todayAttendance['absent']) }}
@if($todayAttendance['trend'] != 0) {{ $todayAttendance['trend'] > 0 ? '↑' : '↓' }} {{ abs(number_format($todayAttendance['trend'], 1)) }}% from yesterday @else Same as yesterday @endif
@else

No attendance marked today

@endif

Active Timetables

{{ number_format($timetableStats['active_timetables']) }}

Classes: {{ number_format($timetableStats['total_classes']) }} Venues: {{ number_format($timetableStats['total_venues']) }}
@if($timetableStats['conflicts'] > 0) {{ $timetableStats['conflicts'] }} {{ $timetableStats['conflicts'] == 1 ? 'conflict' : 'conflicts' }} detected @else No conflicts detected @endif

Upcoming Exams

{{ number_format($examStats['upcoming_total']) }}

This Week: {{ number_format($examStats['this_week']) }} Next Week: {{ number_format($examStats['next_week']) }}
@if($examStats['next_exam']) @php $daysUntil = now()->diffInDays($examStats['next_exam']->exam_date); $timeLabel = $daysUntil == 0 ? 'Today' : ($daysUntil == 1 ? 'Tomorrow' : 'In ' . $daysUntil . ' days'); @endphp Next: {{ $examStats['next_exam']->code }} - {{ $timeLabel }} {{ date('g:i A', strtotime($examStats['next_exam']->start_time)) }} @else No upcoming exams scheduled @endif

Student Status Distribution

@foreach($studentsByStatus as $status => $count) @php $percentage = $stats['total_students'] > 0 ? ($count / $stats['total_students']) * 100 : 0; $colorClass = match($status) { 'active' => 'bg-green-500', 'suspended' => 'bg-red-500', 'graduated' => 'bg-blue-500', 'withdrawn' => 'bg-gray-500', 'deferred' => 'bg-yellow-500', default => 'bg-gray-400' }; @endphp
{{ $status }} {{ number_format($count) }} ({{ number_format($percentage, 1) }}%)
@endforeach

Recent Applications

View all →
@forelse($recentApplications as $application) @empty @endforelse
Applicant Program Status Date
{{ $application->first_name }} {{ $application->last_name }}
{{ $application->email }}
{{ $application->program->name }} {{ ucfirst(str_replace('_', ' ', $application->status)) }} {{ $application->created_at->format('M d, Y') }}
No recent applications

System Health

Users Online
{{ $systemMetrics['users_online'] }}
Active Users
{{ $systemMetrics['total_users'] }}
Docs Pending
{{ $systemMetrics['documents_pending_verification'] }}

Recent Activity

@forelse($recentActivity->take(5) as $activity)
{{ $activity->user ? strtoupper(substr($activity->user->name, 0, 1)) : 'S' }}

{{ $activity->description }}

{{ $activity->created_at->diffForHumans() }}

@empty

No recent activity

@endforelse
View all activity →
@endsection