{{-- Workforce training status donut. Everything not completed is OVERDUE; the overdue share is broken down into in progress / not started / required sessions not attended / medication competency / observations not in date. Expects: $mix (AggregatesCompliance::trainingStatusMix()), optional $overdueHref. --}} @php $segs = [ ['label' => 'Completed', 'value' => (int) $mix['completed'], 'hex' => '#0E7C7B'], ['label' => 'Overdue · in progress', 'value' => (int) $mix['in_progress'], 'hex' => '#D08A3A'], ['label' => 'Overdue · not started', 'value' => (int) $mix['not_started'], 'hex' => '#C1473A'], ['label' => 'Overdue · session not attended', 'value' => (int) $mix['sessions_missing'], 'hex' => '#7E2F4F'], ['label' => 'Overdue · medication competency', 'value' => (int) ($mix['competency_missing'] ?? 0), 'hex' => '#4B5563'], ['label' => 'Overdue · observation', 'value' => (int) ($mix['observations_missing'] ?? 0), 'hex' => '#9A3412'], ]; $overdueParts = array_slice($segs, 1); $pctOf = fn ($v) => $mix['total'] > 0 ? round($v / $mix['total'] * 100) : 0; @endphp

Workforce training status

@if($mix['total'] > 0)
@include('management._donut', ['segs' => $segs, 'total' => (int) $mix['total'], 'centerValue' => $mix['compliance'].'%', 'centerLabel' => 'compliant'])
Completed {{ number_format($mix['completed']) }} ({{ $pctOf($mix['completed']) }}%)
@if(! empty($overdueHref)) Overdue (not completed) chevron_right @else Overdue (not completed) @endif {{ number_format($mix['overdue']) }} ({{ $pctOf($mix['overdue']) }}%)
@foreach($overdueParts as $p) @if($p['value'] > 0 || $loop->index < 2)
{{ \Illuminate\Support\Str::after($p['label'], '· ') }} {{ number_format($p['value']) }}
@endif @endforeach
@else

No training assigned yet.

@endif