@php $user = auth()->user(); if ($user->hasRole('super-admin')) $layout = 'layouts.superadmin'; elseif ($user->hasRole('advisor')) $layout = 'layouts.advisor'; elseif ($user->hasRole('moderator')) $layout = 'layouts.moderator'; else $layout = 'layouts.member'; $type = $type ?? request('type','all'); // all | high | mod | absence | report $status = $status ?? request('status','all'); // all | pending | approved | rejected $from = $from ?? request('from',''); $to = $to ?? request('to',''); $qText = $qText ?? request('q',''); @endphp @extends($layout) @section('title','طلباتي') @section('content')
{{-- HERO --}}
لوحة طلباتي — الكل في مكان واحد

طلباتي

طلبات الإدارة • المشرف • الغياب • البلاغات/الاعتراضات — مرتبة من الأحدث للأقدم.

ضمن الفلاتر
{{ number_format((int)($kpis['total'] ?? 0)) }}
{{-- KPIs --}}
@php $pill = function($label,$val,$cls,$icon){ return "
{$label}
{$val}
"; }; @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 --}}
{{-- LIST --}} @if($items->count())
@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 --}}
{{ $title }}
{{-- Subtitle --}} @if($subtitle !== '')
{{ $subtitle }}
@endif {{-- Meta --}}
{{ $dateTxt }} #{{ (int)($it['id'] ?? 0) }}
{{-- CTA --}}
@if($isClickable) فتح @else لا يوجد رابط @endif
{{-- Mini note --}}
الحالة: {{ $statusLabel }} النوع: {{ $kindLabel }} الترتيب: الأحدث للأقدم
@endforeach
{{ $items->links() }}
@else
لا يوجد طلبات ضمن هذه الفلاتر.
@endif
@endsection