{{-- Session Analytics (trainer). Attendance by session / service / manager / worker, scoped to "My sessions" or "All trainers". From TrainerSessionAnalyticsController@index: $rows, $by, $scope, $summary --}} @extends('layouts.app') @section('title', 'Session Analytics') @section('content') @include('partials.flash') @php $dimensions = [ 'session' => ['label' => 'Session-wise', 'icon' => 'event_note'], 'service' => ['label' => 'Service-wise', 'icon' => 'home_health'], 'manager' => ['label' => 'Service Manager-wise', 'icon' => 'badge'], 'worker' => ['label' => 'Care Worker-wise', 'icon' => 'person'], 'coverage' => ['label' => 'Service Coverage', 'icon' => 'grid_view'], ]; $rateColor = $summary['rate'] >= 75 ? 'text-primary' : ($summary['rate'] >= 50 ? 'text-gold' : 'text-error'); $tiles = [ ['label' => 'Sessions', 'value' => number_format($summary['sessions']), 'icon' => 'event_available', 'class' => 'text-primary'], ['label' => 'Attendances', 'value' => number_format($summary['attendances']), 'icon' => 'how_to_reg', 'class' => 'text-primary'], ['label' => 'Attendance Rate', 'value' => $summary['rate'].'%', 'icon' => 'insights', 'class' => $rateColor], ['label' => 'Care Workers Reached', 'value' => number_format($summary['workers']), 'icon' => 'groups', 'class' => 'text-on-surface-variant'], ]; if ($scope === 'all') { $tiles[] = ['label' => 'Trainers', 'value' => number_format($summary['trainers']), 'icon' => 'school', 'class' => 'text-on-surface-variant']; } $gridCols = $scope === 'all' ? 'lg:grid-cols-5' : 'lg:grid-cols-4'; @endphp {{-- Scope: my sessions vs the whole company --}}
{{ $tile['value'] }}
{{ $tile['label'] }}
No trainings yet
Add and schedule sessions and they’ll appear here as columns.
| Service | @foreach($trainings as $t)
{{ \Illuminate\Support\Str::limit($t, 26) }}
|
@endforeach
Coverage |
|---|---|---|
|
{{ $row['service']->name }} {{ $row['service']->code }} |
@foreach($row['cells'] as $cell)
@if($cell->state === 'taken') check_circle @elseif($cell->state === 'booked') schedule @else – @endif | @endforeach
@php $cr = $row['rate']; $crTone = $cr >= 75 ? 'text-primary' : ($cr >= 40 ? 'text-gold' : 'text-error'); @endphp
|
{{ $rows->count() }} {{ Str::plural(strtolower($entityLabel), $rows->count()) }} flagged
· {{ $filterNote }}Nothing to flag
Every {{ strtolower($entityLabel) }} in scope is engaging with training.
| {{ $entityLabel }} | @if($by !== 'worker')Care Workers | @endifSessions (att / booked) | E-learning (done / assigned) | Status |
|---|---|---|---|---|
|
{{ $r->title }} {{ $r->subtitle }} |
@if($by !== 'worker'){{ $r->workers }} | @endif{{ $r->attended }}/{{ $r->booked }} | {{ $r->completed }}/{{ $r->assigned }} | @if($r->status === 'disengaged') report Disengaged @else event_busy No sessions @endif |
No attendance data yet
Once sessions are delivered and attendance is marked, the breakdown appears here.
| Service | Service Manager | Sessions | Workers | Attendances | Attendance rate | @break @case('manager')Service Manager | Services | Sessions | Workers | Attendances | Attendance rate | @break @case('worker')Care Worker | Service | Sessions | Attended | No-show | Attendance rate | @break @defaultSession | @if($scope === 'all')Trainer | @endifExpected | Attended | No-show | Attendance rate | @endswitch
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{ $s->format === 'online' ? 'videocam' : 'location_on' }}
@if($scope === 'me')
{{ $s->title }}
@else
{{ $s->title }} @endif{{ $s->session_date?->format('D, d M Y') }} · {{ \Carbon\Carbon::parse($s->start_time)->format('H:i') }}{{ $s->training_code ? ' · ' . $s->training_code : '' }} |
@if($scope === 'all'){{ $s->trainerName() ?? '—' }} | @endif{{ $s->expected }} | {{ $s->attended }} | {{ $s->no_show }} | @if($past) @include('trainer._rate-meter', ['rate' => $s->rate]) @else Upcoming @endif | ||||||||||||||||||
|
{{ $r->name }} {{ $r->code }} |
{{ $r->sm_name ?? '—' }} | {{ $r->sessions }} | {{ $r->workers_attended }}/{{ $r->workers_total }} | {{ $r->attended }} | @include('trainer._rate-meter', ['rate' => $r->rate]) | ||||||||||||||||||
|
badge
{{ $r->name }} |
{{ $r->services }} | {{ $r->sessions }} | {{ $r->workers_attended }}/{{ $r->workers_total }} | {{ $r->attended }} | @include('trainer._rate-meter', ['rate' => $r->rate]) | ||||||||||||||||||
|
{{ $r->name }} {{ $r->email }} |
{{ $r->service_name ?? '—' }} | {{ $r->sessions }} | {{ $r->attended }} | {{ $r->no_show }} | @include('trainer._rate-meter', ['rate' => $r->rate]) |