{{-- resources/views/livewire/kesiswaan/dashboard.blade.php --}} {{-- Pastikan TailwindCSS & Bootstrap Icons sudah ada di layout --}}
{{-- Header + Filter --}}

Dashboard Kesiswaan

Pemantauan pelanggaran siswa secara ringkas

{{-- Rentang waktu --}}
Rentang: @foreach (['7'=>'7H','30'=>'30H','90'=>'90H','365'=>'1T','all'=>'Semua'] as $k => $label) @endforeach
{{-- Periode --}} {{-- Kelas --}} {{-- Jenis --}} {{-- Status --}}
{{-- Quick links --}}
Kelola Pelanggaran
Buka halaman pelanggaran (berat/sedang/ringan)
Data Siswa
Lihat daftar siswa & kelas
{{-- Stat Cards --}}
Total Siswa
{{ number_format($totalSiswa) }}
Seluruh waktu
Total Kelas
{{ number_format($totalKelas) }}
Seluruh waktu
Pelanggaran @if($filterPeriode) (Periode) @endif
{{ number_format($totalPelanggaran) }}
@php $jr = $byJenis['ringan'] ?? 0; $js = $byJenis['sedang'] ?? 0; $jb = $byJenis['berat'] ?? 0; $sumJenis = max(1, $jr + $js + $jb); @endphp
Ringan
{{ $jr }}
Sedang
{{ $js }}
Berat
{{ $jb }}
{{ $range === 'all' ? 'Semua waktu' : $range.' hari terakhir' }}
Status Tindak Lanjut
@php $sd = $byStatus['diproses'] ?? 0; $ss = $byStatus['selesai'] ?? 0; $sumSt = max(1, $sd + $ss); @endphp
Diproses
{{ $sd }}
Selesai
{{ $ss }}
Mengikuti semua filter di atas
{{-- Tren 6 Bulan
Tren Pelanggaran — 6 Bulan Terakhir @if($filterPeriode) (Periode) @endif
Puncak: {{ $trendMax }}
@foreach ($trend as $t) @php $h = $trendMax ? max(4, round(($t['count'] / $trendMax) * 100)) : 4; @endphp
{{ $t['label'] }}
{{ $t['count'] }}
@endforeach
--}} {{-- Dua kolom: Terbaru & Top Siswa --}}
{{-- Pelanggaran Terbaru --}}
Pelanggaran Terbaru
Lihat halaman pelanggaran
@forelse($latest as $row)
{{ ucfirst($row->jenis) }}
{{ $row->siswa->nama ?? '—' }} {{ $row->siswa->kelas->nama ?? '—' }}
{{ $row->deskripsi }}
{{ optional($row->created_at)->format('d M Y H:i') }}
{{ ucfirst($row->status) }}
@empty
Belum ada data untuk filter aktif.
@endforelse
{{-- Top Siswa --}}
Top Siswa (Jumlah Pelanggaran)
Mengikuti filter
@forelse($topSiswa as $i => $t)
{{ $t['nama'] }}
{{ $t['kelas'] }}
{{ $t['count'] }}
@empty
Tidak ada data untuk filter aktif.
@endforelse