@extends($layout) @section('title', 'التقرير الشامل') @section('content')
{{-- Header with Print Button --}}

التقرير الشامل

الفترة من {{ \Carbon\Carbon::parse($startDate)->format('d/m/Y') }} إلى {{ \Carbon\Carbon::parse($endDate)->format('d/m/Y') }}

{{-- Print Button --}} {{-- Back Button --}} العودة
{{-- Date Filter Form --}}
{{-- Overall Statistics Cards --}}
{{-- Total Records --}}

إجمالي السجلات

{{ number_format($data['overall']['total_records']) }}

{{-- Total Points --}}

إجمالي النقاط

{{ number_format($data['overall']['total_points']) }}

{{-- Positive Points --}}

النقاط الإيجابية

{{ number_format($data['overall']['positive_points']) }}

{{-- Negative Points --}}

النقاط السلبية

{{ number_format($data['overall']['negative_points']) }}

{{-- Top 10 Members Section --}}

أفضل 10 أعضاء

@if($data['top_members']->isEmpty())

لا توجد بيانات

@else
@foreach($data['top_members'] as $index => $member)
{{-- Rank --}}
@if($index < 3)
#{{ $index + 1 }}
@else
#{{ $index + 1 }}
@endif
{{-- Name --}}

{{ $member->user->name }}

{{ $member->user->membership_status === 'official' ? 'عضو رسمي' : 'عضو بيتا' }}

{{-- Points --}}

{{ number_format($member->total_points) }}

نقطة

@endforeach
@endif
{{-- Statistics by Type --}}

الإحصائيات حسب النوع

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

لا توجد بيانات

@else
@foreach($data['by_type'] as $type) @php $typeInfo = [ 'evaluation' => ['name' => 'التقييمات', 'color' => 'blue', 'icon' => 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2'], 'live_activity' => ['name' => 'الأنشطة المباشرة', 'color' => 'green', 'icon' => 'M13 10V3L4 14h7v7l9-11h-7z'], 'guest' => ['name' => 'القيستات', 'color' => 'purple', 'icon' => 'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857'], 'violation' => ['name' => 'المخالفات', 'color' => 'red', 'icon' => 'M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'], 'warning' => ['name' => 'الإنذارات', 'color' => 'orange', 'icon' => 'M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'], 'honor_reward' => ['name' => 'التكريمات والمكافآت', 'color' => 'yellow', 'icon' => 'M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z'], 'competition' => ['name' => 'المسابقات', 'color' => 'indigo', 'icon' => 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'] ]; $info = $typeInfo[$type->source_type] ?? ['name' => $type->source_type, 'color' => 'gray', 'icon' => 'M12 8v4m0 4h.01']; @endphp

{{ $info['name'] }}

العدد

{{ number_format($type->count) }}

النقاط

{{ number_format($type->points) }}

@endforeach
@endif
{{-- Gender Comparison --}} @if(isset($data['gender_comparison']) && ($data['gender_comparison']['male']->count > 0 || $data['gender_comparison']['female']->count > 0))

مقارنة الذكور والإناث

{{-- Males --}}

الذكور

عدد الأنشطة {{ number_format($data['gender_comparison']['male']->count ?? 0) }}
مجموع النقاط {{ number_format($data['gender_comparison']['male']->points ?? 0) }}
{{-- Females --}}

الإناث

عدد الأنشطة {{ number_format($data['gender_comparison']['female']->count ?? 0) }}
مجموع النقاط {{ number_format($data['gender_comparison']['female']->points ?? 0) }}
@endif
{{-- Print Styles --}} @endsection