{{-- resources/views/probation/training/show.blade.php Course workspace: details (5.3) · applications & admission (5.1) · attendance & assessments (5.5) · materials register (5.6) · lecture library (5.7) · certificates (5.8) --}} @extends('layouts.app') @section('title', $course->title) @push('styles') @endpush @section('content') @php $statuses = \App\Models\TrainingEnrollment::STATUSES; $comp = \App\Models\TrainingEnrollment::COMPETENCY; $canEdit = \App\Helpers\PermissionHelper::hasPermission('probation.training.edit'); $canApprove = \App\Helpers\PermissionHelper::hasPermission('probation.training.approve'); $pending = $course->enrollments->whereIn('status', ['applied', 'reviewed']); @endphp

{{ $course->title }}

{{ optional($course->starts_on)->format('d M Y') }} – {{ optional($course->ends_on)->format('d M Y') }} · {{ $course->trainer_label ?? 'No trainer' }} · {{ \App\Models\TrainingCourse::MODES[$course->mode] ?? '' }} {{ $course->venue }}

@can('probation.training.edit') Edit@endcan Back
Applications

{{ $course->enrollments->count() }}

Awaiting decision

{{ $pending->count() }}

Enrolled (admitted)

{{ $admitted->count() }}@if($course->capacity) / {{ $course->capacity }}@endif

Completed / Passed

{{ $course->enrollments->where('status', 'completed')->count() }}

{{-- ============ DETAILS ============ --}}
Objectives
{{ $course->objectives ?? '—' }}
Target cadre / level
{{ $course->target_cadre ?? '—' }}
Duration
{{ $course->duration ?? '—' }}
Mode
{{ \App\Models\TrainingCourse::MODES[$course->mode] ?? '—' }}
Venue
{{ $course->venue ?? '—' }}
Capacity
{{ $course->capacity ?? '—' }}
Pass mark
{{ $course->pass_mark !== null ? $course->pass_mark . '%' : '50% (default)' }}
Prerequisites
{{ $course->prerequisites ?? '—' }}
Description
{{ $course->description ?? '—' }}
Trainer
@if($course->trainer)
{{ $course->trainer->name }}
{{ $course->trainer->institution }}
{{ $course->trainer->specialization }}
{{ $course->trainer->qualifications }}
{{ $course->trainer->contact }}
@else
{{ $course->trainer_name ?? 'Not assigned' }}
@endif
Your application
@if($me) {{ $statuses[$me->status] ?? $me->status }} @else

You have not applied for this course.

@endif
{{-- ============ APPLICATIONS (5.1) ============ --}}
Application form
@csrf
Pick a colleague to nominate them.
@forelse($course->enrollments->sortBy('status') as $e) @empty@endforelse
StaffPersonal No.StationCadreReasonStatusReviewed / ApprovedAction
{{ optional($e->user)->name }}
{{ $e->phone }}
{{ $e->personal_number ?? '—' }}{{ $e->station ?? '—' }}{{ $e->cadre ?? '—' }} {{ \Illuminate\Support\Str::limit($e->reason_for_nomination, 60) }} {{ $statuses[$e->status] ?? $e->status }} @if($e->reviewer)R: {{ $e->reviewer->name }}
@endif @if($e->approver)A: {{ $e->approver->name }}@endif @if($e->review_remarks)
{{ $e->review_remarks }}
@endif
@if($e->status === 'applied' && $canEdit)
@csrf
@endif @if(in_array($e->status, ['applied', 'reviewed']) && $canApprove)
@csrf
@elseif($e->status === 'reviewed') Awaiting supervisor approval @endif @if($e->status === 'admitted' && $canEdit)
@csrf
@endif
No applications yet.
{{-- ============ ATTENDANCE (5.5) ============ --}}
@if($canEdit)
@csrf
@endif @forelse($course->sessions as $ss)
@csrf
{{ $ss->title }} · {{ optional($ss->session_date)->format('d M Y') }} {{ $ss->attendance->where('present', true)->count() }} / {{ $admitted->count() }} present
@foreach($admitted as $e) @php $att = $ss->attendance->firstWhere('enrollment_id', $e->id); @endphp
@endforeach
@if($canEdit && $admitted->count())@endif
@empty

