{{-- Header & Filters --}}

تقارير العمليات

{{ match($period) { 'today' => 'اليوم', 'yesterday' => 'الأمس', 'last_7_days' => 'آخر 7 أيام', 'last_30_days' => 'آخر 30 يوم', default => 'كل الوقت', } }}
{{-- Filters Bar --}}
{{-- Period Filter --}}
@if($isAdmin) {{-- Team Filter --}}
@endif {{-- Employee Filter --}}
{{-- Custom Date Range --}}
إعادة تعيين
{{-- KPI Cards --}}
@php $kpiCards = [ ['key' => 'total_conversations', 'label' => 'إجمالي المحادثات', 'icon' => '💬', 'color' => 'blue'], ['key' => 'open_conversations', 'label' => 'المحادثات المفتوحة', 'icon' => '🟢', 'color' => 'emerald'], ['key' => 'closed_conversations', 'label' => 'المحادثات المغلقة', 'icon' => '🔴', 'color' => 'rose'], ['key' => 'pending_conversations', 'label' => 'في الانتظار', 'icon' => '⏳', 'color' => 'amber'], ['key' => 'unread_conversations', 'label' => 'غير مقروءة', 'icon' => '🔔', 'color' => 'orange'], ['key' => 'incoming_messages', 'label' => 'الرسائل الواردة', 'icon' => '📥', 'color' => 'indigo'], ['key' => 'outgoing_messages', 'label' => 'الردود المرسلة', 'icon' => '📤', 'color' => 'cyan'], ['key' => 'active_employees', 'label' => 'الموظفين النشطين', 'icon' => '👤', 'color' => 'violet'], ]; @endphp @foreach($kpiCards as $card)
{{ $card['icon'] }} {{ $card['label'] }}
{{ number_format($kpis[$card['key']]) }}
@endforeach
{{-- Chart: Message Volume --}} @php $msgTotal = max($kpis['incoming_messages'] + $kpis['outgoing_messages'], 1); $inPct = round(($kpis['incoming_messages'] / $msgTotal) * 100); $outPct = round(($kpis['outgoing_messages'] / $msgTotal) * 100); $convTotal = max(array_sum($conversationStatus), 1); @endphp

📊 حجم الرسائل

الواردة {{ number_format($kpis['incoming_messages']) }} ({{ $inPct }}%)
المرسلة {{ number_format($kpis['outgoing_messages']) }} ({{ $outPct }}%)

📈 حالة المحادثات

@foreach(['open' => ['مفتوحة', 'emerald'], 'pending' => ['في الانتظار', 'amber'], 'closed' => ['مغلقة', 'rose'], 'assigned' => ['معينة', 'blue'], 'unassigned' => ['غير معينة', 'gray']] as $status => $info) @php $pct = round((($conversationStatus[$status] ?? 0) / $convTotal) * 100); @endphp
{{ number_format($conversationStatus[$status] ?? 0) }}
{{ $info[0] }}
@endforeach
{{-- Employee Performance --}}

أداء الموظفين

{{ count($employeePerformance) }} موظف
@forelse($employeePerformance as $emp) @empty @endforelse
الموظف الفريق معين له مفتوح مغلق رسائل واردة ردود مرسلة آخر نشاط متوسط وقت الرد
{{ $emp['name'] }} {{ $emp['team'] }} {{ number_format($emp['assigned_count']) }} {{ number_format($emp['open_count']) }} {{ number_format($emp['closed_count']) }} {{ number_format($emp['incoming_count']) }} {{ number_format($emp['outgoing_count']) }} {{ $emp['last_activity'] }} {{ $emp['avg_response_time'] ?? '-' }}
لا يوجد بيانات للعرض
{{-- Team Performance --}}

أداء الفرق

@forelse($teamPerformance as $team) @empty @endforelse
الفريق المشرف الموظفين إجمالي المحادثات مفتوحة مغلقة في الانتظار
{{ $team['name'] }} {{ $team['supervisor'] }} {{ number_format($team['employee_count']) }} {{ number_format($team['total_conversations']) }} {{ number_format($team['open_count']) }} {{ number_format($team['closed_count']) }} {{ number_format($team['pending_count']) }}
لا يوجد بيانات للعرض
{{-- Assignment Report --}}

سجل التكليفات

آخر 50
@forelse($assignments as $assignment) @empty @endforelse
# المحادثة الموظف معين بواسطة السبب تاريخ التكليف الحالة
#{{ $assignment['id'] }} #{{ $assignment['conversation_id'] }} {{ $assignment['employee'] }} {{ $assignment['assigned_by'] }} {{ $assignment['reason'] }} {{ $assignment['assigned_at'] }} @if($assignment['status'] === 'Active') نشط @else غير نشط @endif
لا يوجد بيانات للعرض
{{-- Export Placeholder --}}
📥

تصدير التقارير

تصدير البيانات إلى Excel / CSV سيكون متاحاً قريباً