{{-- Compliance Matrix (overview) — services (rows) × courses (columns), each cell the home's completion rate for that course. From ManagementController@matrix: $rows, $courses, $registeredManagers, $rmId, $q --}} @extends('layouts.app') @section('title', 'Compliance Matrix') @section('content') @include('partials.flash') @php $role = auth()->user()->primaryRole(); $matrixRoute = $role . '.compliance.matrix'; $indexRoute = $role . '.compliance.index'; $exportUrl = route($matrixRoute, array_filter(['rm' => $rmId, 'q' => $q, 'format' => 'csv'])); @endphp {{-- Controls --}}
search
@if($registeredManagers->isNotEmpty())
@endif @if($rmId || $q) Reset @endif
{{ $rows->count() }} {{ Str::plural('service', $rows->count()) }} · {{ $courses->count() }} {{ Str::plural('course', $courses->count()) }} table_rows List view download Export CSV
{{-- Legend --}}
100% complete Partial Has overdue Not assigned Each cell shows % of that service's assigned workers who have completed the course. Click a service to see individuals.
@if($rows->isEmpty() || $courses->isEmpty())
grid_view

Nothing to show

No services or assigned courses in this selection.

@else
@foreach($courses as $course) @endforeach @foreach($rows as $row) @foreach($row['cells'] as $cell) @endforeach @endforeach
Service
{{ \Illuminate\Support\Str::limit($course->title, 26) }}
{{ $row['service']->name }}

{{ $row['service']->code }}

@if($cell === null) @else @php $bg = $cell['overdue'] > 0 ? 'bg-error text-on-error' : ($cell['pct'] >= 100 ? 'bg-primary text-on-primary' : ($cell['pct'] > 0 ? 'bg-gold text-on-primary' : 'bg-surface-container-high text-on-surface-variant')); @endphp {{ $cell['pct'] }}% @endif
@endif @endsection