No sessions yet.

@endforelse
{{-- ============ ASSESSMENTS & RESULTS (5.5) ============ --}}
@if($canEdit)
@csrf
@endif @forelse($course->assessments as $a)
@csrf
{{ $a->title }} (max {{ rtrim(rtrim(number_format($a->max_score, 2), '0'), '.') }}) @if($a->file_path) · form@endif @if($a->instructions)
{{ $a->instructions }}
@endif
@foreach($admitted as $e) @php $sc = $a->scores->firstWhere('enrollment_id', $e->id); @endphp
{{ optional($e->user)->name }}
@endforeach
@if($canEdit && $admitted->count())@endif
@empty

No assessments yet.

@endforelse
@forelse($admitted as $e) @php $sg = $suggested[$e->id] ?? null; $present = $e->attendance->where('present', true)->count(); @endphp @empty@endforelse
ParticipantAttendanceAverage scoreCompetency statusRecord result
{{ optional($e->user)->name }} {{ $present }} / {{ $course->sessions->count() }} {{ $sg ? $sg['avg'] . '%' : '—' }} @if($sg){{ $sg['pass'] ? 'pass' : 'below pass mark' }}@endif {{ $comp[$e->competency_status] ?? '—' }} {{ $statuses[$e->status] ?? $e->status }} @if($canEdit)
@csrf
@endif
No admitted participants.
{{-- ============ MATERIALS REGISTER (5.6) ============ --}}
@if($canEdit)
@csrf
@endif @forelse($course->materials as $m)
{{ $m->title }} {{ str_replace('_', ' ', $m->material_type) }} @if($m->is_physical)physical · {{ $m->copies ?? '?' }} cop{{ ($m->copies ?? 0) == 1 ? 'y' : 'ies' }} · {{ $m->on_loan }} on loan@endif @if($m->file_path) · soft copy@endif
@if($m->is_physical) @forelse($m->issues as $is) @empty@endforelse
Issued toIssuedReturn dueReturnedStatus
{{ optional($is->user)->name }}{{ optional($is->issued_on)->format('d M Y') }}{{ optional($is->due_on)->format('d M Y') ?? '—' }} {{ optional($is->returned_on)->format('d M Y') ?? '—' }} {{ str_replace('_', ' ', $is->return_status) }} @if(!$is->returned_on && $canEdit)
@csrf
@endif
Not issued yet.
@if($canEdit)
@csrf
@endif @endif
@empty

No materials yet.

@endforelse
{{-- ============ LECTURE LIBRARY (5.7) ============ --}}
@if($canEdit)
@csrf
@endif @if(!$canMedia)
Recorded lectures are available only to staff enrolled on this course.
@else @forelse($course->media as $md)
{{ $md->title }} · {{ optional($md->session_date)->format('d M Y') }} · {{ optional($md->trainer)->name ?? '—' }} @if($md->duration_minutes)· {{ $md->duration_minutes }} min @endif
@if($canEdit)
@csrf @method('DELETE')
@endif
@if($md->external_url) Open on media server @elseif($md->media_type === 'audio') @else @endif
@empty

No recorded lectures yet.

@endforelse @endif
{{-- ============ CERTIFICATES (5.8) ============ --}}
@forelse($course->enrollments->where('status', 'completed') as $e) @empty@endforelse
ParticipantResultCertificate No.Verification code
{{ optional($e->user)->name }}{{ $comp[$e->competency_status] ?? '—' }} {{ $e->certificate_no ?? '—' }}{{ $e->verification_code ?? '—' }} @if($e->certificate_no) Open / PDF @elseif($canEdit)
@csrf
@endif
Certificates become available once a participant is Passed / Competent.
@endsection