@extends('layouts.app') @section('title', 'Training Details') @section('content')

{{ $training->training_code }} {{ $training->status }} @if($training->completion_override) Override @endif

@if($training->canBeEdited()) Edit @endif Back
@include('training.partials.alerts')
{{-- Details --}}
Training Details
Employee:{{ $training->employee?->name }}
Topic:{{ $training->topic?->topic_name }}
Category:{{ $training->topic?->category?->category_name ?? '—' }}
Curriculum:{{ $training->curriculum?->curriculum_name ?? '—' }}
Requirement: @if($training->requirement) {{ $training->requirement->requirement_code }} @else — @endif
Source Document:{{ $training->document?->document_title ?? '—' }}
Trainer:{{ $training->trainer?->name ?? '—' }}
Due Date: {{ $training->due_date?->format('M d, Y') }} @if($training->is_overdue) {{ $training->days_overdue }}d overdue @endif
Training Date:{{ $training->training_date?->format('M d, Y') ?? '—' }}
Delivery:{{ $training->delivery_mode }} @if($training->delivery_location) — {{ $training->delivery_location }}@endif @if($training->delivery_platform) — {{ $training->delivery_platform }}@endif
Assignment:{{ $training->assignment_method }}
Started:{{ $training->started_at?->format('M d, Y g:i A') ?? '—' }}
Completed:{{ $training->completed_at?->format('M d, Y g:i A') ?? '—' }}
Score: @if($training->effectiveness_score !== null) {{ $training->effectiveness_score }}% @else — @endif
{{-- Completion Gate + Action (LMS-008) --}}
Completion Gate (LMS-008)

Required Method: {{ $completionCheck['method'] }}

@if($completionCheck['satisfied'])
Completion requirements satisfied.
@else
Not yet satisfied: {{ $completionCheck['reason'] }}
@endif {{-- Best quiz result --}} @if($bestQuiz)

Best quiz attempt: {{ $bestQuiz->score }}% (attempt #{{ $bestQuiz->attempt_number }})

@endif
{{-- State Transitions --}}
Actions
{{-- Start --}} @if(in_array($training->status, ['Draft', 'Scheduled']))
@csrf
@endif {{-- Complete (gated) --}} @if($training->canBeCompleted())
Mark as Complete
@csrf
@if($completionCheck['satisfied']) @else {{-- Override flow --}}
@if(! $completionCheck['satisfied'] && $completionCheck['method'] === 'ACKNOWLEDGEMENT') Sign Acknowledgement Instead @endif @endif
@endif {{-- Cancel --}} @if(!in_array($training->status, ['Completed', 'Cancelled']))
@csrf
@endif
{{-- Certificate --}} @if($training->certificate_issued)
Certificate Issued

Number: {{ $training->certificate_number }}

Issued: {{ $training->certificate_date?->format('M d, Y') }}

@if($training->certificate_expiry)

Expires: {{ $training->certificate_expiry->format('M d, Y') }} @if($training->is_certificate_valid) Valid @elseif($training->certificate_expiry->isPast()) Expired @endif

@endif
@endif
{{-- Audit --}}
Audit Trail
@include('training.partials.audit-timeline', ['logs' => $auditLogs])
@endsection