@extends('partials.app') @section('title', $user->name . ' Profile') @section('content')

{{ $user->name }}

@if($user->is_trainer) Trainer Enabled @else Learner Profile @endif

{{ $user->designation->name ?? 'Designation not assigned' }}

Roles
{{ $stats['roles'] }}
Assigned access groups
Trainings
{{ $stats['trainings'] }}
Mapped modules
Passed Exams
{{ $stats['passed_exams'] }}
Recent successful attempts
Failed Exams
{{ $stats['failed_exams'] }}
Needs follow-up

Assigned Training Modules

Current training map and enrollment status.

@if($user->trainings->isNotEmpty())
@foreach($user->trainings as $training) @endforeach
Training Status Type
{{ $training->name }}
Module ID: {{ $training->id }}
@php $status = strtolower($training->pivot->status ?? 'enrolled'); $badgeClass = match ($status) { 'completed' => 'badge-success', 'pending' => 'badge-warning', 'in progress', 'in_progress' => 'badge-info', default => 'badge-primary', }; @endphp {{ ucfirst(str_replace('_', ' ', $status)) }} {{ $training->parent_id ? 'Step' : 'Program' }}
@else
No trainings assigned yet

Assign modules to start tracking this user's learning path.

@endif

Recent Exam Activity

Latest assessment outcomes for this user.

@if($examResults->isNotEmpty())
@foreach($examResults as $result)
{{ round($result->percentage) }}%
{{ $result->module->name ?? 'Module unavailable' }}
{{ $result->created_at->format('d M Y, h:i A') }}

{{ $result->correct_answers }} correct out of {{ $result->total_questions_attempted }} questions.

View Exam Details
@endforeach
@else
No exams attempted yet

Assessment results will appear here once the user completes an exam.

@endif

Profile Details

Corporate ID {{ $user->corporate_id ?? 'N/A' }}
System User ID {{ $user->user_id ?? 'N/A' }}
Internal ID {{ $user->internal_id ?? 'N/A' }}
Email Address {{ $user->email ?? 'N/A' }}
Department {{ $user->department->name ?? 'N/A' }}
Designation {{ $user->designation->name ?? 'N/A' }}
Qualification {{ $user->qualification ?? 'N/A' }}
Experience {{ filled($user->experience_years) ? $user->experience_years . ' years' : 'N/A' }}
Roles @forelse($user->getRoleNames() as $role) {{ $role }} @empty N/A @endforelse
Created On {{ $user->created_at->format('d M Y, h:i A') }}
Last Updated {{ $user->updated_at->format('d M Y, h:i A') }}

Quick Summary

Training-ready profile {{ $user->department_id && $user->designation_id ? 'Yes' : 'Pending setup' }}
Trainer access {{ $user->is_trainer ? 'Enabled' : 'Disabled' }}
Latest exam trend @if($examResults->isEmpty()) Not available @elseif($examResults->first()->is_passed) Passed @else Needs review @endif
@endsection