{{-- Statistical reports by officer / station / county / region / national: cases, most prevalent offences, male / female, boys / girls, adults vs children, risk levels. Export to Excel. --}} @extends('layouts.app') @section('title', 'Probation Statistics - ICMIS') @push('styles') @include('probation._styles') @endpush @section('extraFilters')
@endsection @section('content') @php $totals = ['cases' => 0, 'male' => 0, 'female' => 0, 'boys' => 0, 'girls' => 0, 'adults' => 0, 'children' => 0, 'high' => 0, 'medium' => 0, 'low' => 0]; foreach ($table as $r) foreach ($totals as $k => $v) $totals[$k] += $r[$k]; $maxOff = max(1, $offences->max() ?? 1); @endphp

Statistical Report

@include('probation.dashboard._filters')
@forelse($table as $k => $r) @empty@endforelse @foreach($totals as $v)@endforeach
{{ ucfirst($groupBy) }}CasesAdultsChildrenAdultsChildrenRisk level
MaleFemaleBoysGirlsHighMediumLow
{{ $k }}{{ $r['cases'] }}{{ $r['male'] }}{{ $r['female'] }}{{ $r['boys'] }}{{ $r['girls'] }} {{ $r['adults'] }}{{ $r['children'] }}{{ $r['high'] }}{{ $r['medium'] }}{{ $r['low'] }}
No cases.
Total{{ $v }}
Most prevalent offences
@forelse($offences as $o => $n)
{{ $o }}{{ $n }}
@empty

No offences recorded.

@endforelse
Male / female ยท adults / children
@php $sum = max(1, $totals['cases']); @endphp @foreach(['Male (adults)' => $totals['male'], 'Female (adults)' => $totals['female'], 'Boys' => $totals['boys'], 'Girls' => $totals['girls']] as $l => $v)
{{ $l }}{{ $v }} ({{ round(100 * $v / $sum) }}%)
@endforeach
Children = flagged as a child offender or under 18 at registration. Sex not recorded is not counted in these four bars.
@endsection