{{-- Header & Filters --}}
تقارير العمليات
{{ match($period) {
'today' => 'اليوم',
'yesterday' => 'الأمس',
'last_7_days' => 'آخر 7 أيام',
'last_30_days' => 'آخر 30 يوم',
default => 'كل الوقت',
} }}
{{-- Filters Bar --}}
{{-- 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)
| {{ $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'] ?? '-' }}
|
@empty
|
لا يوجد بيانات للعرض
|
@endforelse
{{-- Team Performance --}}
أداء الفرق
| الفريق |
المشرف |
الموظفين |
إجمالي المحادثات |
مفتوحة |
مغلقة |
في الانتظار |
@forelse($teamPerformance as $team)
| {{ $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']) }}
|
@empty
|
لا يوجد بيانات للعرض
|
@endforelse
{{-- Assignment Report --}}
سجل التكليفات
آخر 50
| # |
المحادثة |
الموظف |
معين بواسطة |
السبب |
تاريخ التكليف |
الحالة |
@forelse($assignments as $assignment)
| #{{ $assignment['id'] }} |
#{{ $assignment['conversation_id'] }} |
{{ $assignment['employee'] }} |
{{ $assignment['assigned_by'] }} |
{{ $assignment['reason'] }}
|
{{ $assignment['assigned_at'] }} |
@if($assignment['status'] === 'Active')
نشط
@else
غير نشط
@endif
|
@empty
|
لا يوجد بيانات للعرض
|
@endforelse
{{-- Export Placeholder --}}
📥
تصدير التقارير
تصدير البيانات إلى Excel / CSV سيكون متاحاً قريباً