{{-- resources/views/superadmin/iman-room/proactive.blade.php --}} @extends('layouts.superadmin') @section('title','ProActive — المواعيد والتقارير') @section('page-title','ProActive — المواعيد والتقارير') @section('content') @php use Illuminate\Support\Facades\Route; $section = $section ?? 'proactive'; // Tabs $tab = $tab ?? request('tab','reports'); // reports|schedules if (!in_array($tab, ['reports','schedules'], true)) $tab = 'reports'; // View $view = $view ?? request('view','table'); // table|cards if (!in_array($view, ['table','cards'], true)) $view = 'table'; // UI time $ui = $ui ?? [ 'tz_mode' => request('tz','local'), 'clock' => request('clock','24'), ]; $tzOptions = $tzOptions ?? [ 'local' => 'توقيت النظام', 'jordan' => 'توقيت الأردن', ]; $clockOptions = $clockOptions ?? [ '24' => '24 ساعة', '12' => '12 ساعة', ]; // Filters $q = $q ?? request('q',''); $type = $type ?? request('type',''); $plat = $plat ?? request('platform',''); $from = $from ?? request('from',''); $to = $to ?? request('to',''); $status = $status ?? request('status',''); $platforms = $platforms ?? [ '' => 'كل المنصّات', 'tiktok' => 'تيك توك', 'instagram' => 'إنستغرام', 'youtube' => 'يوتيوب', 'other' => 'أخرى', ]; // Controller: rows + stats $rows = $rows ?? collect(); $stats = $stats ?? []; // labels $typeLabel = [ 'regular' => 'عادية', 'plus' => 'Plus', ]; $statusLabelReports = [ 'pending' => 'بانتظار', 'approved' => 'مقبول', 'rejected' => 'مرفوض', ]; $statusLabelSchedules = [ 'upcoming' => 'قادم', 'active' => 'نشط', 'finished' => 'منتهي', 'cancelled' => 'ملغي', ]; $gradeLabel = [ 'good' => 'جيد', 'very_good' => 'جيد جدًا', 'excellent' => 'ممتاز', ]; // safe create urls (بدون Route errors) $createReportUrl = null; if (Route::has('superadmin.proactive.reports.create')) $createReportUrl = route('superadmin.proactive.reports.create'); elseif (Route::has('superadmin.proactive.report.create')) $createReportUrl = route('superadmin.proactive.report.create'); $createScheduleUrl = null; if (Route::has('superadmin.proactive.schedules.create')) $createScheduleUrl = route('superadmin.proactive.schedules.create'); elseif (Route::has('superadmin.proactive.schedule.create')) $createScheduleUrl = route('superadmin.proactive.schedule.create'); $qs = request()->query(); // header summary line $periodLine = ($from && $to) ? "{$from} → {$to}" : 'حسب الفلاتر الحالية'; @endphp
الفترة: {{ $periodLine }} • التوقيت: {{ $tzOptions[$ui['tz_mode']] ?? 'توقيت النظام' }} • نظام الساعة: {{ $clockOptions[$ui['clock']] ?? '24 ساعة' }}
| # | {{ $tab==='reports' ? 'التاريخ/الوقت' : 'التاريخ/الوقت' }} | {{ $tab==='reports' ? 'المضيف' : 'العنوان' }} | {{ $tab==='reports' ? 'صاحب اللايف' : 'القائد' }} | المنصة | النوع | الحالة | {{ $tab==='reports' ? 'التقدير' : '—' }} | مُسجّل | إجراء |
|---|---|---|---|---|---|---|---|---|---|
| {{ (method_exists($rows,'firstItem') ? ($rows->firstItem() ?? 1) : 1) + $i }} |
{{ $when }}
@if(!empty($r->created_at_display ?? null))
سجّل: {{ $r->created_at_display }}
@endif
|
{{ $main }}
@if($tab==='reports')
{{ $r->short_summary ?? '—' }}
@else
{{ $r->notes ?? '—' }}
@endif
|
{{ $sub }} | {{ $platformText }} | {{ $rowType }} | {{ $rowStatus }} | @if($tab==='reports') {{ $rowGrade }} @if((int)($r->had_issues ?? 0)===1) مشاكل @endif @if((int)($r->had_progress ?? 0)===1) تقدم @endif @else — @endif | {{ $creator }} |