@extends('layouts.superadmin') @section('title', 'أهداف التيم الشهرية - ProMission') @section('page-title', 'أهداف التيم الشهرية - ProMission') @section('content') @php $isCards = (request('view','cards') === 'cards'); $pct = function($current, $target){ $c = (float)$current; $t = (float)$target; if ($t <= 0) return 0; return round(min(100, max(0, ($c / $t) * 100)), 1); }; $pill = function($hit){ if ($hit === true) return 'bg-emerald-500/15 text-emerald-200 border border-emerald-500/20'; if ($hit === false) return 'bg-rose-500/15 text-rose-200 border border-rose-500/20'; return 'bg-slate-500/15 text-slate-200 border border-slate-500/20'; }; @endphp
{{-- Header --}}

كنترول أهداف التيم

الهدف الكلي: {{ $goalsTeam['total_hours'] }} ساعة (لايف + قست + سهرة) • قستات: {{ $goalsTeam['guest_count'] }} • لايف: {{ $goalsTeam['live_hours'] }} ساعة • سهرة: {{ $goalsTeam['sahra_hours'] }} ساعة

{{-- Toggle --}}
{{-- Summary cards --}}
أعضاء التيم
{{ $team['members'] }}
الإجمالي الكلي
{{ $team['total_hours'] }} س
{{ $pct($team['total_hours'], $goalsTeam['total_hours']) }}% من الهدف
لايف (بدون سهرة)
{{ $team['live_hours'] }} س
{{ $pct($team['live_hours'], $goalsTeam['live_hours']) }}% من الهدف
قستات + سهرة
قست: {{ $team['guest_count'] }} • سهرات: {{ $team['sahra_hours'] }} س
قستات: {{ $pct($team['guest_count'], $goalsTeam['guest_count']) }}% • سهرات: {{ $pct($team['sahra_hours'], $goalsTeam['sahra_hours']) }}%
{{-- Compare box --}} @if($compare_enabled && $teamCmp)
مقارنة مع الفترة السابقة ({{ $compare_from }} → {{ $compare_to }})
Δ الإجمالي
{{ $teamCmp['delta_total'] }} س
{{ $teamCmp['pct_total'] }}%
Δ اللايف
{{ $teamCmp['delta_live'] }} س
{{ $teamCmp['pct_live'] }}%
Δ السهرة
{{ $teamCmp['delta_sahra'] }} س
{{ $teamCmp['pct_sahra'] }}%
Δ القستات
{{ $teamCmp['delta_guest_count'] }}
{{ $teamCmp['pct_guest_count'] }}%
@endif {{-- Filters --}}
إعادة ضبط أهداف لكل عضو: {{ $goalsMember['mix_hours'] }}س (لايف+قست) + {{ $goalsMember['sahra_hours'] }}س سهرة.
{{-- AI box --}}
{{ $ai['summary'] ?? 'تحليل ذكي' }}
    @foreach(($ai['tips'] ?? []) as $t)
  • • {{ $t }}
  • @endforeach
{{-- Members view --}} @if($isCards)
@foreach($rows as $r) @php $mixPct = $pct($r['mix_hours'], $goalsMember['mix_hours']); $sahraPct = $pct($r['sahra_hours'], $goalsMember['sahra_hours']); @endphp
{{ $r['name'] }}
{{ $r['username'] ?? '' }}
الإجمالي
{{ $r['total_hours'] }} س
لايف
{{ $r['live_non_sahra_hours'] }}س
قست
{{ $r['guest_hours'] }}س
{{ $r['guest_count'] }} قست
سهرة
{{ $r['sahra_hours'] }}س
هدف العضو (لايف+قست): {{ $mixPct }}%
هدف السهرة: {{ $sahraPct }}%
@if($compare_enabled)
مقارنة: Δ إجمالي {{ $r['delta_total'] ?? '—' }}س • {{ $r['pct_total'] ?? '—' }}%
@endif
@endforeach
@else

جدول أهداف الأعضاء

متابعة لكل عضو: لايف/قست/سهرة + مقارنة (إن وجدت).

عدد الأعضاء: {{ count($rows) }}
@if($compare_enabled) @endif @foreach($rows as $r) @if($compare_enabled) @endif @endforeach
العضو لايف (س) قست (س) قست (عدد) سهرة (س) مجموع (س)Δ %
{{ $r['name'] }}
{{ $r['username'] }}
{{ $r['live_non_sahra_hours'] }} {{ $r['guest_hours'] }} {{ $r['guest_count'] }} {{ $r['sahra_hours'] }} {{ $r['total_hours'] }}{{ $r['delta_total'] ?? '—' }} {{ $r['pct_total'] ?? '—' }}
@endif
هذا الكنترول يراقب أهداف التيم ويقارنها مع شهر سابق، ويعطي توصيات ذكية لتوزيع الجهد.
@endsection