تقرير المخالفات والإنذارات

نظام إدارة الفريق - {{ config('app.name', 'Hope Team System') }}

تاريخ الطباعة: {{ $printDate }}

@if(request()->hasAny(['type', 'status', 'user_id', 'period', 'date_from', 'date_to', 'search', 'is_automatic']))

الفلاتر المطبقة على هذا التقرير:

@if(request()->filled('type')) النوع: {{ request('type') == 'warning' ? 'إنذارات' : 'مخالفات' }} @endif @if(request()->filled('status')) الحالة: {{ request('status') == 'active' ? 'نشط' : 'مؤكد' }} @endif @if(request()->filled('period')) الفترة: @switch(request('period')) @case('today') اليوم @break @case('week') هذا الأسبوع @break @case('month') هذا الشهر @break @endswitch @endif @if(request()->filled('date_from') && request()->filled('date_to')) من {{ request('date_from') }} إلى {{ request('date_to') }} @elseif(request()->filled('date_from')) من تاريخ {{ request('date_from') }} @elseif(request()->filled('date_to')) حتى تاريخ {{ request('date_to') }} @endif @if(request()->filled('search')) البحث: "{{ request('search') }}" @endif @if(request()->filled('is_automatic')) النوع: {{ request('is_automatic') === '1' ? 'تلقائي' : 'يدوي' }} @endif
@else

تقرير شامل - جميع البيانات بدون فلاتر

@endif
{{ $stats['total'] }}
إجمالي السجلات
{{ $stats['warnings'] }}
إنذارات
{{ $stats['violations'] }}
مخالفات
{{ $stats['active'] }}
نشطة
{{ $stats['resolved'] }}
محلولة
{{ $stats['automatic'] }}
تلقائية
@if($violations->count() > 0) @foreach($violations as $violation) @endforeach
النوع العنوان والوصف الأعضاء المستهدفون النقاط المخصومة منشئ المخالفة تاريخ الإنشاء الحالة تاريخ الحل
{{ $violation->type === 'warning' ? 'إنذار' : 'مخالفة' }} @if($violation->is_automatic) تلقائي @endif
{{ $violation->title }}
{{ $violation->description }}
@foreach($violation->members as $member) {{ $member->user->name }}@if(!$loop->last), @endif @endforeach
({{ $violation->members->count() }} عضو)
@if($violation->points_deducted > 0) {{ $violation->points_deducted }}
إجمالي: {{ $violation->points_deducted * $violation->members->count() }} @else - @endif
{{ $violation->creator->name }} {{ $violation->created_at->format('Y/m/d') }}
{{ $violation->created_at->format('H:i') }}
@if($violation->status == 'pending') معلق @elseif($violation->status == 'active') نشط @else محلول @endif @if($violation->resolved_at) {{ $violation->resolved_at->format('Y/m/d H:i') }} @else - @endif
@else

لا توجد بيانات للعرض

لا توجد مخالفات أو إنذارات تطابق معايير البحث المحددة

@endif @if($violations->count() > 0)

ملخص التقرير

إجمالي النقاط المخصومة:
{{ $violations->where('type', 'violation')->sum(function($v) { return $v->points_deducted * $v->members->count(); }) }} نقطة
أكثر الأعضاء تلقياً للمخالفات:
@php $memberCounts = []; foreach($violations as $violation) { foreach($violation->members as $member) { $memberCounts[$member->user->name] = ($memberCounts[$member->user->name] ?? 0) + 1; } } arsort($memberCounts); $topMember = array_key_first($memberCounts); @endphp {{ $topMember ?? 'لا يوجد' }} ({{ $memberCounts[$topMember] ?? 0 }} مرة)
نسبة الحل:
{{ $violations->count() > 0 ? round(($stats['resolved'] / $violations->count()) * 100, 1) : 0 }}%
المخالفات التلقائية:
{{ $stats['automatic'] }} من أصل {{ $stats['total'] }}
@endif