@extends('layouts.app')
@section('title', 'لوحة التحكم')
@section('page_title', 'لوحة التحكم')
@section('page_subtitle', 'ملخص تشغيل اليوم ' . now()->format('Y-m-d'))
@section('content')
@php
$cards = [
['مكالمات اليوم', $stats['total_calls'], 'bi-telephone', '#e0e7ff', '#3730a3'],
['تم الرد', $stats['answered_calls'], 'bi-telephone-inbound', '#dcfce7', '#166534'],
['مفقودة', $stats['missed_calls'], 'bi-telephone-x', '#fee2e2', '#991b1b'],
['نسبة الرد', $stats['answer_rate'] . '%', 'bi-percent', '#fef3c7', '#92400e'],
];
@endphp
@foreach ($cards as $card)
{{ $card[1] }}
{{ $card[0] }}
@endforeach
@php
$cards2 = [
['متوسط زمن المعالجة', gmdate('i:s', $stats['aht']), 'bi-stopwatch'],
['إجمالي زمن الكلام', gmdate('H:i:s', $stats['talk_time']), 'bi-mic'],
['تذاكر مفتوحة', $stats['open_tickets'], 'bi-ticket-detailed'],
['متابعات مستحقة', $stats['due_followups'], 'bi-calendar-check'],
['العملاء', $stats['customers'], 'bi-people'],
['موظفون متصلون', $stats['agents_online'], 'bi-person-check'],
];
@endphp
@foreach ($cards2 as $card)
{{ $card[1] }}
{{ $card[0] }}
@endforeach
@foreach (\App\Models\User::STATUSES as $key => $label)
{{ $label }}
{{ $agentStates[$key] ?? 0 }}
@endforeach
@forelse ($topAgents as $row)
-
{{ $row->agent?->name ?? '—' }}
{{ $row->total }} مكالمة
{{ gmdate('H:i:s', (int) $row->talk) }}
@empty
- لا توجد مكالمات اليوم
@endforelse
| الحملة | المكالمات | الهدف | الإنجاز |
@forelse ($activeCampaigns as $campaign)
| {{ $campaign->name }} |
{{ $campaign->calls_count }} |
{{ $campaign->target_calls }} |
{{ $campaign->progress() }}%
|
@empty
| لا توجد حملات نشطة |
@endforelse
@endsection
@push('scripts')
@endpush