@extends('layouts.app') @section('title', $training->title) @section('page-title','Training & Development') @section('content')
Program Info
@php $info = [ ['Type', ucfirst($training->type)], ['Start Date', \Carbon\Carbon::parse($training->start_date)->format('M j, Y')], ['End Date', \Carbon\Carbon::parse($training->end_date)->format('M j, Y')], ['Location', $training->location], ['Facilitator', $training->facilitator], ['Provider', $training->provider], ['Max Slots', $training->max_participants ? $training->max_participants.' participants' : 'No limit'], ['Cost', $training->cost ? '$'.number_format($training->cost,2) : 'Free'], ['Created By', $training->creator->name ?? '—'], ]; @endphp @foreach($info as [$label, $value]) @if($value)
{{ $label }} {{ $value }}
@endif @endforeach @if($training->description)
Description
{{ $training->description }}
@endif
{{-- Enrolled participants --}}
Participants ({{ $training->participants->count() }}) @if(auth()->user()->isHrOrAdmin() && $available->count()) @endif
@if($training->participants->count())
@if(auth()->user()->isHrOrAdmin() && $training->status === 'completed')@endif @foreach($training->participants as $p) @if(auth()->user()->isHrOrAdmin() && $training->status === 'completed') @endif @endforeach
Employee Department Status ScoreAction
{{ strtoupper(substr($p->first_name??'?',0,1)) }}
{{ $p->full_name }}
{{ $p->department->name ?? '—' }} {{ ucfirst($p->pivot->status) }} @if($p->pivot->certificate_issued) Certificate @endif {{ $p->pivot->score ? $p->pivot->score.'%' : '—' }} @if($p->pivot->status !== 'completed')
@csrf
@else Completed @endif
@else
No participants enrolled yet.
@endif
{{-- Enroll Modal --}} @if(auth()->user()->isHrOrAdmin() && $available->count()) @endif @endsection