@extends('layouts.superadmin') @section('title', 'Attendance Heatmap') @section('page-title', 'منظومة الذكاء (EES) - لوحة حرارة الحضور والغياب') @section('content')
{{-- هيدر --}}

لوحة حرارة الحضور والغياب

ملخص يومي للحضور، الغياب بعذر، الغياب بدون عذر، وعدد التحذيرات من جدول التقييم اليومي.

{{-- ملخص --}}
عدد الأيام في الفترة
{{ (int)($summary['days'] ?? 0) }}
سجلات حضور
{{ (int)($summary['present_days'] ?? 0) }}
غياب بعذر
{{ (int)($summary['excused_absence'] ?? 0) }}
غياب بدون عذر
{{ (int)($summary['unexcused'] ?? 0) }}
إجمالي التحذيرات
{{ (int)($summary['warnings'] ?? 0) }}
{{-- فلاتر --}}
إعادة ضبط
{{-- Heatmap جدول --}}

لوحة الحرارة اليومية

كل خلية تمثل عدد التقييمات حسب اليوم ونوع الحضور.

@foreach($statuses as $st) @endforeach @forelse($days as $day) @php $dayLabel = \Carbon\Carbon::parse($day)->format('Y-m-d'); $warnings = 0; @endphp @foreach($statuses as $st) @php $key = $day.'|'.$st; $cell = $matrix[$key] ?? ['count' => 0, 'total_absences' => 0, 'warnings' => 0]; $warnings += $cell['warnings']; $count = $cell['count']; $class = $count ? ($st === 'present' ? 'bg-emerald-500/20 text-emerald-100 border border-emerald-500/40' : ($st === 'absent_with_excuse' ? 'bg-sky-500/20 text-sky-100 border border-sky-500/40' : 'bg-rose-500/20 text-rose-100 border border-rose-500/40')) : 'bg-slate-800/60 text-slate-500 border border-slate-700/60'; @endphp @endforeach @empty @endforelse
اليوم @if($st === 'present') حضور @elseif($st === 'absent_with_excuse') غياب بعذر @else غياب بدون عذر @endif تحذيرات
{{ $dayLabel }} {{ $count ?: '—' }} {{ $warnings ?: '0' }}
لا توجد تقييمات ضمن هذه الفترة.
الهدف من لوحة الحرارة هو كشف الأيام الخطرة بسرعة: أين يتراكم الغياب غير المبرر وأين تقل نسبة الحضور.
@endsection