@extends('partials.app') @section('title', 'View Training') @php $statusMap = [ 'created' => ['label' => 'Created', 'class' => 'badge-dark'], 'inreview' => ['label' => 'In Review', 'class' => 'badge-warning'], 'reviewed' => ['label' => 'Reviewed', 'class' => 'badge-info'], 'approved' => ['label' => 'Approved', 'class' => 'badge-success'], ]; $statusMeta = $statusMap[$training->status ?? 'created'] ?? $statusMap['created']; @endphp @section('content')
Training overview

{{ $training->name }}

This view brings together the workflow status, assigned trainers, enrolled trainee users, steps, and linked training documents in one place.

Program Summary

{{ $statusMeta['label'] }}
Training Type
{{ ucwords(str_replace('_', ' ', $training->training_type ?? 'classroom')) }}
Workflow Status
{{ $statusMeta['label'] }}
Start Date
{{ $training->start_date ? \Illuminate\Support\Carbon::parse($training->start_date)->format('d M Y') : 'N/A' }}
End Date
{{ $training->end_date ? \Illuminate\Support\Carbon::parse($training->end_date)->format('d M Y') : 'N/A' }}

Steps
@forelse($training->steps as $step)
{{ $step->step_number }}{{ $step->name }}
{{ $statusMeta['label'] }}
@empty
No steps defined yet.
@endforelse

Quick Actions

@if ($training->isExpired()) Edit training @else Edit training @endif Manage trainers Manage trainees Manage documents

Assigned Trainers

@forelse($training->trainers as $trainer)
{{ $trainer->name }}
{{ $trainer->email }}
{{ $trainer->designation->name ?? 'No designation' }}
@empty
No trainers assigned.
@endforelse

Enrolled Trainees

@forelse($training->trainees as $trainee)
{{ $trainee->name }}
{{ $trainee->email }}
{{ $trainee->department->name ?? 'No department' }}
{{ $trainee->designation->name ?? 'No designation' }}
@empty
No trainee users assigned.
@endforelse

Training Documents

@forelse($training->documents as $doc) @empty @endforelse
Document Name Question Quota
{{ $doc->doc_name }} {{ $doc->pivot->question_quota }}
No training documents linked.
@endsection