@extends('layouts.app')
@section('title', 'Prison Summary - ICMIS')
@section('content')
Prison Summary
As at {{ now()->format('d M Y, H:i') }}
{{-- Headline KPIs --}}
Total Prisoners
{{ number_format($stats['total_prisoners']) }}
In Custody
{{ number_format($stats['in_custody']) }}
Released
{{ number_format($stats['released']) }}
Discharges (30d)
{{ number_format($stats['discharges_recent']) }}
{{-- Secondary flags --}}
Transfers Pending
{{ number_format($stats['transfers_pending']) }}
Classification Reviews Due
{{ number_format($stats['reviews_due']) }}
Mothers w/ Children
{{ number_format($stats['with_children']) }}
Stations
{{ number_format(count($stats['by_branch'])) }}
{{-- Breakdown cards --}}
@php
$blocks = [
['Reception Status', $stats['by_status']],
['Security Level', $stats['by_security']],
['Custody Level (in custody)', $stats['by_custody_level']],
['By Gender', $stats['by_gender']],
['By Age Band', $stats['by_age_band']],
['Population by Station', $stats['by_branch']],
['Discharge Type', $stats['by_discharge_type']],
['Transfer Status', $stats['by_transfer_status']],
];
@endphp
@foreach($blocks as [$title, $data])
@forelse($data as $k => $v)
{{ ucwords(str_replace('_', ' ', (string) ($k === '' || $k === null ? '—' : $k))) }}
{{ number_format($v) }}
@empty
No data.
@endforelse
@endforeach
{{-- 6-month admission trend --}}
@php $maxTrend = max(1, count($stats['admission_trend']) ? max($stats['admission_trend']) : 1); @endphp
@forelse($stats['admission_trend'] as $month => $count)
{{ $month }}
{{ number_format($count) }}
@empty
No admission data.
@endforelse
Prison analytics are maintained by the Kenya Prisons team; this is a read-only summary scoped to your station.
@endsection