{{-- 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
{{-- HERO (مرتب + ملحمي) --}}
ProActive • غرفة التقارير

تقارير ProActive — لوحة التحليل

هنا تظهر التقارير بشكل احترافي: الحالة + كاتب التقرير + مؤشرات الأداء + رادار المستوى + ذكاء اصطناعي + (Plus أعضاء + توثيق).
الإجمالي: {{ (int)$stats['total'] }} معلّق: {{ (int)$stats['pending'] }} مقبول: {{ (int)$stats['approved'] }} مرفوض: {{ (int)$stats['rejected'] }} مشاكل: {{ (int)$stats['with_issues'] }} تطوّر: {{ (int)$stats['with_progress'] }} متوسط AI: {{ (int)$stats['avg_ai'] }}%
@if($from && $to)
المدى: {{ $from->toDateString() }}{{ $to->toDateString() }}
@endif
{{-- Range buttons --}} {{-- Filter bar --}}
{{-- LIST --}} @if($hasRows) {{-- PANELS --}} @if($view==='panels')
@foreach($rows as $x) @php $id = (int)getv($x,'id',0); $date = (string)getv($x,'activity_date','-'); $host = (string)getv($x,'live_host','-'); $owner= (string)getv($x,'live_owner_name','-'); $sum = (string)getv($x,'short_summary','—'); $link = (string)getv($x,'live_link',''); $ai = (int)getv($x,'__ai',0); $lvl = (array)getv($x,'__ai_level', ['label'=>'—','cls'=>'border-white/10 bg-white/5 text-white/70']); $st = (array)getv($x,'__status', ['label'=>'معلّق','icon'=>'fa-hourglass-half','cls'=>'border-white/10 bg-white/5 text-white/70']); $pl = (array)getv($x,'__platform', ['label'=>'تيكتوك','icon'=>'fa-brands fa-tiktok','cls'=>'border-white/10 bg-white/5 text-white/70']); $gr = (array)getv($x,'__grade', ['label'=>'جيد','cls'=>'border-white/10 bg-white/5 text-white/70']); $tp = (array)getv($x,'__type', ['label'=>'عادي','cls'=>'border-white/10 bg-white/5 text-white/70']); $creatorName = (string)getv($x,'created_by_name',''); $creatorUser = (string)getv($x,'created_by_username',''); $creatorAv = (string)getv($x,'created_by_avatar',''); $jsonUrl = safe_route('superadmin.proactive.reports.json', ['id'=>$id], true, '#'); // Alerts (Plus pack) $isPlus = ((string)getv($x,'activity_type','regular') === 'plus'); $pmCount = (int)getv($x,'plus_members_count', 0); $docImg = (string)getv($x,'doc_image_path',''); $docVid = (string)getv($x,'doc_video_path',''); $hasDoc = ($docImg !== '' || $docVid !== ''); // AI ring $pct = max(0, min(100, $ai)); $circ = 2 * 3.1415926535 * 22; // r=22 $dash = ($circ * $pct) / 100; $gap = $circ - $dash; @endphp
{{-- badges --}}
{{ $st['label'] ?? 'معلّق' }} {{ $pl['label'] ?? 'تيكتوك' }} {{ $tp['label'] ?? 'عادي' }} تقييم: {{ $gr['label'] ?? 'جيد' }} {{-- ✅ Alerts --}} @if($isPlus) @if($pmCount <= 0) بدون أعضاء @else أعضاء: {{ $pmCount }} @endif @if($hasDoc) توثيق @else بدون توثيق @endif @endif
{{-- title --}}
تقرير #{{ $id }} — {{ $date }}
المضيف: {{ $host }} المالك: {{ $owner }}
{{-- AI Ring --}}
{{ $pct }}%
AI
{{-- creator --}}
@if($creatorAv) @else @endif
{{ $creatorName ?: 'كاتب غير معروف' }}
{{ $creatorUser ? '@'.$creatorUser : '' }}
{{ $lvl['label'] ?? '—' }}
{{-- summary --}}
{{ $sum ?: '—' }}
{{-- actions --}}
@if($link) رابط @endif
@endforeach
{{-- TABLE --}} @else
جدول التقارير
زر “عرض” يفتح مودال ملحمي ويحمل التفاصيل من السيرفر.
@foreach($rows as $x) @php $id = (int)getv($x,'id',0); $date = (string)getv($x,'activity_date','-'); $host = (string)getv($x,'live_host','-'); $ai = (int)getv($x,'__ai',0); $lvl = (array)getv($x,'__ai_level', ['label'=>'—','cls'=>'border-white/10 bg-white/5 text-white/70']); $st = (array)getv($x,'__status', ['label'=>'معلّق','icon'=>'fa-hourglass-half','cls'=>'border-white/10 bg-white/5 text-white/70']); $creatorName = (string)getv($x,'created_by_name',''); $creatorUser = (string)getv($x,'created_by_username',''); $jsonUrl = safe_route('superadmin.proactive.reports.json', ['id'=>$id], true, '#'); $isPlus = ((string)getv($x,'activity_type','regular') === 'plus'); $pmCount = (int)getv($x,'plus_members_count', 0); $docImg = (string)getv($x,'doc_image_path',''); $docVid = (string)getv($x,'doc_video_path',''); $hasDoc = ($docImg !== '' || $docVid !== ''); @endphp {{-- ✅ Alerts --}} @endforeach
# التاريخ المضيف الحالة AI تنبيهات كاتب التقرير إجراء
{{ $id }} {{ $date }} {{ $host }} {{ $st['label'] ?? 'معلّق' }}
{{ $lvl['label'] ?? '—' }} {{ max(0,min(100,$ai)) }}%
@if($isPlus)
@if($pmCount <= 0) بدون أعضاء @else {{ $pmCount }} @endif @if($hasDoc) توثيق @else @endif
@else @endif
{{ $creatorName ?: 'غير معروف' }}
{{ $creatorUser ? '@'.$creatorUser : '' }}
@endif @else
لا توجد تقارير ضمن هذه الفلاتر
جرّب تغيّر المدى/التاريخ/البحث.
@endif
{{-- ========================= | MODAL — ملحمي للهاتف + تحميل آمن عبر fetch |========================= --}} @endsection