@php $totalStudents = max(1, $stats['students']); $malePercent = round(($genderCounts['male'] / $totalStudents) * 100); $femalePercent = 100 - $malePercent; $groupTotal = max(1, $groups->sum('students_count')); $groupColors = [ '#3B82F6', // Biru '#EF4444', // Merah '#10B981', // Hijau '#F59E0B', // Kuning '#8B5CF6', // Ungu '#EC4899', // Pink '#06B6D4', // Cyan '#F97316', // Oranye '#84CC16', // Lime '#14B8A6', // Teal '#6366F1', // Indigo '#A855F7', // Violet ]; $groupStops = []; $cursor = 0; foreach ($groups as $index => $group) { $portion = ($group->students_count / $groupTotal) * 100; $start = $cursor; $cursor += $portion; $groupStops[] = ($groupColors[$index % count($groupColors)]) . ' ' . $start . '% ' . $cursor . '%'; } $attendanceSummary = $latestAttendance?->details?->countBy('status') ?? collect(); $days = ['Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu']; $scheduleDetails = $latestSchedule?->details?->groupBy('day') ?? collect(); @endphp

Santri

Laki-laki Perempuan

{{ $genderCounts['male'] }}

Laki-laki

{{ $genderCounts['female'] }}

Perempuan

Kelompok Santri

@if ($groups->isEmpty())
Belum ada data kelompok santri.
@else
@foreach ($groups as $index => $group) {{ $group->name }} @endforeach
{{ $stats['groups'] }}
@foreach ($groups as $group)
{{ $group->name }} {{ $group->students_count }}
@endforeach
@endif

Rata-rata Nilai Tiap Kelompok

{{ $activePeriod?->name }}

Daftar Guru

Lihat semua
@forelse ($teachers->take(6) as $teacher)

{{ $teacher->name }}

{{ $teacher->phone ?: 'Telepon belum diisi' }}

{{ $teacher->group?->name ?: '-' }}

@empty

Data guru belum tersedia.

@endforelse

Jadwal Aktif

@if ($latestSchedule)

{{ $latestSchedule->group?->name }} | {{ substr($latestSchedule->start_time, 0, 5) }} - {{ substr($latestSchedule->end_time, 0, 5) }}

@endif
Kelola jadwal
@foreach ($days as $day)
{{ $day }}
@forelse (($scheduleDetails[$day] ?? collect())->sortBy('order_number') as $detail)
{{ $detail->subject?->name ?: $detail->material_name }}
@empty
-
@endforelse
@endforeach

Presensi Terbaru

@if ($latestAttendance)

{{ $latestAttendance->attendance_date->format('d M Y') }} | Pertemuan ke-{{ $latestAttendance->meeting_number }} | {{ $latestAttendance->teacher?->name ?: '-' }}

@endif
Buka presensi
@foreach (['hadir' => 'Hadir', 'izin' => 'Izin', 'sakit' => 'Sakit', 'alpha' => 'Alpha'] as $status => $label)

{{ $label }}

{{ $attendanceSummary[$status] ?? 0 }}

@endforeach