@extends('layouts.app') @section('title', 'Dashboard') @section('content')
{{-- Header --}}

Dashboard

Ringkasan pelanggaran siswa

{{-- Gradient Stats Cards --}}

Pelanggaran Hari Ini

{{ $stats['today_violations'] }}

data terbaru

Total Pelanggaran

{{ $stats['total_violations'] }}

semua waktu

Siswa Aktif

{{ $stats['total_students'] }}

terdata

SP Draft

{{ $stats['active_sp'] }}

menunggu tindak lanjut

{{-- Calendar --}}

Kalender Pelanggaran

{{-- Day headers --}}
{{-- Calendar grid --}}
{{-- Legend --}}
1 2 3+ Klik badge untuk lihat detail
{{-- Right Sidebar --}}
{{-- SP Thresholds --}} @if($spThresholds->count() > 0)

Ambang SP

Siswa per level

@foreach($spThresholds as $threshold) @php $studentsAtRisk = \App\Models\Student::where('is_active', true)->get()->filter(function($s) use ($threshold) { $pts = $s->total_points; $maxOk = $threshold->max_points ?? 9999; return $pts >= $threshold->min_points && $pts <= $maxOk; }); $count = $studentsAtRisk->count(); @endphp

{{ $threshold->name }}

{{ $threshold->min_points }}{{ $threshold->max_points ? '–'.$threshold->max_points : '+' }} poin

{{ $count }}

siswa

@if($count > 0)
@endif
@endforeach
@endif {{-- Top 5 Students --}}

Poin Tertinggi

Top 5 siswa

@forelse($topStudents as $student)

{{ $student->full_name }}

{{ $student->class_name }}

{{ $student->total_points }}
@empty

Belum ada data

@endforelse
@if(count($topStudents) > 0) @endif
@push('scripts') @endpush @endsection