@extends('layouts.superadmin') @section('title','ملف العضو - الغيابات') @section('content') @php use Carbon\Carbon; $from = $from ?? now()->subDays(90)->toDateString(); $to = $to ?? now()->toDateString(); $absences = $absences ?? collect(); $evaluations = $evaluations ?? collect(); $stats = $stats ?? [ 'approved' => $absences->where('status','approved')->count(), 'pending' => $absences->where('status','pending')->count(), 'rejected' => $absences->where('status','rejected')->count(), 'present' => $evaluations->where('attendance_status','present')->count(), 'excused' => $evaluations->where('attendance_status','absent_with_excuse')->count(), 'noexcuse' => $evaluations->where('attendance_status','absent_without_excuse')->count(), ]; $uName = $user->name ?? $user->username ?? 'عضو'; $uInitial = mb_substr($uName,0,1); // ===== ADD: LED state ===== $led = $ledState ?? 'clear'; $ledClass = $led === 'excused_today' ? 'bg-rose-500' : ($led === 'pending' ? 'bg-amber-500' : 'bg-emerald-500'); // ===== END ADD ===== @endphp
هنا تتابع الغيابات + التقييمات (الحضور) للعضو ضمن فترة محددة، مع كروت تلخيصية وجدولين احترافيين، وإمكانية التبديل بين عرض كروت و جدول.
| الفترة | الحالة | السبب |
|---|---|---|
| {{ Carbon::parse($a->from_date)->toDateString() }} → {{ Carbon::parse($a->to_date)->toDateString() }} | {{ $a->status }} | {{ $a->excuse_reason }} |
| لا يوجد غيابات ضمن الفترة. | ||
| التاريخ | الحالة |
|---|---|
| {{ Carbon::parse($e->evaluation_date)->toDateString() }} | {{ $e->attendance_status }} |
| لا يوجد تقييمات ضمن الفترة. | |