{{-- resources/views/superadmin/absences-members/index.blade.php --}} @extends('layouts.superadmin') @section('title','مركز الغياب — غيابات الأعضاء') @section('content')
{{-- HERO --}}
Members Absences Center • SuperAdmin

غيابات الأعضاء — مركز الغياب الذكي

بدون عذر • مع عذر • طلبات الغياب • إحصائيات (ترسيم) • وتتبع قراءة الإدارة تلقائيًا.

بدون عذر: {{ number_format($stats['no_excuse_total'] ?? 0) }} مع عذر: {{ number_format($stats['with_excuse_total'] ?? 0) }} طلبات معلّقة: {{ number_format($stats['requests_pending'] ?? 0) }}
{{-- FILTER --}}
فلترة + مقارنة
تحليل الغياب
{{-- APP --}}
{{-- Main Tabs --}}
{{-- ===================== بدون عذر ===================== --}}
{{-- Sub Tabs: No --}}
@php $noLive = ($noExcuseGrouped['live'] ?? collect()); $noEval = ($noExcuseGrouped['evaluation'] ?? collect()); $noMeet = ($noExcuseGrouped['meeting'] ?? collect()); @endphp {{-- Lives --}}
بدون عذر
لايفات
الفترة: {{ $from }} → {{ $to }}
@if($noLive->isEmpty())
لا يوجد لايفات بدون عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($noLive as $row) @endforeach
العضو اليوم الوقت الحالة
{{ $row->user_name }} {{ $row->day }} {{ $row->time ?? '—' }} {{ $row->status }}
@else
@foreach($noLive as $row) @endforeach
@endif @endif
{{-- Evaluations --}}
بدون عذر
تقييمات الإدارة
الفترة: {{ $from }} → {{ $to }}
@if($noEval->isEmpty())
لا يوجد تقييمات بدون عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($noEval as $row) @endforeach
العضو اليوم الحالة Reviewed By
{{ $row->user_name }} {{ $row->day }} {{ $row->status }} {{ $row->reviewed_by ?? '—' }}
@else
@foreach($noEval as $row) @endforeach
@endif @endif
{{-- Meetings --}}
بدون عذر
آخر
الفترة: {{ $from }} → {{ $to }}
@if($noMeet->isEmpty())
لا يوجد اجتماعات بدون عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($noMeet as $row) @endforeach
العضو اليوم الوقت الحالة
{{ $row->user_name }} {{ $row->day }} {{ $row->time ?? '—' }} {{ $row->status }}
@else
@foreach($noMeet as $row) @endforeach
@endif @endif
{{-- ===================== مع عذر ===================== --}}
{{-- Sub Tabs: Yes --}}
@php $yesLive = ($withExcuseGrouped['live'] ?? collect()); $yesEval = ($withExcuseGrouped['evaluation'] ?? collect()); $yesMeet = ($withExcuseGrouped['meeting'] ?? collect()); @endphp {{-- Lives --}}
مع عذر
لايفات
الفترة: {{ $from }} → {{ $to }}
@if($yesLive->isEmpty())
لا يوجد لايفات مع عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($yesLive as $row) @endforeach
العضو اليوم الوقت الحالة
{{ $row->user_name }} {{ $row->day }} {{ $row->time ?? '—' }} {{ $row->status }}
@else
@foreach($yesLive as $row) @endforeach
@endif @endif
{{-- Evaluations --}}
مع عذر
تقييمات الإدارة
الفترة: {{ $from }} → {{ $to }}
@if($yesEval->isEmpty())
لا يوجد تقييمات مع عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($yesEval as $row) @endforeach
العضو اليوم الحالة
{{ $row->user_name }} {{ $row->day }} {{ $row->status }}
@else
@foreach($yesEval as $row) @endforeach
@endif @endif
{{-- Meetings --}}
مع عذر
آخر
الفترة: {{ $from }} → {{ $to }}
@if($yesMeet->isEmpty())
لا يوجد اجتماعات مع عذر ضمن الفترة.
@else @if(($viewMode ?? 'cards') === 'table')
@foreach($yesMeet as $row) @endforeach
العضو اليوم الوقت الحالة
{{ $row->user_name }} {{ $row->day }} {{ $row->time ?? '—' }} {{ $row->status }}
@else
@foreach($yesMeet as $row) @endforeach
@endif @endif
{{-- ===================== طلبات الغياب ===================== --}}
الغياب
طلبات الغياب
@if(($requests ?? collect())->isEmpty())
لا يوجد طلبات ضمن الفترة.
@else @foreach($requests as $req) @endforeach @endif
{{-- ===================== إحصائيات ===================== --}}
ترسيم
إحصائيات الغياب
بدون عذر
{{ number_format($charts['current']['sum_no'] ?? 0) }}
مع عذر
{{ number_format($charts['current']['sum_yes'] ?? 0) }}
النِّسب
أحمر: {{ $charts['ratios']['no_excuse_pct'] ?? '—' }}%
أخضر: {{ $charts['ratios']['with_excuse_pct'] ?? '—' }}%
الوضع الحالي
Mode / Compare / View
Mode: {{ $mode ?? 'week' }}
Compare: {{ (int)($compare ?? 0) === 1 ? 'ON' : 'OFF' }}
View: {{ $viewMode ?? 'cards' }}
ملاحظة: تغيير يومي/أسبوعي/شهري/كلي يتم من الفلتر بالأعلى (mode).
{{-- ===================== قراءات الإدارة (مُلخّص مجمّع) ===================== --}}
Analytics
قراءات الإدارة للصفحة (ملخص)
الاسم — كم مرة — مجموع الوقت (بدون تكرار)
@if(($adminReadsAgg ?? collect())->isEmpty())
لا يوجد بيانات قراءة بعد. تأكد: جدول admin_page_reads + routes + @stack('scripts') بالـ layout.
@else
@foreach($adminReadsAgg as $a) @php $reads = (int)($a->reads_count ?? 0); $totalMs = (int)($a->total_duration_ms ?? 0); $avgMs = (int)($a->avg_duration_ms ?? 0); $totalSec = (int) round($totalMs / 1000); $avgSec = (int) round($avgMs / 1000); $totalMin = intdiv($totalSec, 60); $totalRem = $totalSec % 60; $avgMin = intdiv($avgSec, 60); $avgRem = $avgSec % 60; $totalPretty = $totalMin > 0 ? ($totalMin.'m '.$totalRem.'s') : ($totalSec.'s'); $avgPretty = $avgMin > 0 ? ($avgMin.'m '.$avgRem.'s') : ($avgSec.'s'); @endphp
{{ $a->admin_name }}
آخر ظهور: {{ $a->last_seen_at ?? '—' }}
كم مرة
{{ number_format($reads) }}
مجموع الوقت
{{ $totalPretty }}
متوسط
{{ $avgPretty }}
* يتم تسجيل Ping كل 30 ثانية + عند إغلاق/إخفاء الصفحة، والواجهة تعرض “ملخص مجمّع”.
@endforeach
@if(($adminReadsRaw ?? collect())->isNotEmpty())
عرض آخر Pings خام (Debug)
@foreach($adminReadsRaw as $r)
{{ $r->admin_name }}
{{ $r->created_at }} • {{ $r->ip_address }}
{{ number_format(round(((int)$r->duration_ms)/1000, 1)) }}s
@endforeach
@endif @endif
{{-- DETAILS MODAL --}}
تفاصيل الغياب
المصدر
اليوم
الوقت
الحالة
Reviewed By
العذر
{{-- REQUEST MODAL --}}
طلب غياب
من
إلى
الحالة
العذر
@push('scripts') @endpush @endsection