Agent Availability {{-- FILTERS --}}
@foreach($statuses as $key => $meta) {{ $meta['label'] }} @endforeach
@if(empty($report['agents']))
No agent availability recorded in this range.
@else {{-- DAILY STACKED CHART --}}
Time per status, by day
{{-- PER-AGENT TIMELINE + DURATIONS --}} @foreach($report['agents'] as $agent) @php $kpi = $agent['kpi']; @endphp
{{ $agent['name'] }}
{{ $this->fmt($kpi['online']) }}
Online
{{ $kpi['occupancyPct'] }}%
Occupancy
{{ $this->fmt($kpi['busy']) }}
On Call
{{ $this->fmt($kpi['wrap_up']) }}
Wrap-Up · {{ $kpi['wrap_up_count'] }}× · avg {{ $this->fmt($kpi['avg_wrap_up']) }}
{{ $this->fmt($kpi['available']) }}
Available
@foreach($statuses as $meta) @endforeach @foreach($report['days'] as $date) @php $day = $agent['days'][$date] ?? null; $totals = $day['totals'] ?? []; $dayOnline = ($totals['available'] ?? 0) + ($totals['busy'] ?? 0) + ($totals['wrap_up'] ?? 0) + ($totals['do_not_disturb'] ?? 0); @endphp @foreach($statuses as $key => $meta) @endforeach @endforeach
Day Timeline
0006121824
{{ $meta['label'] }}Online
{{ \Carbon\Carbon::parse($date)->format('D j M') }}
@foreach(($day['blocks'] ?? []) as $block) @php $meta = $statuses[$block['status']] ?? ['colour' => '#dee2e6', 'label' => $block['status']]; $left = $block['offset'] / 864; $width = max($block['duration'] / 864, 0.4); @endphp
@endforeach
{{ $this->fmt($totals[$key] ?? 0) }}{{ $this->fmt($dayOnline) }}
@endforeach @endif
@assets @endassets @script @endscript