لوحة طلباتي — الكل في مكان واحد
طلبات الإدارة • المشرف • الغياب • البلاغات/الاعتراضات — مرتبة من الأحدث للأقدم.
{{-- KPIs --}}
@php
$pill = function($label,$val,$cls,$icon){
return "
";
};
@endphp
{!! $pill('معلّق', (int)($kpis['pending'] ?? 0), 'text-amber-200', 'fa-clock') !!}
{!! $pill('مقبول', (int)($kpis['approved'] ?? 0), 'text-emerald-200','fa-circle-check') !!}
{!! $pill('مرفوض', (int)($kpis['rejected'] ?? 0), 'text-rose-200', 'fa-circle-xmark') !!}
{!! $pill('إدارة عليا', (int)($kpis['high'] ?? 0), 'text-fuchsia-200','fa-crown') !!}
{!! $pill('المشرف', (int)($kpis['mod'] ?? 0), 'text-sky-200', 'fa-user-shield') !!}
{!! $pill('غياب', (int)($kpis['absence'] ?? 0), 'text-indigo-200', 'fa-calendar-days') !!}
{!! $pill('بلاغات', (int)($kpis['report'] ?? 0), 'text-orange-200', 'fa-flag') !!}
{!! $pill('الإجمالي',(int)($kpis['total'] ?? 0), 'text-white', 'fa-layer-group') !!}
{{-- Filters --}}
@foreach($items as $it)
@php
$kind = (string)($it['kind'] ?? 'other');
$st = (string)($it['status'] ?? 'pending');
$statusLabel = match($st){
'approved' => 'مقبول',
'rejected' => 'مرفوض',
default => 'قيد المراجعة',
};
$statusCls = match($st){
'approved' => 'bg-emerald-500/15 border-emerald-400/25 text-emerald-200',
'rejected' => 'bg-rose-500/15 border-rose-400/25 text-rose-200',
default => 'bg-amber-500/15 border-amber-400/25 text-amber-200',
};
$kindLabel = match($kind){
'high' => 'الإدارة العليا',
'mod' => 'المشرف',
'absence'=> 'طلب غياب',
'report' => 'بلاغ/اعتراض',
default => 'طلب',
};
$kindIcon = match($kind){
'high' => 'fa-crown',
'mod' => 'fa-user-shield',
'absence'=> 'fa-calendar-days',
'report' => 'fa-flag',
default => 'fa-inbox',
};
$title = (string)($it['title'] ?? 'بدون عنوان');
$subtitle = trim((string)($it['subtitle'] ?? ''));
$target = trim((string)($it['target'] ?? ''));
$dt = $it['created_at'] ?? null;
$dateTxt = $dt ? \Carbon\Carbon::parse($dt)->format('Y-m-d H:i') : '—';
$route = (string)($it['route'] ?? '#');
$isClickable = $route !== '#';
@endphp
{{-- Badges --}}
{{ $statusLabel }}
{{ $kindLabel }}
@if($target !== '')
{{ $target }}
@endif
{{-- Title --}}
{{-- Subtitle --}}
@if($subtitle !== '')
{{ $subtitle }}
@endif
{{-- Meta --}}
{{ $dateTxt }}
•
#{{ (int)($it['id'] ?? 0) }}
{{-- CTA --}}
@if($isClickable)
فتح
@else
لا يوجد رابط
@endif
{{-- Mini note --}}
الحالة: {{ $statusLabel }}
النوع: {{ $kindLabel }}
الترتيب: الأحدث للأقدم
@endforeach