@extends ('layouts.app', ['title' => 'Dashboard']) @section ('content')
Ringkasan Sistem
Selamat Datang, {{ $user->username }}
{{ Str::headline($activeRole) }} @if ( $activeRole === 'guru' && isset($kelas->nama_kelas) ) Wali Kelas: {{ $kelas->nama_kelas }} @endif
@if ($activeRole === 'guru')
@if ($unreadSuratCount > 0) {{ $unreadSuratCount > 9 ? '9+' : $unreadSuratCount }} @endif
@endif
{{-- DROPDOWN PILIH ANAK --}} @if ($activeRole === 'orang_tua' && $siswas->count())
@endif @if($activeRole === 'guru')
@endif
@php $cardConfigs = [ 'H' => [ 'label' => 'Hadir', 'color' => 'blue', 'icon' => 'fa-user-check' ], 'S' => [ 'label' => 'Sakit', 'color' => 'emerald', 'icon' => 'fa-face-frown-open' ], 'I' => [ 'label' => 'Izin', 'color' => 'amber', 'icon' => 'fa-envelope-open-text' ], 'A' => [ 'label' => 'Alfa', 'color' => 'rose', 'icon' => 'fa-user-xmark' ], ]; @endphp @foreach ($cardConfigs as $k => $conf)
{{ $conf['label'] }}
{{ (int) ($stats[$k] ?? 0) }}
@endforeach

Grafik Kehadiran

Statistik visual absensi periode ini.

Live Data
{{--
{{ print_r($stats, true) }}
--}}
@if ($activeRole === 'guru')
Jadwal Mengajar Hari Ini
Monitoring jadwal realtime dan input absensi siswa.
Jadwal Realtime Hari Ini
{{ now()->translatedFormat('l, d F Y') }}
@forelse ($jadwals as $j) @php /** * STATUS CONFIG */ $statusConfig = match( $j->status_pelajaran ) { 'belum_mulai' => [ 'label' => 'Belum Mulai', 'color' => 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-300', 'icon' => 'fa-clock' ], 'berlangsung' => [ 'label' => 'Sedang Berlangsung', 'color' => 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300', 'icon' => 'fa-play' ], default => [ 'label' => 'Selesai', 'color' => 'bg-rose-100 text-rose-700 dark:bg-rose-900/30 dark:text-rose-300', 'icon' => 'fa-check' ] }; /** * BUTTON AKTIF */ $isBerlangsung = $j->status_pelajaran === 'berlangsung'; @endphp
{{ $statusConfig['label'] }}
{{ $j->hari }}
{{ $j->mapel?->nama_mapel }}
Kelas {{ $j->kelas?->nama_kelas }}
{{ $j->jam_mulai }} - {{ $j->jam_selesai }}
is_berlangsung ? 'onclick=return false;' : '' }} > Mulai Absensi @if (!$j->is_selesai)
@csrf @method ('PUT')
@else
Pelajaran Sudah Diselesaikan
@endif
@if (!$isBerlangsung)
Tombol aktif saat jam pelajaran berlangsung.
@endif
@empty
Tidak ada jadwal hari ini

Anda tidak memiliki jadwal mengajar hari ini.

@endforelse
@endif @php $chartData = $stats ?? [ 'H' => 0, 'S' => 0, 'I' => 0, 'A' => 0 ]; @endphp @endsection