@php $kpis = $data['kpis'] ?? []; $perDay = $data['per_day'] ?? []; $perHour = $data['per_hour'] ?? []; $durationBands = $data['duration_bands'] ?? []; $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
{{ number_format($kpis['total'] ?? 0) }}
Answered
{{ number_format($kpis['answered'] ?? 0) }}
Rate
{{ $kpis['answer_rate'] ?? 0 }}%
Avg Talk
{{ $kpis['avg_talk'] ?? '0:00' }}
Longest
{{ $kpis['longest_call'] ?? '—' }}
No Answer
{{ number_format($kpis['noanswer'] ?? 0) }}
@endif {{-- Hourly Distribution --}} @if(!empty($perHour))
Hourly Call Distribution
@php $maxH = max(array_column($perHour, 'total') ?: [1]); @endphp @foreach($perHour as $h) @if($h['total'] > 0) @endif @endforeach
{{ $h['hour'] }}
{{ $h['total'] }}
@endif {{-- Duration Distribution --}} @if(!empty($durationBands))
Call Duration Distribution
@foreach($durationBands as $band => $count) @endforeach
Duration BandCalls
{{ $band }}{{ number_format($count) }}
@endif {{-- Daily Volume --}} @if(!empty($perDay))
Daily Call Volume
@php $maxD = max(array_column($perDay, 'total') ?: [1]); @endphp @foreach($perDay as $day) @endforeach
{{ $day['date'] }}
{{ $day['total'] }}
@endif {{-- Footer --}}