@extends($layout) @section('title', 'الإحصائيات الرئيسية') @section('content')
{{-- Header --}}

الإحصائيات الرئيسية

نظرة شاملة على جميع أنواع النقاط والأنشطة

{{-- Date Filter --}}
{{-- Stats Cards --}} @php // ✅ حساب الساعات الصحيحة من الكنترولر (تم تمريرها بالفعل في $stats['total_hours']) // الكنترولر يرسل القيمة الصحيحة، لكن للتوضيح في الواجهة: $displayTotalHours = $stats['total_hours'] ?? 0; @endphp
@include('general.score-records.partials._stats-card', [ 'title' => 'إجمالي السجلات', 'value' => number_format($stats['total_records']), 'icon' => '', 'iconBg' => 'bg-blue-50' ]) @include('general.score-records.partials._stats-card', [ 'title' => 'إجمالي النقاط', 'value' => number_format($stats['total_points']), 'valueColor' => $stats['total_points'] >= 0 ? 'text-green-600' : 'text-red-600', 'icon' => '', 'iconBg' => 'bg-purple-50' ]) @include('general.score-records.partials._stats-card', [ 'title' => 'متوسط النقاط', 'value' => number_format($stats['average_points'], 2), 'valueColor' => 'text-orange-600', 'subtitle' => 'لكل سجل', 'icon' => '', 'iconBg' => 'bg-orange-50' ]) @include('general.score-records.partials._stats-card', [ 'title' => 'إجمالي الساعات', 'value' => number_format($displayTotalHours, 1) . ' ساعة', 'subtitle' => 'فقط الحضور الفعلي', 'valueColor' => 'text-indigo-600', 'icon' => '', 'iconBg' => 'bg-indigo-50' ])
{{-- Points Breakdown --}}

النقاط الموجبة

+{{ number_format($stats['total_points_added']) }}

النقاط المخصومة

-{{ number_format($stats['total_points_deducted']) }}

{{-- ملاحظة توضيحية حول الساعات --}}

ملاحظة هامة حول احتساب الساعات:

  • يتم احتساب الساعات فقط للحضور الفعلي في الأنشطة المباشرة والقيستات
  • لا يتم احتساب ساعات للغياب بعذر أو بدون عذر
  • الساعات تُحسب فقط عندما تكون الحالة: "محضر" (confirmed)
{{-- Breakdown by Type --}}

التفصيل حسب نوع النشاط

@if($stats['by_type']->isEmpty())

لا توجد بيانات للفترة المحددة

@else
@foreach($stats['by_type'] as $type)

@if($type->source_type == 'evaluation') تقييم يومي @elseif($type->source_type == 'live_activity') نشاط مباشر @elseif($type->source_type == 'guest') قيست @elseif($type->source_type == 'violation') مخالفة @elseif($type->source_type == 'warning') إنذار @elseif($type->source_type == 'honor_reward') تكريم/مكافأة @elseif($type->source_type == 'competition') مسابقة @else {{ $type->source_type }} @endif

العدد: {{ number_format($type->count) }}
النقاط: {{ $type->points >= 0 ? '+' : '' }}{{ number_format($type->points) }}
@endforeach
@endif
{{-- Quick Links --}}

التقييمات

{{ number_format($stats['total_evaluations']) }}

الأنشطة المباشرة

القيستات

المخالفات

@push('scripts') @endpush @endsection