@php $drilldown = $ipPerformance['drilldown'] ?? []; $ddTotal = (int) ($drilldown['total'] ?? 0); $ddPerPage = (int) ($drilldown['per_page'] ?? 25); $ddCurrentPage = (int) ($drilldown['current_page'] ?? 1); $ddLastPage = (int) ($drilldown['last_page'] ?? 1); $ddFrom = (int) ($drilldown['from'] ?? 0); $ddTo = (int) ($drilldown['to'] ?? 0); $debugSnapshot = $ipPerformance['debug'] ?? null; $debugEnabled = request()->boolean('debug'); $baseQuery = request()->except('page', 'ajax'); $pageUrl = fn(int $p) => url()->current() . '?' . http_build_query(array_merge($baseQuery, ['page' => $p])); @endphp @if(!empty($pageMessages ?? []))
{{ implode(' ', $pageMessages) }}
@endif @if($debugEnabled)
Filter Debug Snapshot Open JSON Debug
@if(is_array($debugSnapshot))
DB: {{ $debugSnapshot['database'] ?? '-' }} Base Rows: {{ number_format((int) ($debugSnapshot['base_row_count'] ?? 0)) }} Final Rows: {{ number_format((int) ($debugSnapshot['final_row_count'] ?? 0)) }} Tables: {{ implode(', ', $debugSnapshot['tables'] ?? []) }}
@foreach(($debugSnapshot['per_filter'] ?? []) as $filterKey => $row) @endforeach
FILTER SELECTED VALUES ISOLATED MATCH CUMULATIVE MATCH SAMPLE (TOP 5)
{{ $filterKey }} {{ implode(', ', $row['selected_values'] ?? []) ?: '-' }} {{ number_format((int) ($row['isolated_match_count'] ?? 0)) }} {{ number_format((int) ($row['cumulative_match_count'] ?? 0)) }} @if(!empty($row['sample_rows']))
View 5 rows
@foreach($row['sample_rows'] as $sample)
{{ $sample['beneficiary_name'] }} ({{ $sample['beneficiary_cnic'] }})
IP: {{ $sample['ip'] }} | District/Tehsil: {{ $sample['district'] }} / {{ $sample['tehsil'] }}
Bank/Branch: {{ $sample['bank_name'] }} / {{ $sample['branch_name'] }}
Stage: {{ $sample['pending_stage'] }} | Ageing: {{ number_format((float) ($sample['ageing_days'] ?? 0), 1) }} | Alarm: {{ strtoupper($sample['alarm_level'] ?? '-') }}
UUID: {{ $sample['uuid'] }} | Slot: {{ $sample['time_slot'] }}
@endforeach
@else - @endif
@else
Debug data unavailable.
@endif
@endif

IP PERFORMANCE RANKING

1ST TO 4TH AVERAGE DAYS

STAGE WISE COMPARISON

IP Exception and Ranking Table
Aggregated performance indicators by Implementing Partner
@forelse(($ipPerformance['ranking_table'] ?? []) as $row) @php $delayColor = $row['delayed_pct'] >= 40 ? '#dc2626' : ($row['delayed_pct'] >= 20 ? '#a16207' : '#16a34a'); $rankPillClass = ($row['rank'] ?? 0) === 1 ? 'is-top' : ''; @endphp @empty @endforelse
IP AVG DAYS DELAYED % RED ALARM CASES WITHDRAWAL EFFICIENCY RANK
{{ $row['ip'] }} {{ number_format((float) $row['avg_days'], 1) }} {{ number_format((float) $row['delayed_pct'], 1) }}% {{ number_format((int) $row['red_alarm_cases']) }} {{ number_format((float) $row['withdrawal_efficiency'], 1) }}% {{ str_pad((string) $row['rank'], 2, '0', STR_PAD_LEFT) }}
No IP ranking data found for selected filters.
Drill-down Table: Exception and Delay Cases @if($ddTotal > 0) {{ number_format($ddTotal) }} total @endif
@forelse(($drilldown['rows'] ?? []) as $row) @php $ageClass = $row['ageing_days'] >= 120 ? 'is-critical' : ($row['ageing_days'] >= 60 ? 'is-warning' : 'is-healthy'); $alarmClass = match ($row['alarm_level']) { 'red' => 'is-red', 'orange' => 'is-orange', 'yellow' => 'is-yellow', default => 'is-green', }; @endphp @empty @endforelse
BENEFICIARY/CNIC IP DISTRICT TEHSIL PENDING STAGE AGEING DAYS ALARM
{{ $row['beneficiary_name'] }}
{{ $row['beneficiary_cnic'] }}
{{ $row['ip'] }} {{ $row['district'] }} {{ $row['tehsil'] }} {{ $row['pending_stage'] }} {{ (int) $row['ageing_days'] }}
No exception rows found for selected filters.
@if($ddLastPage > 1) @elseif($ddTotal > 0) @endif