{{-- resources/views/probation/training/index.blade.php — course list + training calendar (5.4) --}} @extends('layouts.app') @section('title', 'Staff Training - ICMIS') @push('styles') @endpush @section('content')

{{ request('audience') === 'crtc' ? 'Community Resource & Training Centre' : 'Training' }}

Trainers @can('probation.training.add') New Course@endcan
@if($view === 'calendar') @php $palette = ['#2c7be5', '#16a085', '#8e44ad', '#d35400', '#c0392b', '#2c3e50', '#27ae60', '#e67e22']; $prev = $month->copy()->subMonthNoOverflow()->format('Y-m'); $next = $month->copy()->addMonthNoOverflow()->format('Y-m'); @endphp
{{ $month->format('F Y') }}
@foreach(['Mon','Tue','Wed','Thu','Fri','Sat','Sun'] as $d)@endforeach @for($day = $start->copy(); $day->lte($end); $day->addWeek()) @for($i = 0; $i < 7; $i++) @php $cur = $day->copy()->addDays($i); @endphp @endfor @endfor
{{ $d }}
{{ $cur->day }}
@foreach($courses as $c) @if($c->starts_on && $cur->between($c->starts_on->copy()->startOfDay(), ($c->ends_on ?? $c->starts_on)->copy()->endOfDay())) {{ $c->title }} @endif @endforeach
@php $overlaps = collect(); foreach ($courses as $a) foreach ($courses as $b) if ($a->id < $b->id && $a->starts_on && $b->starts_on && $a->starts_on->lte($b->ends_on ?? $b->starts_on) && $b->starts_on->lte($a->ends_on ?? $a->starts_on)) $overlaps->push($a->title . ' ↔ ' . $b->title); @endphp @if($overlaps->count())
Overlapping courses this month: {{ $overlaps->implode('; ') }}
@endif
@else
@forelse($courses as $c) @empty@endforelse
TitleTrainerMode / VenueDatesApplicationsEnrolled
{{ $c->title }}@if($c->target_cadre)
{{ $c->target_cadre }}@endif
{{ $c->trainer_label ?? '—' }} {{ \App\Models\TrainingCourse::MODES[$c->mode] ?? '—' }}@if($c->venue)
{{ $c->venue }}@endif
{{ optional($c->starts_on)->format('d M Y') }} – {{ optional($c->ends_on)->format('d M Y') }} {{ $c->applications_count }} {{ $c->enrolled_count }}@if($c->capacity) / {{ $c->capacity }}@endif
No courses yet.
{{ $courses->links() }}
@endif
@endsection