@php
$kpis = $data['kpis'] ?? [];
$perDay = $data['per_day'] ?? [];
$topExt = $data['top_ext'] ?? [];
$departments = $data['departments'] ?? [];
$companyName = app(\App\Services\PbxDefaultsService::class)->companyName();
$reportLabel = $schedule->reportTypeLabel();
@endphp
{{-- Header --}}
|
{{ $reportLabel }}
{{ $fromDate }} – {{ $toDate }} · {{ ucfirst($schedule->frequencyLabel()) }}
|
{{ $companyName }}
Generated {{ now()->format('d M Y H:i') }}
|
{{-- KPI Tiles --}}
@if(!empty($kpis))
Total Calls {{ number_format($kpis['total'] ?? 0) }} |
Answer Rate {{ $kpis['answer_rate'] ?? 0 }}% |
Avg Talk Time {{ $kpis['avg_talk'] ?? '0:00' }} |
Missed Calls {{ number_format($kpis['missed_outstanding'] ?? $kpis['noanswer'] ?? 0) }} |
Total Talk: {{ $kpis['talk_human'] ?? '0:00' }} ·
Busiest Hour: {{ $kpis['busiest_hour'] ?? '—' }} ·
Answered: {{ number_format($kpis['answered'] ?? 0) }} ·
No Answer: {{ number_format($kpis['noanswer'] ?? 0) }} ·
Busy: {{ number_format($kpis['busy'] ?? 0) }}
{{-- Network Health --}}
@php $netHealth = $data['network_health'] ?? []; @endphp
@if(!empty($netHealth['available']))
| 📶 Network Quality |
{{ $netHealth['grade'] }} |
|
Avg RTT: {{ $netHealth['avg_rtt'] }}ms · Best: {{ $netHealth['min_rtt'] }}ms · Worst: {{ $netHealth['max_rtt'] }}ms · {{ $netHealth['endpoints'] }} endpoints
|
|
@endif
{{-- Direction Split --}}
@php $direction = $data['direction'] ?? []; @endphp
@if(!empty($direction))
↓ Inbound
{{ number_format($direction['inbound']['total'] ?? 0) }}
{{ number_format($direction['inbound']['answered'] ?? 0) }} answered
|
↑ Outbound
{{ number_format($direction['outbound']['total'] ?? 0) }}
{{ number_format($direction['outbound']['answered'] ?? 0) }} connected
|
↔ Internal
{{ number_format($direction['internal']['total'] ?? 0) }}
{{ number_format($direction['internal']['answered'] ?? 0) }} answered
|
@endif
@endif
{{-- Top Contacts --}}
@php $topContacts = $data['top_contacts'] ?? []; @endphp
Top Contacts (Phonebook)
@if(!empty($topContacts))
| Contact | Total | In | Out |
@foreach($topContacts as $contact)
{{ $contact['name'] }} {{ $contact['number'] }} |
{{ $contact['total'] }} |
{{ $contact['inbound'] }} |
{{ $contact['outbound'] }} |
@endforeach
@else
📒 Your phonebook is empty. Import your customer contacts to unlock caller-name display, missed-call tracking, and this Top Contacts report.
@endif
{{-- Daily Volume Chart --}}
@if(!empty($perDay))
Daily Call Volume
@php $maxCalls = max(array_column($perDay, 'total') ?: [1]); @endphp
@foreach($perDay as $day)
| {{ $day['date'] }} |
|
{{ $day['total'] }} |
@endforeach
@endif
{{-- Two-column: Top Extensions + Departments --}}
@if(!empty($topExt))
|
Top Extensions
| Ext | Total | In | Out | Int | Missed | Talk |
@foreach($topExt as $ext)
{{ $ext['ext'] }}@if(!empty($ext['name'])) {{ $ext['name'] }}@endif |
{{ $ext['calls'] }} |
{{ $ext['inbound'] ?? 0 }} |
{{ $ext['outbound'] ?? 0 }} |
{{ $ext['internal'] ?? 0 }} |
{{ $ext['missed'] ?? 0 }} |
{{ $ext['talk'] }} |
@endforeach
|
|
@endif
@if(!empty($departments))
Department Performance
| Dept | Calls | Rate | Talk |
@foreach(array_slice($departments, 0, 8) as $dept)
@php
$rate = $dept['answer_rate'];
$badgeClass = $rate >= 80 ? 'badge-green' : ($rate >= 60 ? 'badge-amber' : 'badge-red');
@endphp
| {{ $dept['name'] }} |
{{ $dept['total'] }} |
{{ $rate }}% |
{{ $dept['talk_human'] }} |
@endforeach
|
@endif
@if(empty($departments))
🏢 Did you know? Group your users into departments to see team-level answer rates, talk time, and performance scoring right here.
@endif
{{-- Footer --}}