{{-- Learning Plan / CPD Journey — a single course. From EmployeeCourseController@plan: $course = Course with ->pivot (status live) and ->modules $pace = recommended-pace + on-track summary (see controller) $weekly = [ ['label','range','target','rec_minutes','actual_minutes','actual_pct','status'], ... ] $monthly = same shape, month buckets --}} @extends('layouts.app') @section('title', 'Learning Plan') @section('content') @include('employee._flash') @php $showRoute = auth()->user()->learnRoute('course.show', $course->slug); $fmt = function ($min) { $min = max(0, (int) round($min)); if ($min < 60) return $min . ' min'; $h = intdiv($min, 60); $m = $min % 60; return $m ? $h . 'h ' . $m . 'm' : $h . 'h'; }; @endphp {{-- Header --}}
Your CPD learning plan — what to complete, by when, and whether you're on track.
{{ $c['value'] }}
{{ $c['label'] }}
Where you should be by each week (guide) against where you actually are.
@php $rows = $weekly; $n = max(1, count($rows)); $W = 680; $H = 250; $pl = 36; $pr = 44; $pt = 16; $pb = 34; $iw = $W - $pl - $pr; $ih = $H - $pt - $pb; $xf = fn ($frac) => round($pl + $iw * $frac, 1); $yf = fn ($pct) => round($pt + $ih * (1 - min(100, max(0, $pct)) / 100), 1); // Recommended (target) trajectory: 0 → 100 across the plan. $recPts = [$xf(0) . ',' . $yf(0)]; foreach ($rows as $i => $r) { $recPts[] = $xf(($i + 1) / $n) . ',' . $yf($r['target']); } // Actual trajectory: only up to the current week (future weeks unknown). $actPts = [$xf(0) . ',' . $yf(0)]; $lastAct = null; foreach ($rows as $i => $r) { if (in_array($r['status'], ['completed', 'behind', 'current'], true)) { $x = $xf(($i + 1) / $n); $y = $yf($r['actual_pct']); $actPts[] = $x . ',' . $y; $lastAct = ['x' => $x, 'y' => $y, 'pct' => $r['actual_pct']]; } } $todayFrac = $pace['expected_pct'] === null ? null : $pace['expected_pct'] / 100; @endphp {{-- legend --}}Target milestones and the study time to hit them.
| {{ $view === 'weekly' ? 'Week' : 'Month' }} | Target | Recommended CPD | Actual CPD | Status |
|---|---|---|---|---|
|
{{ $r['label'] }} {{ $r['range'] }} |
|
{{ $fmt($r['rec_minutes']) }} | {{ $r['actual_minutes'] > 0 ? $fmt($r['actual_minutes']) : '—' }} | {{ $sm['icon'] }}{{ $sm['label'] }} |
| No schedule available. | ||||