{{-- resources/views/superadmin/proactive/command/index.blade.php --}} @extends('layouts.superadmin') @section('title', 'ProActive — مركز القيادة') @section('page-title', 'ProActive Command Center') @section('content') @php use Illuminate\Support\Facades\Route; if (!function_exists('safe_route')) { function safe_route(string $name, array $params = [], bool $absolute = true, string $fallback = '#'): string { try { return Route::has($name) ? route($name, $params, $absolute) : $fallback; } catch (\Throwable $e) { return $fallback; } } } @endphp @php // Helpers $qs = request()->query(); $q = fn($k,$d=null) => request()->get($k,$d); $today = $today ?? now()->toDateString(); $todayTotal = (int)($todayTotal ?? 0); $todayActiveNow = (int)($todayActiveNow ?? 0); $lateCount = (int)($lateCount ?? 0); $stuckCount = (int)($stuckCount ?? 0); $todayList = $todayList ?? collect(); $proEscalationsDue = (int)($proEscalationsDue ?? ($lateCount + $stuckCount)); $proConflictsCount = (int)($proConflictsCount ?? 0); $view = (string)($view ?? $q('view','table')); if(!in_array($view,['table','cards'],true)) $view = 'table'; // روابط (بـsafe_route عندك) $rCommand = safe_route('superadmin.proactive.command', [], true, url()->current()); $rCommandData= safe_route('superadmin.proactive.command.data', [], true, '#'); $rConflicts = safe_route('superadmin.proactive.conflicts', [], true, '#'); $rEscalations= safe_route('superadmin.proactive.escalations', [], true, '#'); $rProofs = safe_route('superadmin.proactive.proofs', [], true, '#'); $rDecisions = safe_route('superadmin.proactive.decisions', [], true, '#'); $rCompliance = safe_route('superadmin.proactive.compliance', [], true, '#'); $rTemplates = safe_route('superadmin.proactive.templates', [], true, '#'); $rRules = safe_route('superadmin.proactive.rules', [], true, '#'); // Badge style helper $chip = fn($cls) => "px-2.5 py-1 rounded-xl border text-[11px] font-extrabold $cls"; @endphp
{{-- HERO --}}
ProActive • القيادة العليا

مركز القيادة ProActive — Command Center

لوحة مراقبة فورية: المواعيدالتعارضاتالتصعيداتالإثباتات. الهدف: ما في ولا فعالية تضيع أو تتأخر بدون قرار.

اليوم: {{ $today }} @if($proEscalationsDue > 0) تصعيدات: {{ $proEscalationsDue }} @endif @if($proConflictsCount > 0) تعارضات: {{ $proConflictsCount }} @endif تحديث مباشر (AJAX)
{{-- VIEW TOGGLES + QUICK LINKS --}}
{{-- STATS --}}
إجمالي اليوم
{{ $todayTotal }}
نشِطة الآن
{{ $todayActiveNow }}
متأخرة
{{ $lateCount }}
عالقة
{{ $stuckCount }}
تعارضات اليوم
{{ $proConflictsCount }}
تصعيدات واجبة
{{ $proEscalationsDue }}
{{-- COMMAND TOOLBAR --}}
أدوات القيادة السريعة
افتح التقارير الرسمية: الالتزام • الإثباتات • القرارات • القوالب • القواعد.
{{-- LIVE PANELS (AJAX) --}}
{{-- TODAY LIST (SERVER) --}}
مواعيد اليوم
عرض سريع — {{ $view==='cards' ? 'كروت' : 'جدول' }}
@if($todayList instanceof \Illuminate\Support\Collection && $todayList->isNotEmpty()) @if($view === 'cards')
@foreach($todayList as $e) @php $type = (string)($e->event_type ?? 'regular'); $title = (string)($e->event_title ?? '—'); $date = (string)($e->event_date ?? ''); $time = (string)($e->event_time ?? ''); $dur = (int)($e->duration_minutes ?? 0); $plat = (string)($e->platform ?? 'other'); $leader = (string)($e->leader_name_safe ?? $e->leader_name ?? '-'); $status = (string)($e->status ?? 'upcoming'); $typeCls = $type==='plus' ? 'border-fuchsia-400/25 bg-fuchsia-500/10 text-fuchsia-100' : 'border-emerald-400/25 bg-emerald-500/10 text-emerald-100'; $stCls = $status==='active' ? 'border-emerald-400/25 bg-emerald-500/10 text-emerald-100' : ($status==='finished' ? 'border-slate-400/20 bg-slate-500/10 text-slate-100' : ($status==='cancelled' ? 'border-rose-400/25 bg-rose-500/10 text-rose-100' : 'border-amber-400/25 bg-amber-500/10 text-amber-100')); @endphp
{{ $title }}
{{ $leader }} • {{ $plat }}
{{ $type==='plus' ? 'PLUS' : 'REG' }} {{ strtoupper($status) }}
الوقت
{{ $time }}
المدة
{{ $dur }} د
التاريخ
{{ $date }}
@if(!empty($e->notes))
{{ $e->notes }}
@endif
@endforeach
@else
@foreach($todayList as $e) @php $type = (string)($e->event_type ?? 'regular'); $status = (string)($e->status ?? 'upcoming'); $typeCls = $type==='plus' ? 'border-fuchsia-400/25 bg-fuchsia-500/10 text-fuchsia-100' : 'border-emerald-400/25 bg-emerald-500/10 text-emerald-100'; $stCls = $status==='active' ? 'border-emerald-400/25 bg-emerald-500/10 text-emerald-100' : ($status==='finished' ? 'border-slate-400/20 bg-slate-500/10 text-slate-100' : ($status==='cancelled' ? 'border-rose-400/25 bg-rose-500/10 text-rose-100' : 'border-amber-400/25 bg-amber-500/10 text-amber-100')); @endphp @endforeach
الفعالية نوع الوقت المدة المنصة القائد الحالة
{{ $e->event_title ?? '—' }}
{{ $e->event_description ?? '' }}
{{ $type==='plus' ? 'PLUS' : 'REG' }} {{ $e->event_time ?? '—' }} {{ (int)($e->duration_minutes ?? 0) }} د {{ $e->platform ?? '—' }} {{ $e->leader_name_safe ?? $e->leader_name ?? '—' }} {{ strtoupper((string)$status) }}
@endif @else
لا توجد مواعيد لهذا اليوم
إذا عندك بيانات بالجدول، تأكد من event_date و event_time.
@endif
{{-- LIVE WATCH (AJAX: Late / Stuck / Upcoming) --}}
{{-- Late --}}
متأخرة (Live)
جارِ التحميل...
{{-- Stuck --}}
عالقة (Live)
جارِ التحميل...
{{-- Upcoming (Preview) --}}
قادم (Live)
جارِ التحميل...
{{-- ✅ JavaScript (AJAX Live) --}} @endsection