@extends('layouts.admin') @section('title', 'Dashboard') @section('header', 'Dashboard') @section('content') {{-- Greeting Banner --}} {{-- Stat Cards --}}
{{ number_format($stats['total_siswa']) }}
Siswa terdaftar
@if(($stats['siswa_bulan_ini'] ?? 0) > 0) +{{ $stats['siswa_bulan_ini'] }} bulan ini @endif
{{ number_format($stats['total_guru']) }}
Pengajar aktif
{{ number_format($stats['total_courses']) }}
Total kursus
@if(($stats['kursus_published'] ?? 0) > 0) {{ $stats['kursus_published'] }} publik @endif
{{ number_format($stats['total_enrollment'] ?? 0) }}
Total pendaftaran
{{-- Main 2-col --}}
{{-- Recent Users --}}
Pengguna Baru
Lihat semua →
@forelse($recentUsers ?? [] as $user) @empty @endforelse
Pengguna Role Bergabung Status
{{ strtoupper(substr($user->name, 0, 1)) }}
{{ $user->name }}
{{ $user->email }}
{{ ucfirst($user->role?->name ?? '—') }} {{ $user->created_at->format('d M Y') }} {{ $user->is_active ? 'Aktif' : 'Nonaktif' }}
Belum ada data pengguna.
{{-- Top Courses --}}
Top Kursus
@forelse($topCourses ?? [] as $course) @php $maxEnroll = $topCourses->max('enrollments_count') ?: 1; @endphp
{{ $loop->iteration }}

{{ $course->title }}

{{ $course->enrollments_count }}
siswa
@empty

Belum ada data.

@endforelse
{{-- Bottom 2 equal --}}
{{-- Pending Submissions --}}
Tugas Belum Dinilai
@if(($stats['pending_submission'] ?? 0) > 0) {{ $stats['pending_submission'] }} tugas @endif
@forelse($pendingSubmissions ?? [] as $sub)
{{ strtoupper(substr($sub->student->name ?? 'S', 0, 1)) }}
{{ $sub->student->name ?? '—' }}
{{ $sub->assignment->title ?? '—' }}
{{ $sub->submitted_at->diffForHumans() }}
@empty

Semua tugas sudah dinilai!

@endforelse
{{-- Progress per Kategori --}}
Progress per Kategori
@forelse($progressPerKategori ?? [] as $item)
{{ $item['kategori'] }} {{ round($item['avg_progress']) }}%
{{ $item['total_kursus'] }} kursus · {{ $item['total_siswa'] }} siswa
@empty

Belum ada data.

@endforelse
{{-- Quick Actions --}}
Aksi Cepat
@php $quickActions = [ ['href' => route('admin.users.create'), 'icon' => 'fa-user-plus', 'bg' => '#eff6ff', 'color' => '#3b82f6', 'label' => 'Tambah Pengguna'], ['href' => route('admin.users.index'), 'icon' => 'fa-users', 'bg' => '#eef2ff', 'color' => '#6366f1', 'label' => 'Daftar Pengguna'], ['href' => route('admin.courses.index'), 'icon' => 'fa-book-open', 'bg' => '#f5f3ff', 'color' => '#8b5cf6', 'label' => 'Kelola Kursus'], ['href' => route('admin.courses.create'),'icon' => 'fa-circle-plus', 'bg' => 'var(--cream-2)', 'color' => 'var(--navy)', 'label' => 'Buat Kursus'], ['href' => route('admin.quiz.index'), 'icon' => 'fa-circle-question', 'bg' => 'var(--gold-light)', 'color' => 'var(--gold)', 'label' => 'Quiz'], ['href' => route('admin.teacher.index'), 'icon' => 'fa-chalkboard-user', 'bg' => '#d1fae5', 'color' => '#065f46', 'label' => 'Data Guru'], ]; @endphp @foreach($quickActions as $action)
{{ $action['label'] }}
@endforeach
@endsection