Total Cases
@php $kpis = $ageing['kpis'] ?? []; $register = $ageing['exception_register'] ?? []; $modal = $ageing['modal'] ?? ['alarm' => 'red', 'rows' => [], 'total' => 0]; $matrixRows = $ageing['stage_bottleneck_matrix'] ?? []; $nonWithdrawalMatrix = $ageing['non_withdrawal_matrix'] ?? ['yellow' => 0, 'orange' => 0, 'red' => 0]; $alarmCardCounts = [ 'yellow' => (int) ($nonWithdrawalMatrix['yellow'] ?? 0), 'orange' => (int) ($nonWithdrawalMatrix['orange'] ?? 0), 'red' => (int) ($nonWithdrawalMatrix['red'] ?? 0), ]; if (($alarmCardCounts['yellow'] + $alarmCardCounts['orange'] + $alarmCardCounts['red']) === 0) { // Fallback for tenants where w_* precompute is not available yet. $alarmCardCounts['yellow'] = (int) ($kpis['yellow_population'] ?? 0); $alarmCardCounts['orange'] = (int) ($kpis['orange_population'] ?? 0); $alarmCardCounts['red'] = (int) ($kpis['red_population'] ?? 0); } $stageNameOverrides = [ 'tranche_1_to_plinth' => 'First Installment Released', 'plinth_to_tranche_2' => 'Plinth Completed', 'tranche_2_to_lintel' => 'Second Installment Released', 'lintel_to_tranche_3' => 'Lintel Completed', 'tranche_3_to_roof' => 'Third Installment Released', 'roof_to_tranche_4' => 'Roof Completed', 'overall_1st_to_roof' => 'Overall', ]; $stageDelayChart = $ageing['charts']['stage_delay_trend'] ?? []; $delayFiscalYears = $stageDelayChart['fiscal_years'] ?? []; $delaySelectedFY = (string) ($stageDelayChart['selected_fiscal_year'] ?? request('fiscal_year', '')); $total = (int) ($register['total'] ?? 0); $currentPage = (int) ($register['current_page'] ?? 1); $lastPage = (int) ($register['last_page'] ?? 1); $from = (int) ($register['from'] ?? 0); $to = (int) ($register['to'] ?? 0); $baseQuery = request()->except('page', 'ajax', 'per_page'); $pageUrl = fn(int $p) => url()->current() . '?' . http_build_query(array_merge($baseQuery, ['page' => $p])); @endphp @if(!empty($pageMessages ?? []))
@endifTotal Cases
Normal
Yellow
Orange
Red
| Stage | Live Cases | Avg Days | Green | Yellow | Amber | Red | Escalation |
|---|---|---|---|---|---|---|---|
| {{ $displayStage }} | {{ number_format((int) ($row['live_cases'] ?? 0)) }} | {{ number_format((int) ($row['avg_days'] ?? 0)) }} | {{ $row['escalation'] ?? '-' }} | ||||
| No stage bottleneck data found for selected filters. | |||||||
Withdrawal stages · Construction stages
| UUID | Beneficiary | CNIC | IP | District | IFI | Current Stage | Elapsed Days | Status | Owner Level |
|---|---|---|---|---|---|---|---|---|---|
| {{ $row['uuid'] ?? '-' }} | {{ $row['beneficiary_name'] ?? '-' }} | {{ $row['beneficiary_cnic'] ?? '-' }} | {{ $row['ip'] ?? '-' }} | {{ $row['district'] ?? '-' }} | {{ $row['ifi'] ?? '-' }} | {{ $row['pending_stage'] ?? '-' }} | {{ (int) ($row['ageing_days'] ?? 0) }} | {{ $alarmLabel }} | {{ $row['owner_level'] ?? 'Normal' }} |
| No exception rows found for selected filters. | |||||||||