@extends('partials.app') @section('content')
{{-- Print Action --}}
{{-- Branded Header --}}
SMS
Central Lab

{{ $trainingProgram->name }}

{{-- Header Table --}}
Employee Name: {{ $user->name }} EMP Code: {{ $user->emp_code ?? ($user->corporate_id ?? '________') }}
Department: {{ $user->department->name ?? '________' }} Designation: {{ $user->designation->name ?? '________' }}
{{-- Loop through the Steps of the Training --}} @foreach ($trainingProgram->steps as $step) @php // Check if user has completed this specific step $log = $userLogs->where('id', $step->id)->first(); @endphp
Department {{ $step->step_number }}: {{ $step->name }}

Name of the Interacted Person: {{ $log ? $log->pivot->interacted_person : '___________________________' }}

Designation: {{ $log ? $log->pivot->designation : '___________________________' }}

Comments:

{{ $log ? $log->pivot->comments : '' }}
{{-- Contacted Person: left blank for now, to be populated later --}}

Contacted Person: {{ $contactedPerson ?? '___________________________' }}

@if ($log) Sign & Date: {{ \Carbon\Carbon::parse($log->pivot->completed_at)->format('d-M-Y H:i') }} @endif
@endforeach
@endsection