@extends('adminlte::page') @section('title', 'Cases by Station') @section('content_header')

Cases by Police Station

@stop @section('content')

Case Distribution by Station

Stations with Most Cases

@foreach($stationsWithMostCases as $station) @endforeach
Station Total Cases Actions
{{ $station->name }} {{ $station->cases_count }} View Cases

Stations with Most Open Cases

@foreach($stationsWithMostOpenCases as $station) @endforeach
Station Open Cases Actions
{{ $station->name }} {{ $station->cases_count }} View Cases

Detailed Station Case Breakdown

@foreach($stations as $station) @endforeach
Station Total Cases Open Under Investigation Pending Review Closed Other Actions
{{ $station->name }} {{ $station->cases_count }} @php $openCount = 0; if (isset($stationStatusBreakdown[$station->id])) { foreach ($stationStatusBreakdown[$station->id] as $breakdown) { if ($breakdown->status === 'open') { $openCount = $breakdown->total; break; } } } @endphp {{ $openCount }} @php $underInvestigationCount = 0; if (isset($stationStatusBreakdown[$station->id])) { foreach ($stationStatusBreakdown[$station->id] as $breakdown) { if ($breakdown->status === 'under_investigation') { $underInvestigationCount = $breakdown->total; break; } } } @endphp {{ $underInvestigationCount }} @php $pendingReviewCount = 0; if (isset($stationStatusBreakdown[$station->id])) { foreach ($stationStatusBreakdown[$station->id] as $breakdown) { if ($breakdown->status === 'pending_review') { $pendingReviewCount = $breakdown->total; break; } } } @endphp {{ $pendingReviewCount }} @php $closedCount = 0; if (isset($stationStatusBreakdown[$station->id])) { foreach ($stationStatusBreakdown[$station->id] as $breakdown) { if ($breakdown->status === 'closed') { $closedCount = $breakdown->total; break; } } } @endphp {{ $closedCount }} @php $otherCount = 0; if (isset($stationStatusBreakdown[$station->id])) { foreach ($stationStatusBreakdown[$station->id] as $breakdown) { if (!in_array($breakdown->status, ['open', 'under_investigation', 'pending_review', 'closed'])) { $otherCount += $breakdown->total; } } } @endphp {{ $otherCount }} View Cases
@stop @section('css') @stop @section('js') @stop