{{-- Company E-Learning Compliance (trainer, whole organisation). From TrainerComplianceController@index: $rows, $courses, $summary, $q --}} @extends('layouts.app') @section('title', 'Company Compliance') @section('content') @include('partials.flash') @include('trainer.compliance._tabs') {{-- Summary: whole-company roll-up (same KPI-tile UI as the dashboard) --}} @php $sColor = $summary['compliance'] >= 90 ? 'text-primary' : ($summary['compliance'] >= 70 ? 'text-gold' : 'text-error'); $tiles = [ ['label' => 'Overall Compliance', 'value' => $summary['compliance'].'%', 'icon' => 'verified', 'class' => $sColor, 'sub' => number_format($summary['completed']).' / '.number_format($summary['assigned']).' completions'], ['label' => 'Overdue', 'value' => number_format($summary['overdue']), 'icon' => 'running_with_errors', 'class' => $summary['overdue'] > 0 ? 'text-error' : 'text-on-surface-variant', 'sub' => 'course'.($summary['overdue'] === 1 ? '' : 's').' past due'], ['label' => 'Care Workers', 'value' => number_format($summary['workers']), 'icon' => 'groups', 'class' => 'text-primary', 'sub' => 'across '.$summary['services'].' '.Str::plural('service', $summary['services'])], ['label' => 'Courses Tracked', 'value' => $courses->count(), 'icon' => 'menu_book', 'class' => 'text-on-surface-variant', 'sub' => 'assigned e-learnings'], ]; @endphp
@foreach($tiles as $tile)
{{ $tile['icon'] }}

{{ $tile['value'] }}

{{ $tile['label'] }}

{{ $tile['sub'] }}

@endforeach
{{-- Controls --}}
search
@if($q) Reset @endif
{{ $rows->count() }} {{ Str::plural('service', $rows->count()) }} · {{ $courses->count() }} {{ Str::plural('course', $courses->count()) }} download Export CSV
{{-- Legend --}}
100% complete Partial Has overdue Not assigned N/A Not required here Each cell shows the % of that service's Care 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 e-learning 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 }} · {{ $row['workers'] }} {{ Str::plural('worker', $row['workers']) }}

@if($cell === null) – @elseif(!empty($cell['excluded'])) N/A @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