{{-- resources/views/superadmin/ramadan/app.blade.php --}} @extends('layouts.superadmin') @section('title', 'رمضان هلّ هلاله') @section('page-title', 'رمضان هلّ هلاله') @section('content') @php use Illuminate\Support\Facades\Route; // ✅ متوافق مع PHP 7.3 (بدون fn()) $safe = function ($name, $params = []) { return Route::has($name) ? route($name, $params) : '#'; }; $seasonTitle = $season->title ?? 'رمضان'; $seasonYear = $season->gregorian_year ?? ''; $page = $page ?? 'dashboard'; $tabs = [ ['key'=>'dashboard', 'label'=>'لوحة رمضان', 'icon'=>'fa-moon', 'route'=>'superadmin.ramadan.index', 'hint'=>'ملخص سريع + توجيه'], ['key'=>'competitions', 'label'=>'المسابقات', 'icon'=>'fa-trophy', 'route'=>'superadmin.ramadan.competitions.index', 'hint'=>'إنشاء + ربط مسابقات'], ['key'=>'competition_reports', 'label'=>'تقارير المسابقات', 'icon'=>'fa-clipboard-check', 'route'=>'superadmin.ramadan.competitions.reports.index', 'hint'=>'توثيق + ذكاء + تقييم'], ['key'=>'scoreboard', 'label'=>'لوحة النقاط', 'icon'=>'fa-ranking-star', 'route'=>'superadmin.ramadan.scoreboard.index', 'hint'=>'نقاط يومية + أبطال + تصدير'], ['key'=>'visitors', 'label'=>'الزوار', 'icon'=>'fa-user', 'route'=>'superadmin.ramadan.visitors.index', 'hint'=>'إدارة زوار مشاركين'], ['key'=>'gifts', 'label'=>'هدايا تيك توك', 'icon'=>'fa-gift', 'route'=>'superadmin.ramadan.gifts.index', 'hint'=>'كتالوج هدايا + صورة + نطاق نقاط'], ['key'=>'awards', 'label'=>'توزيع الجوائز', 'icon'=>'fa-award', 'route'=>'superadmin.ramadan.awards.index', 'hint'=>'هدية تيك توك/يدوي + توثيق'], ['key'=>'program', 'label'=>'أوراق البرنامج', 'icon'=>'fa-file-lines', 'route'=>'superadmin.ramadan.program.index', 'hint'=>'مهام/أوراق حسب الساعات'], ['key'=>'financial', 'label'=>'الميزانية/الهدايا', 'icon'=>'fa-coins', 'route'=>'superadmin.ramadan.competitions.financial', 'hint'=>'جوائز + ميزانية'], ['key'=>'records', 'label'=>'السجلات المالية', 'icon'=>'fa-book', 'route'=>'superadmin.ramadan.competitions.records', 'hint'=>'مصروف/ميزانية/راعٍ'], ['key'=>'media', 'label'=>'الصور/الفيديو', 'icon'=>'fa-photo-film', 'route'=>'superadmin.ramadan.competitions.media', 'hint'=>'رفع وإدارة الميديا'], ['key'=>'log', 'label'=>'سجل رمضان', 'icon'=>'fa-book-open', 'route'=>'superadmin.ramadan.log.index', 'hint'=>'يدوي + أوتوماتيك'], ['key'=>'participants', 'label'=>'المشاركون', 'icon'=>'fa-users', 'route'=>'superadmin.ramadan.participants.index', 'hint'=>'إضافة/تحديث المشاركين'], // باقي التابات (إذا عندك Routes لها رح تشتغل تلقائيًا، وإلا بيطلع #) ['key'=>'stats', 'label'=>'الإحصائيات', 'icon'=>'fa-chart-simple', 'route'=>'superadmin.ramadan.participants.stats', 'hint'=>'نقاط + دقائق'], ['key'=>'top_time', 'label'=>'Top 10 الأوقات', 'icon'=>'fa-stopwatch', 'route'=>'superadmin.ramadan.top.time', 'hint'=>'الأكثر تواجدًا'], ['key'=>'top_comp', 'label'=>'Top 10 المسابقات', 'icon'=>'fa-medal', 'route'=>'superadmin.ramadan.top.competitions', 'hint'=>'الأعلى حسب النقاط'], ['key'=>'baba', 'label'=>'بابا غنوج', 'icon'=>'fa-pepper-hot', 'route'=>'superadmin.ramadan.baba-ghanouj.index', 'hint'=>'منشورات وإعلانات لطيفة'], ['key'=>'schedule', 'label'=>'جدول الأوقات', 'icon'=>'fa-calendar-days', 'route'=>'superadmin.ramadan.schedule.index', 'hint'=>'Slots + Assign + Live'], ['key'=>'certificates', 'label'=>'الشهادات', 'icon'=>'fa-certificate', 'route'=>'superadmin.ramadan.certificates.index', 'hint'=>'إصدار شهادات'], ['key'=>'honors', 'label'=>'التكريمات', 'icon'=>'fa-crown', 'route'=>'superadmin.ramadan.honors.index', 'hint'=>'إضافة + ربط تكريمات'], ['key'=>'alerts', 'label'=>'التنبيهات', 'icon'=>'fa-bell', 'route'=>'superadmin.ramadan.alerts.index', 'hint'=>'Hub + Manual'], ['key'=>'missions', 'label'=>'مهام الإدارة', 'icon'=>'fa-list-check', 'route'=>'superadmin.ramadan.missions.index', 'hint'=>'تكليف + اعتماد'], ['key'=>'archive', 'label'=>'الأرشيف', 'icon'=>'fa-box-archive', 'route'=>'superadmin.ramadan.archive.index', 'hint'=>'ملفات/روابط/نصوص'], ]; $primaryKeys = ['dashboard','competitions','scoreboard','schedule','awards']; $tabByKey = []; foreach($tabs as $t){ $tabByKey[$t['key']] = $t; } $currentTab = $tabByKey[$page] ?? ['label'=>$page, 'icon'=>'fa-sparkles', 'hint'=>'']; $primaryTabs = array_values(array_filter($tabs, function ($t) use ($primaryKeys) { return in_array($t['key'], $primaryKeys, true); })); $moreTabs = array_values(array_filter($tabs, function ($t) use ($primaryKeys) { return !in_array($t['key'], $primaryKeys, true); })); $card = "r-card"; // ✅ Defaults آمنة $stats = $stats ?? []; $competitions = $competitions ?? collect(); $allCompetitions= $allCompetitions?? collect(); $competitionId = (int)($competitionId ?? request()->get('competition_id', 0)); $prizes = $prizes ?? collect(); $records = $records ?? collect(); $items = $items ?? collect(); $entries = $entries ?? collect(); $alerts = $alerts ?? collect(); $missions = $missions ?? collect(); // مهم: ممكن تكون array keyed حسب الصفحة (schedule/missions) $assignments = $assignments ?? []; $participants = $participants ?? collect(); $users = $users ?? collect(); $totals = $totals ?? collect(); $rows = $rows ?? collect(); $posts = $posts ?? collect(); // Honors defaults $all = $all ?? collect(); $links = $links ?? collect(); // NEW sections defaults $visitors = $visitors ?? collect(); $fromDate = $fromDate ?? request()->get('from_date', now()->subDays(6)->toDateString()); $toDate = $toDate ?? request()->get('to_date', now()->toDateString()); $scoreDates = $scoreDates ?? []; $scoreMatrix = $scoreMatrix ?? collect(); $champions = $champions ?? []; $topRamadan = $topRamadan ?? collect(); $scoreEvents = $scoreEvents ?? collect(); $gifts = $gifts ?? collect(); $awards = $awards ?? collect(); $awardMedia = $awardMedia ?? []; $suggest = $suggest ?? null; $suggestGifts = $suggestGifts ?? collect(); $slotPapers = $slotPapers ?? []; $slots = $slots ?? collect(); $activityTypes = $activityTypes ?? collect(); @endphp
{{-- ===== HERO ===== --}}
{{ $seasonTitle }} {{ $seasonYear }} لوحة إدارة رمضان (سوبرأدمن)
رمضان كريم ✨
لوحة رسمية: مسابقات + نقاط + زوار + جوائز + توثيق + برنامج.
@if($errors->any())
يوجد أخطاء:
    @foreach($errors->all() as $err)
  • {{ $err }}
  • @endforeach
