@extends('layout.app') @section('head') @endsection @section('content')
Reset
@if (!$snapshotDate)

No snapshot has been stored yet. The scheduler writes one every day at 23:50, or run php artisan snapshot:pop-client-status to create today's now.

@else
{{-- Pinned while the bars scroll: with 130 POPs the totals and the legend would otherwise be off-screen for most of the chart. The legend is hand-rolled here because Chart.js draws its own inside the canvas, which scrolls away. --}}

Client Summary by {{ $viewBy === 'manager' ? 'Manager' : 'POP' }} — {{ date('d-M-Y', strtotime($snapshotDate)) }}

{{-- The two figures the chart plots come first, then the statuses that make up Not Active, then Closed which the chart leaves out. --}}
Active
{{ number_format($totals['active']) }}
Not Active
{{ number_format($totals['not_active']) }}
@foreach (['disable', 'deactive', 'expired'] as $column)
{{ $column }}
{{ number_format($totals[$column]) }}
@endforeach
Closed
{{ number_format($totals['closed']) }}
Total
{{ number_format($totals['total']) }}
Active Not Active
{{-- Height grows with the bar count so 130 POPs stay readable instead of being squeezed into a fixed canvas. --}}
{{-- Own scroll box rather than .table-responsive: that wrapper scrolls on the x axis at auto height, so a sticky thead had no scrollable ancestor to pin against. A capped height gives the header and footer something to stick to. --}}
@foreach (['disable', 'deactive', 'expired', 'closed'] as $column) @endforeach @foreach ($rows as $row) @foreach (['disable', 'deactive', 'expired', 'closed'] as $column) @endforeach @endforeach @foreach (['disable', 'deactive', 'expired', 'closed'] as $column) @endforeach
{{ $viewBy === 'manager' ? 'Manager' : 'POP' }} Active Not Active {{ $column }}Total
{{ $row->label }} {{ number_format($row->active) }} {{ number_format($row->not_active) }}{{ number_format($row->{$column}) }}{{ number_format($row->total) }}
Total {{ number_format($totals['active']) }} {{ number_format($totals['not_active']) }}{{ number_format($totals[$column]) }}{{ number_format($totals['total']) }}
@endif
@endsection @section('ajax') @if ($snapshotDate) @endif @endsection