@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)) @foreach($topContacts as $contact) @endforeach
ContactTotalInOut
{{ $contact['name'] }}
{{ $contact['number'] }}
{{ $contact['total'] }} {{ $contact['inbound'] }} {{ $contact['outbound'] }}
@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) @endforeach
{{ $day['date'] }}
{{ $day['total'] }}
@endif {{-- Two-column: Top Extensions + Departments --}} @if(!empty($topExt)) @endif @if(!empty($departments)) @endif
Top Extensions
@foreach($topExt as $ext) @endforeach
ExtTotalInOutIntMissedTalk
{{ $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'] }}
Department Performance
@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 @endforeach
DeptCallsRateTalk
{{ $dept['name'] }} {{ $dept['total'] }} {{ $rate }}% {{ $dept['talk_human'] }}
@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 --}}