@endif @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- ===== NAV ===== --}}
@foreach($primaryTabs as $t) @php $is = ($page === $t['key']); @endphp {{ $t['label'] }} @endforeach
{{-- ===== PAGE CONTENT ===== --}}
{{ $currentTab['label'] }}
{{ $currentTab['hint'] ?? '' }}
@switch($page) {{-- ========== DASHBOARD ========== --}} @case('dashboard')
تهنئة رمضان
كل شيء من مكان واحد — تصميم رسمي ومرتب، وكل عملية عليها توثيق تلقائي في سجل رمضان.
@php $s = $stats ?? []; @endphp @foreach([ ['k'=>'participants','t'=>'المشاركون','i'=>'fa-users'], ['k'=>'competitions','t'=>'المسابقات','i'=>'fa-trophy'], ['k'=>'schedule_slots','t'=>'الساعات','i'=>'fa-calendar-days'], ['k'=>'alerts','t'=>'التنبيهات','i'=>'fa-bell'], ['k'=>'missions','t'=>'مهام الإدارة','i'=>'fa-list-check'], ] as $it)
{{ (int)($s[$it['k']] ?? 0) }}
{{ $it['t'] }}
من لوحة رمضان
@endforeach
@break {{-- ========== COMPETITIONS ========== --}} @case('competitions')
إنشاء مسابقة جديدة
@csrf
ربط مسابقة موجودة
@csrf
المسابقات المرتبطة
@forelse(($competitions ?? []) as $c)
{{ $c->title ?? 'بدون عنوان' }}
ID: {{ $c->id }} • الحالة: {{ $c->status ?? '-' }}
مالية
@csrf @method('DELETE')
@empty
لا يوجد مسابقات مرتبطة بعد.
@endforelse
@break {{-- ========== FINANCIAL + RECORDS ========== --}} @case('financial') @case('records')
اختيار المسابقة
اختر مسابقة ثم أضف جوائز أو سجلات مالية
الجوائز
@if(($competitionId ?? 0) > 0)
@csrf
@else
اختر مسابقة أولاً.
@endif
@forelse(($prizes ?? []) as $p)
{{ $p->title }} ×{{ (int)$p->qty }}
@if(!is_null($p->unit_cost)) {{ $p->unit_cost }} {{ $p->currency }} @else — @endif
@csrf @method('DELETE')
@empty
لا يوجد جوائز.
@endforelse
السجلات المالية
@if(($competitionId ?? 0) > 0)
@csrf
@else
اختر مسابقة أولاً.
@endif
@forelse(($records ?? []) as $r)
{{ $r->title }} ({{ $r->kind }})
{{ $r->amount }} {{ $r->currency }}
@csrf @method('DELETE')
@empty
لا يوجد سجلات.
@endforelse
@break {{-- ========== MEDIA ========== --}} @case('media')
فلترة حسب المسابقة
اختر مسابقة لرفع الميديا أو اعرض الجميع
رفع ميديا
@if(($competitionId ?? 0) > 0)
@csrf
@else
اختر مسابقة أولاً لرفع الميديا.
@endif
@forelse(($items ?? []) as $it) @php $path = (string)($it->path ?? ''); $isUrl = preg_match('~^https?://~i', $path) === 1; $canPreviewImage = ($it->media_type === 'image') && !$isUrl && $path !== ''; $previewUrl = $canPreviewImage ? asset('storage/'.$path) : ($isUrl ? $path : null); @endphp
{{ $it->media_type }}
#{{ $it->id }}
@if($previewUrl && $it->media_type === 'image') media @else
{{ $path }}
@endif @if($it->caption)
{{ $it->caption }}
@endif
@csrf @method('DELETE')
@empty
لا يوجد ميديا.
@endforelse
@break {{-- ========== LOG ========== --}} @case('log')
إضافة سجل
@csrf
السجلات
@forelse(($entries ?? []) as $e)
{{ $e->title }}
{{ $e->log_date }} @if($e->is_pinned) • مثبت@endif @if(!empty($e->tags)) • {{ $e->tags }} @endif
@csrf @method('DELETE')
@if($e->body)
{{ $e->body }}
@endif
@empty
لا يوجد سجلات.
@endforelse
@break {{-- ========== PARTICIPANTS ========== --}} @case('participants')
إضافة/تحديث مشارك
@csrf
قائمة المشاركين
@forelse(($participants ?? []) as $p)
{{ $p->name ?? $p->email ?? '—' }}
الحالة: {{ $p->status ?? '-' }}
@csrf @method('DELETE')
@empty
لا يوجد مشاركين.
@endforelse
@break {{-- ========== STATS ========== --}} @case('stats')
إحصائيات المشاركين
نقاط + دقائق (حسب التجميع في النظام)
@forelse(($totals ?? []) as $t)
{{ $t->name ?? '—' }}
{{ $t->membership_status ?? '' }}
نقاط: {{ (int)($t->total_points ?? 0) }} دقائق: {{ (int)($t->total_minutes ?? 0) }}
@empty
لا يوجد بيانات.
@endforelse
@break {{-- ========== TOP TIME ========== --}} @case('top_time')
Top 10 حسب الأوقات
الترتيب حسب مجموع الدقائق
@forelse(($rows ?? []) as $idx => $r)
#{{ $idx+1 }}
{{ $r->name ?? '—' }}
المجموع: {{ (int)($r->grand_minutes ?? 0) }} دقيقة
سجل: {{ (int)($r->total_minutes ?? 0) }}
مجدول: {{ (int)($r->scheduled_minutes ?? 0) }}
@empty
لا يوجد بيانات.
@endforelse
@break {{-- ========== TOP COMP ========== --}} @case('top_comp')
Top 10 حسب المسابقات
الترتيب حسب نقاط المشاركات
@forelse(($rows ?? []) as $idx => $r)
#{{ $idx+1 }}
{{ $r->name ?? '—' }}
مشاركات: {{ (int)($r->competitions_count ?? 0) }}
نقاط: {{ (int)($r->points_awarded ?? 0) }}
@empty
لا يوجد بيانات.
@endforelse
@break {{-- ========== BABA ========== --}} @case('baba')
منشور جديد
@csrf
المنشورات
@forelse(($posts ?? []) as $p)
{{ $p->title }}
النوع: {{ $p->mood }} @if($p->is_pinned) • مثبت@endif
@csrf @method('DELETE')
{{ $p->body }}
@empty
لا يوجد منشورات.
@endforelse
@break {{-- ========== SCHEDULE ========== --}} @case('schedule')
ساعات رمضان
إنشاء Slot ثم تعيين عضو — النظام ينشئ Live تلقائيًا
إضافة ساعة
@csrf
الجدول
@forelse(($slots ?? []) as $s)
{{ $s->slot_label }}
{{ $s->scheduled_date }} {{ $s->scheduled_time }} • {{ (int)$s->duration_hours }}س {{ (int)$s->duration_minutes }}د • {{ $s->status }} @if($s->live_activity_id) • Live: {{ $s->live_activity_id }}@endif
@if($s->is_sahra)
سهرة: {{ $s->sahra_topics ?? '-' }}
@endif
@csrf
@php $as = is_array($assignments) ? ($assignments[$s->id] ?? collect()) : (isset($assignments[$s->id]) ? $assignments[$s->id] : collect()); @endphp @if($as && $as->count())
@foreach($as as $a)
{{ $a->name }}
@csrf @method('DELETE')
@endforeach
@endif
@empty
لا يوجد Slots.
@endforelse
@break {{-- ========== CERTIFICATES ========== --}} @case('certificates')
إصدار شهادة
@csrf
الشهادات
@forelse(($items ?? []) as $it)
{{ $it->name ?? '—' }}
{{ $it->title ?? '' }}
@csrf @method('DELETE')
@empty
لا يوجد شهادات.
@endforelse
@break {{-- ========== HONORS ========== --}} @case('honors') @php $canCreateHonor = Route::has('superadmin.ramadan.honors.create'); @endphp
التكريمات (رسمي)
هنا يتم التعامل مع جدول honors_rewards ثم الربط داخل رمضان عبر ramadan_honor_links.
⚡ اختر المستلمين بالأسماء (بحث) — بدون حفظ أرقام.
{{-- Create new honor --}}
إضافة تكريم/مكافأة
@if(!$canCreateHonor)
ملاحظة تقنية: لازم تضيف Route باسم superadmin.ramadan.honors.create عشان زر الإضافة يشتغل.
@endif
@csrf
النوع
الحالة
عنوان التكريم
السبب (رسمي وواضح)
ملاحظات إضافية (اختياري)
عدد النقاط (اختياري)
الرتبة (اختياري)
تاريخ التنفيذ (اختياري)
{{-- Recipients selector (by name) --}}
المستلمون (اختيار بالأسماء)
@forelse(($users ?? []) as $u) @php $name = $u->name ?? ''; $un = $u->username ?? ''; $label = trim($name !== '' ? $name : ($un !== '' ? '@'.$un : ($u->email ?? ('User#'.$u->id)))); @endphp @empty
لا توجد قائمة مستخدمين في هذه الصفحة.
✅ (حل سريع) مرّر $users من الكنترولر حتى يصير الاختيار بالأسماء.
@endforelse
{{-- hidden CSV for backend --}}
سيتم حفظ المستلمين تلقائيًا — بدون إدخال أرقام يدويًا.
ملاحظة الربط داخل رمضان (اختياري)
{{-- Link existing + list --}}
ربط تكريم موجود
@csrf
المربوط برمضان
@forelse(($links ?? []) as $l)
{{ $l->honor_title ?? '-' }}
ID: {{ $l->honor_reward_id ?? '-' }} • النوع: {{ $l->type ?? '-' }} @if(!empty($l->points_amount)) • نقاط: {{ (int)$l->points_amount }} @endif @if(!empty($l->rank_id)) • رتبة: {{ (int)$l->rank_id }} @endif
@csrf @method('DELETE')
@empty
لا يوجد روابط.
@endforelse
@break {{-- ========== ALERTS ========== --}} @case('alerts')
إنشاء تنبيه
@csrf
التنبيهات
@forelse(($alerts ?? []) as $a)
{{ $a->title }}
الفئة: {{ $a->audience }} • الحالة: {{ $a->status }}
@csrf
@csrf @method('DELETE')
{{ $a->body }}
@empty
لا يوجد تنبيهات.
@endforelse
@break {{-- ========== MISSIONS ========== --}} @case('missions')
إنشاء مهمة
@csrf
المهام
@forelse(($missions ?? []) as $m)
{{ $m->title }}
نقاط: {{ $m->points_reward }} • دقائق: {{ $m->minutes_reward }}
@csrf
@empty
لا يوجد مهام.
@endforelse
تعيينات المهام
@forelse((is_array($assignments) ? ($assignments['missions'] ?? $assignments) : $assignments) as $a)
{{ $a->name }}
{{ $a->mission_title }} • {{ $a->status }}
@if($a->status !== 'done')
@csrf
@endif
@empty
لا يوجد تعيينات.
@endforelse
@break {{-- ========== ARCHIVE ========== --}} @case('archive')
إضافة للأرشيف
@csrf
عناصر الأرشيف
@forelse(($items ?? []) as $it)
{{ $it->title }}
{{ $it->category }} • {{ $it->item_type }}
@if($it->path)
path: {{ $it->path }}
@endif @if($it->url)
url: {{ $it->url }}
@endif
@csrf @method('DELETE')
@empty
لا يوجد أرشيف.
@endforelse
@break {{-- ✅ VISITORS --}} @case('visitors')
إضافة زائر
@csrf
قائمة الزوار
@forelse($visitors as $v)
{{ $v->name }}
@if(!empty($v->phone)) هاتف: {{ $v->phone }} • @endif @if(!empty($v->country)) بلد: {{ $v->country }} @endif
@if(!empty($v->notes))
{{ $v->notes }}
@endif
@csrf @method('DELETE')
@empty
لا يوجد زوار بعد.
@endforelse
@break {{-- ✅ SCOREBOARD --}} @case('scoreboard')
لوحة النقاط
نقاط يومية لمسابقات رمضان (User أو Visitor) + أبطال + تصدير CSV
تصدير CSV
{{-- Champions --}}
@php $todayChamp = $champions['today'] ?? null; $weekChamp = $champions['week'] ?? null; $ramChamp = $champions['ramadan'] ?? null; $meta = $champions['meta'] ?? []; @endphp
بطل اليوم
{{ $meta['today'] ?? '' }}
@if($todayChamp)
{{ $todayChamp['name'] }}
نقاط: {{ (int)$todayChamp['points'] }}
@else
لا يوجد نقاط اليوم.
@endif
بطل الأسبوع
{{ $meta['week_from'] ?? '' }} → {{ $meta['week_to'] ?? '' }}
@if($weekChamp)
{{ $weekChamp['name'] }}
نقاط: {{ (int)$weekChamp['points'] }}
@else
لا يوجد نقاط بالأسبوع.
@endif
بطل رمضان
{{ $meta['season_from'] ?? '' }} → {{ $meta['season_to'] ?? '' }}
@if($ramChamp)
{{ $ramChamp['name'] }}
نقاط: {{ (int)$ramChamp['points'] }}
@else
لا يوجد نقاط كافية.
@endif
{{-- Add score --}}
إضافة نقاط يومية
@csrf
Top 10 رمضان
@forelse($topRamadan as $t)
{{ $t->name }}
{{ (int)$t->points }} نقطة
@empty
لا يوجد.
@endforelse
{{-- Matrix --}}
جدول النقاط
من {{ $fromDate }} إلى {{ $toDate }}
@foreach($scoreDates as $d) @endforeach @forelse($scoreMatrix as $row) @foreach($scoreDates as $d) @endforeach @empty @endforelse
المشارك{{ $d }}المجموع
{{ $row['name'] }}
{{ $row['participant_type'] }}
{{ (int)($row['by_date'][$d] ?? 0) }}{{ (int)($row['total'] ?? 0) }}
لا يوجد بيانات للفترة.
آخر 60 عملية نقاط
@forelse($scoreEvents as $e)
{{ $e->participant_name ?? '-' }}
{{ $e->event_date }} • نقاط: {{ (int)$e->points }} • دقائق: {{ (int)$e->minutes }}
@if(!empty($e->note))
{{ $e->note }}
@endif
@csrf @method('DELETE')
@empty
لا يوجد سجلات.
@endforelse
@break {{-- ✅ GIFTS --}} @case('gifts')
إضافة هدية تيك توك
@csrf
قائمة الهدايا
@forelse($gifts as $g) @php $img = (string)($g->image_path ?? ''); $imgUrl = $img !== '' ? asset('storage/'.$img) : null; @endphp
{{ $g->name }} ({{ (int)$g->tiktok_coins }} coins)
@if(!is_null($g->min_points) || !is_null($g->max_points)) نقاط مناسبة: {{ $g->min_points ?? 0 }} → {{ $g->max_points ?? '∞' }} @else نقاط مناسبة: — @endif • @if((int)$g->is_active === 1) Active @else Off @endif
@if($imgUrl) gift @endif
@csrf @method('DELETE')
@empty
لا يوجد هدايا.
@endforelse
@break {{-- ✅ AWARDS --}} @case('awards')
توزيع الجوائز + توثيق
هدية تيك توك أو يدوي + صور/روابط توثيق
@if($suggest)
{{ $suggest['level']['emoji'] ?? '🌙' }} {{ $suggest['name'] }} — نقاط: {{ (int)$suggest['points'] }} — المستوى: {{ $suggest['level']['name'] ?? '' }}
هدايا مناسبة حسب min/max_points:
@forelse($suggestGifts as $sg)
{{ $sg->name }}
{{ (int)$sg->tiktok_coins }} coins
@empty
لا يوجد هدايا مناسبة.
@endforelse
@endif
{{-- Create award --}}
إضافة جائزة
@csrf
صور توثيق (اختياري)
ارفع صور توثيق (jpg/png/webp).
{{-- List awards --}}
آخر الجوائز
@forelse($awards as $a) @php $mediaList = is_array($awardMedia) ? ($awardMedia[$a->id] ?? collect()) : (isset($awardMedia[$a->id]) ? $awardMedia[$a->id] : collect()); @endphp
{{ $a->participant_name ?? '-' }}
#{{ $a->id }} • {{ $a->gift_type }} @if($a->gift_type === 'tiktok') • {{ $a->gift_name ?? '-' }} ({{ (int)($a->tiktok_coins ?? 0) }} coins) @else • {{ $a->title ?? '-' }} @endif • qty: {{ (int)$a->quantity }} • status: {{ $a->status }}
@if(!empty($a->competition_title))
مسابقة: {{ $a->competition_title }}
@endif @if(!empty($a->notes))
{{ $a->notes }}
@endif
@csrf @method('DELETE')
{{-- Media thumbnails --}} @if($mediaList && $mediaList->count())
@foreach($mediaList as $m) @php $p = (string)($m->path ?? ''); $isUrl = preg_match('~^https?://~i', $p) === 1; $url = $isUrl ? $p : asset('storage/'.$p); @endphp
@if(($m->media_type ?? 'image') === 'image') proof @else {{ $url }} @endif
@csrf @method('DELETE')
@endforeach
@endif {{-- Add media --}}
@csrf
@empty
لا يوجد جوائز.
@endforelse
@break {{-- ✅ PROGRAM --}} @case('program')
إضافة ورقة/مهمة
@csrf
الأوراق حسب الـ Slot
@forelse($slots as $s) @php $papers = is_array($slotPapers) ? ($slotPapers[$s->id] ?? collect()) : (isset($slotPapers[$s->id]) ? $slotPapers[$s->id] : collect()); @endphp
{{ $s->scheduled_date }} {{ $s->scheduled_time }} — {{ $s->slot_label }}
Slot ID: {{ $s->id }}
@if($papers && $papers->count())
@foreach($papers as $p)
{{ $p->title }}
status: {{ $p->status }} @if(!empty($p->competition_title)) • comp: {{ $p->competition_title }} @endif
@if(!empty($p->body))
{{ $p->body }}
@endif @if(!empty($p->file_path)) ملف @endif
@csrf @method('DELETE')
@endforeach
@else
لا يوجد أوراق لهذا السلوّت.
@endif
@empty
لا يوجد Slots.
@endforelse
@break @case('system_balance') @include('superadmin.ramadan.pages.system_balance') @break @case('system_member_radar') @include('superadmin.ramadan.pages.system_member_radar') @break @case('system_compass') @include('superadmin.ramadan.pages.system_compass') @break @case('competition_reports')
تقارير المسابقة
توثيق + ذكاء تلقائي + فريق + مشاكل/تقدّم + ترحيب
النظام يفرض: نظام التقدير مفعّل ✅ (لا يمكن تغييره)
{{-- Create Report --}}
إضافة تقرير
@csrf {{-- time: slot OR manual --}}
التاريخ/الوقت
إذا اخترت Slot سيتم اعتماد وقته تلقائيًا. إذا تركته فارغًا أدخل وقت يدوي.
{{-- Proof drop --}}
توثيق (اختياري)
اسحب الملف هنا أو اضغط للاختيار
يقبل صورة/فيديو حسب النوع. (اختياري)
{{-- Team participants --}}
مين كان مشارك من التيم؟ (اختياري)
@foreach(($users ?? []) as $u) @php $name = $u->name ?? ''; $un = $u->username ?? ''; $label = trim($name !== '' ? $name : ($un !== '' ? '@'.$un : ($u->email ?? ('User#'.$u->id)))); @endphp @endforeach
{{-- Issues / Progress --}}
{{-- Welcome --}}
{{-- Two extra important items --}}
الخطوات القادمة (مهم)
{{-- Intelligence radar (AJAX) --}}
مؤشر ذكاء التقرير
0
المستوى:
اكتب تفاصيل أكثر وسيظهر التحليل.
{{-- Locked: manager uses appreciation --}}
{{-- Reports list --}}
سجل التقارير
أحدث 250 تقرير
@forelse(($reports ?? []) as $r) @php $score = (int)($r->intelligence_score ?? 0); $lvl = (string)($r->intelligence_level ?? 'low'); $badge = 'bg-white/5'; $badgeTxt = 'text-white/85'; if($lvl==='elite'){ $badge='bg-amber-500/15 border-amber-400/25'; $badgeTxt='text-amber-200'; } elseif($lvl==='high'){ $badge='bg-emerald-500/15 border-emerald-400/25'; $badgeTxt='text-emerald-200'; } elseif($lvl==='medium'){ $badge='bg-indigo-500/15 border-indigo-400/25'; $badgeTxt='text-indigo-200'; } @endphp
{{ $r->title ?? '-' }}
#{{ $r->id }} • {{ $r->report_at ?? '' }} @if(!empty($r->competition_title)) • {{ $r->competition_title }} @endif
ذكاء: {{ $score }}/100 @if((int)($r->has_issues ?? 0)===1) مشاكل ✅ @endif @if((int)($r->has_progress ?? 0)===1) تقدّم ✅ @endif @if((int)($r->welcomed ?? 0)===1) ترحيب ✅ @endif
@csrf @method('DELETE')
@empty
لا يوجد تقارير بعد.
@endforelse
{{-- Report Modal / Panel --}} @break @default
هذه الصفحة غير معرفة في الواجهة: {{ $page }}
@endswitch
{{-- MORE MENU --}} {{-- HELP MODAL --}}
@endsection