@extends('layouts.superadmin') @section('title','ساعات الأعضاء — غرفة إيمان الملكاوي') @section('content') @php $viewMode = request('view','table'); // table|cards $cmpEnabled = (bool)($compare_enabled ?? false); $badge = function($hit){ if ($hit === null) return 'bg-white/5 border-white/10 text-white/70'; return $hit ? 'bg-emerald-500/15 border-emerald-400/20 text-emerald-200' : 'bg-rose-500/15 border-rose-400/20 text-rose-200'; }; $dirIcon = function($dir){ return $dir === 'asc' ? 'fa-solid fa-arrow-up-wide-short' : 'fa-solid fa-arrow-down-wide-short'; }; $fmt = function($n, $d=2){ if ($n === null) return '—'; return number_format((float)$n, $d); }; $pctClr = function($pct){ if ($pct === null) return 'text-white/60'; if ($pct >= 10) return 'text-emerald-200'; if ($pct >= 0) return 'text-cyan-200'; if ($pct <= -10) return 'text-rose-200'; return 'text-amber-200'; }; $deltaSign = function($v){ if ($v === null) return ''; return $v > 0 ? '+' : ''; }; @endphp
{{-- HERO --}}
ساعات الأعضاء — لايفات + قستات + (سهرة اختياري)

ساعات الأعضاء

تحليل الفترة + مقارنة + أهداف + نسب مشاركة + تصدير رسالة واتساب.
الفترة: {{ $from }} → {{ $to }} @if($cmpEnabled) مقارنة: {{ $compare_from }} → {{ $compare_to }} @endif
جدول كروت
{{-- FILTERS --}}
فلاتر وتحكّم
رتّب النتائج وغيّر العرض بدون ما تنضرب JS.
{{-- dates --}}
{{-- compare --}}
{{-- live filters --}}
{{-- toggles --}}
{{-- sort --}}
{{-- goals --}}
{{-- KPIs --}}
عدد الأعضاء
{{ $totals['members'] ?? 0 }}
ساعات اللايفات
{{ $fmt($totals['live_hours'] ?? 0) }}
ساعات القستات
{{ $fmt($totals['guest_hours'] ?? 0) }}
الإجمالي
{{ $fmt($totals['total_hours'] ?? 0) }}
سهرات (إن وُجدت)
{{ $fmt($totals['sahra_hours'] ?? 0) }}
{{-- TABLE / CARDS --}} @if($viewMode === 'cards')
@forelse(($rows ?? []) as $r) @php $name = $r['name'] ?? ('#'.$r['id']); $avatar = $r['avatar'] ?? null; @endphp
@if($avatar) avatar @else @endif
{{ $name }}
{{ $r['username'] ?? '' }}
الإجمالي
{{ $fmt($r['total_hours'] ?? 0) }}
لايف {{ $fmt($r['live_hours'] ?? 0) }}س • {{ (int)($r['live_count'] ?? 0) }}x
قست {{ $fmt($r['guest_hours'] ?? 0) }}س • {{ (int)($r['guest_count'] ?? 0) }}x
@if(!empty($show_sahra_col))
سهرة {{ $fmt($r['sahra_hours'] ?? 0) }}س
@endif
@if(!empty($show_share))
Share — لايف: {{ $fmt($r['share_live'] ?? 0, 1) }}% • قست: {{ $fmt($r['share_guest'] ?? 0, 1) }}% • إجمالي: {{ $fmt($r['share_total'] ?? 0, 1) }}%
@endif @if($cmpEnabled && !empty($show_growth))
Growth — إجمالي: {{ ($r['pct_total'] === null) ? '—' : ($deltaSign($r['pct_total']).$fmt($r['pct_total'],1).'%') }} Δ {{ $deltaSign($r['delta_total'] ?? 0) }}{{ $fmt($r['delta_total'] ?? 0) }}س
@endif
لايف: {{ $r['hit_live']===null ? '—' : ($r['hit_live'] ? 'حقق الهدف' : 'لم يحقق') }} قست: {{ $r['hit_guest']===null ? '—' : ($r['hit_guest'] ? 'حقق الهدف' : 'لم يحقق') }} إجمالي: {{ $r['hit_total']===null ? '—' : ($r['hit_total'] ? 'حقق الهدف' : 'لم يحقق') }}
@empty
لا يوجد بيانات للفترة الحالية.
@endforelse
@else
جدول الساعات
Sort: {{ $sort ?? 'total' }} • Dir:
@if(!empty($show_sahra_col)) @endif @if(!empty($show_share)) @endif @if($cmpEnabled && !empty($show_growth)) @endif @forelse(($rows ?? []) as $r) @php $name = $r['name'] ?? ('#'.$r['id']); $avatar = $r['avatar'] ?? null; @endphp @if(!empty($show_sahra_col)) @endif @if(!empty($show_share)) @endif @if($cmpEnabled && !empty($show_growth)) @endif @empty @endforelse
العضو لايف (س) عدد اللايفسهرة (س)قست (س) عدد القست الإجمالي (س)Share إجماليΔ إجمالي % نموأهداف
@if($avatar) avatar @else @endif
{{ $name }}
{{ $r['username'] ?? '' }}
{{ $fmt($r['live_hours'] ?? 0) }} {{ (int)($r['live_count'] ?? 0) }}{{ $fmt($r['sahra_hours'] ?? 0) }}{{ $fmt($r['guest_hours'] ?? 0) }} {{ (int)($r['guest_count'] ?? 0) }} {{ $fmt($r['total_hours'] ?? 0) }}{{ $fmt($r['share_total'] ?? 0, 1) }}% {{ ($r['delta_total']===null) ? '—' : ($deltaSign($r['delta_total']).$fmt($r['delta_total'])) }} {{ ($r['pct_total']===null) ? '—' : ($deltaSign($r['pct_total']).$fmt($r['pct_total'],1).'%') }}
لايف قست إجمالي
لا يوجد بيانات للفترة الحالية.
@endif {{-- TEAM GOALS (Optional) --}} @if(!empty($teamGoals))
أهداف التيم (اختياري)
هدف لايف: {{ $teamGoals['team_goal_live'] ?? 0 }} الحالة: {{ ($teamGoals['hit_live'] ?? null)===null ? '—' : (($teamGoals['hit_live'] ?? false) ? 'متحقق' : 'غير متحقق') }}
هدف قست: {{ $teamGoals['team_goal_guest'] ?? 0 }} الحالة: {{ ($teamGoals['hit_guest'] ?? null)===null ? '—' : (($teamGoals['hit_guest'] ?? false) ? 'متحقق' : 'غير متحقق') }}
هدف إجمالي: {{ $teamGoals['team_goal_total'] ?? 0 }} الحالة: {{ ($teamGoals['hit_total'] ?? null)===null ? '—' : (($teamGoals['hit_total'] ?? false) ? 'متحقق' : 'غير متحقق') }}
@endif {{-- WhatsApp Message (Hidden Source) --}}
@endsection