@extends('admin.layout.app') @section('body') @php $n = fn($v) => is_null($v) ? 'N/A' : number_format($v); $students = $stats['students'] ?? 0; $teachers = $stats['teachers'] ?? 0; $courses = $stats['courses'] ?? 0; $enroll = $stats['enrollments'] ?? 0; @endphp

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

{{ now()->format('l, F j, Y') }}

{{ __('admin.today_enroll') }} {{ number_format($todayEnroll) }} {{ __('admin.this_week') }} {{ number_format($weekEnroll) }}
{{ __('admin.students') }}

{{ $n($students) }}

+2.5% {{ __('admin.vs_last_month') }}
{{ __('admin.total_registered') }} {{ __('admin.view_all') }}
{{ __('admin.teachers') }}

{{ $n($teachers) }}

+1.2% {{ __('admin.vs_last_month') }}
{{ __('admin.active_instructors') }} {{ __('admin.view_all') }}
{{ __('admin.courses') }}

{{ $n($courses) }}

0.0% {{ __('admin.vs_last_month') }}
{{ __('admin.active_programs') }} {{ __('admin.view_all') }}
{{ __('admin.enrollments') }}

{{ $n($enroll) }}

+5.3% {{ __('admin.vs_last_month') }}
{{ __('admin.total_registrations') }} {{ __('admin.view_all') }}
{{ __('admin.performance_overview') }}
{{ __('admin.enrollments_payments_last_12_months') }}
{{ __('admin.12_month_window') }}
{{ __('admin.attendance') }}
{{ __('admin.last_30_days') }}
{{ __('admin.live') }}
{{ __('admin.present') }} {{ __('admin.absent') }} {{ __('admin.late') }}
{{ __('admin.top_courses') }}
{{ __('admin.by_enrollment_count') }}
{{ __('admin.view_all_2') }}
@if($topCourses->count())
@foreach($topCourses as $c) @endforeach
{{ __('admin.course_title') }}{{ __('admin.enrollments') }}{{ __('admin.share') }}
{{ $c->title }}
{{ number_format($c->enrollments_count) }} {{ round(($c->enrollments_count / max($enroll,1)) * 100, 1) }}%
@else

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

@endif
{{ __('admin.recent_enrollments') }}
{{ __('admin.latest_8_registrations') }}
{{ __('admin.view_all_2') }}
@if($recentEnrollments->count())
@foreach($recentEnrollments as $e) @php $st = $e->status ?? 'active'; $badgeSoft = $st === 'active' ? 'bg-success bg-opacity-10 text-success' : ($st === 'dropped' ? 'bg-danger bg-opacity-10 text-danger' : 'bg-secondary bg-opacity-10 text-secondary'); @endphp @endforeach
{{ __('admin.id') }}{{ __('admin.course') }}{{ __('admin.status') }}{{ __('admin.date') }}
#ENR-{{ $e->id }} {{ $e->course->title ?? 'Course #'.$e->course_id }} {{ ucfirst($st) }} {{ $e->created_at->format('M d, Y') }}
@else

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

@endif
Dashboard auto-refreshes every 5 minutes. Last update: {{ now()->format('h:i A') }}
@endsection @section('script') @endsection