{{-- resources/views/superadmin/proactive/command/compliance.blade.php --}} @extends('layouts.superadmin') @section('title', 'ProActive — التقارير') @section('page-title', 'تقارير ProActive') @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; } } } if (!function_exists('getv')) { function getv($src, string $key, $default = null) { if (is_array($src)) return array_key_exists($key, $src) ? $src[$key] : $default; if (is_object($src)) return isset($src->{$key}) ? $src->{$key} : $default; return $default; } } $chip = fn($cls) => "px-2.5 py-1 rounded-xl border text-[11px] font-extrabold $cls"; $pill = fn($cls) => "px-3 py-1.5 rounded-2xl border text-[12px] font-black $cls"; $qs = request()->query(); $rows = $rows ?? []; $stats = $stats ?? ['total'=>0,'pending'=>0,'approved'=>0,'rejected'=>0,'with_issues'=>0,'with_progress'=>0,'avg_ai'=>0]; $from = $from ?? null; $to = $to ?? null; $range = (string)($range ?? request('range','14d')); $view = (string)($view ?? request('view','panels')); $search = trim((string)($search ?? request('search',''))); if(!in_array($range,['today','week','month','14d'],true)) $range='14d'; if(!in_array($view,['table','panels'],true)) $view='panels'; $filters = $filters ?? []; $platform = (string)($filters['platform'] ?? request('platform','')); $status = (string)($filters['status'] ?? request('status','')); $type = (string)($filters['type'] ?? request('type','')); $grade = (string)($filters['grade'] ?? request('grade','')); $issues = (string)($filters['issues'] ?? request('issues','')); $progress = (string)($filters['progress'] ?? request('progress','')); $rCommand = safe_route('superadmin.proactive.command', [], true, url('/superadmin/proactive/command')); $rCompliance = safe_route('superadmin.proactive.compliance', [], true, url()->current()); $hasRows = is_array($rows) ? count($rows) > 0 : (method_exists($rows,'count') ? $rows->count() > 0 : false); $rangeUrl = function($key) use ($qs, $rCompliance) { return $rCompliance.'?'.http_build_query(array_merge($qs, ['range'=>$key, 'from'=>null, 'to'=>null])); }; @endphp
| # | التاريخ | المضيف | الحالة | AI | تنبيهات | كاتب التقرير | إجراء |
|---|---|---|---|---|---|---|---|
| {{ $id }} | {{ $date }} | {{ $host }} | {{ $st['label'] ?? 'معلّق' }} |
{{ $lvl['label'] ?? '—' }}
{{ max(0,min(100,$ai)) }}%
|
{{-- ✅ Alerts --}}
@if($isPlus)
@if($pmCount <= 0)
بدون أعضاء
@else
{{ $pmCount }}
@endif
@if($hasDoc)
توثيق
@else
—
@endif
@else
—
@endif
|
{{ $creatorName ?: 'غير معروف' }}
{{ $creatorUser ? '@'.$creatorUser : '' }}
|