@extends('layouts.app') @section('title', 'Dashboard - ICMIS') @push('styles') @endpush @section('content')

Dashboard

{{ now()->format('l, d F Y') }} · Welcome back, {{ Auth::user()->name ?? 'Officer' }}
@if(auth()->user() && auth()->user()->canSeePrisonDashboard())@endif @if(auth()->user() && auth()->user()->canSeeProbationDashboard())@endif
{{-- Local / Abroad scope (SPD req 28). Switchable only when the user can see both. --}} @if($locationScope === 'all') @else {{ ucfirst($locationScope) }} data @endif
@if(auth()->user() && auth()->user()->canSeePrisonDashboard())
Population Distribution by Category
Weekly Trends
@endif @if(auth()->user() && auth()->user()->canSeeProbationDashboard())
@php $pcTiles = [ ['Total Cases', $probation['total'], 'grad-blue', 'fa-folder-open', ''], ['Under Supervision', $probation['supervised'], 'grad-teal', 'fa-eye', 'status=under_supervision'], ['Awaiting Court', $probation['awaiting'], 'grad-amber', 'fa-gavel', 'status=awaiting_court'], ['In Breach', $probation['breached'], 'grad-red', 'fa-triangle-exclamation', 'status=breached'], ['Completed', $probation['completed'], 'grad-green', 'fa-circle-check', 'status=completed'], ['High Risk', $probation['high_risk'], 'grad-purple', 'fa-fire', ''], ]; @endphp @foreach($pcTiles as [$label, $val, $grad, $icon, $qs]) @endforeach
@php $pcLabels = [ 'social_inquiry' => 'Social Inquiry', 'probation_order' => 'Probation Order', 'community_service' => 'Community Service', 'aftercare_borstal' => 'Aftercare', 'power_of_mercy' => 'Power of Mercy', 'special_category' => 'Special Category', 'adr' => 'ADR', 'probation_hostel' => 'Hostel', 'halfway_house' => 'Halfway House', ]; $pcMax = max(1, count($probationByType) ? max($probationByType) : 1); @endphp
Cases by Work-stream click to filter
@forelse($probationByType as $type => $count)
{{ $pcLabels[$type] ?? ucwords(str_replace('_',' ',$type)) }} {{ $count }}
@empty

No probation cases yet.

@endforelse
Recent Probation Cases
Recent Activities
@forelse($recentActivities as $activity)
{{ $activity->title }} {{ $activity->time }}
{{ $activity->description }}
Processed by {{ $activity->officer }}
@empty

No recent activities found.

@endforelse
Alerts & Notifications
@forelse($alerts as $alert) @empty
No active alerts at this time.
@endforelse
Facility Status
@forelse($blocks as $block) @php $percentage = $block->percentage ?? 0; $badgeClass = $percentage >= 90 ? 'danger' : ($percentage >= 75 ? 'warning' : 'success'); @endphp @empty @endforelse
Block NameTypeCapacity OccupiedStatusOccupancy
{{ $block->block_name }} {{ $block->block_type ?? 'General' }} {{ number_format($block->capacity) }} {{ number_format($block->occupied_count ?? 0) }} {{ $percentage }}%
{{ $percentage }}%
No blocks configured for this facility.
@endif
@endsection @push('scripts') @endpush