@php $groups = collect(); if ($teacher->group) { $groups = \App\Models\Group::where('id', $teacher->group->id) ->withCount('students') ->orderBy('name') ->get(); } $groupTotal = max(1, $groups->sum('students_count')); $groupColors = ['#172554', '#64748b', '#cbd5e1', '#94a3b8', '#0f172a']; $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 . '%'; } @endphp

Kelompok Santri

@foreach ($groups as $index => $group) {{ $group->name }} @endforeach
{{ $groups->count() }}

Jadwal Aktif

@if ($nextSchedule)

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

@endif
Lihat 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->group?->name }}

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

{{ $label }}

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

@endforeach