@extends('layouts.app') @section('content')
{{-- HEADER --}}

👋 {{ $user->name }}

Training Type: {{ $user->training_type ?? 'N/A' }}

Center: {{ $center?->name ?? 'N/A' }} County: {{ $user->county?->name ?? 'N/A' }} Class: {{ $classroom?->class_number ?? 'N/A' }}
Trainee
Assigned Trainer:
{{ $trainer->name ?? 'Not Assigned' }}
{{ $trainer->phone ?? '' }}
{{-- SUMMARY CARDS --}}
@php $summary = [ ['icon'=>'bi-clock-fill','label'=>'Attendance Rate','value'=>$attendanceRate ?? 0,'suffix'=>'%','note'=>'This week','color'=>'bg-light-green'], ['icon'=>'bi-book','label'=>'Modules','value'=>"$modulesCompleted/$totalModules",'note'=>'Overall progress','color'=>'bg-nyota-red'], ['icon'=>'bi-star-fill','label'=>'Performance','value'=>$averageScore ?? 0,'suffix'=>'%','note'=>'Avg assessments','color'=>'bg-nyota-black'], ['icon'=>'bi-wallet2','label'=>'Payments','value'=>"KSh ".number_format($amountPaid ?? 0, 2),'note'=>"Due: KSh ".number_format($amountDue ?? 0, 2),'color'=>'bg-nyota-olive'], ]; @endphp @foreach($summary as $card)
{{ $card['label'] }}
{{ $card['value'] }}{{ $card['suffix'] ?? '' }}
{{ $card['note'] }}
@endforeach
{{-- MINI CARDS + SAVINGS --}}
@php $mini = [ ['icon'=>'bi-person-check-fill','title'=>'Present','value'=>$totalPresent ?? 0,'color'=>'success'], ['icon'=>'bi-person-dash-fill','title'=>'Absent','value'=>$totalAbsent ?? 0,'color'=>'danger'], ['icon'=>'bi-alarm-fill','title'=>'Late','value'=>$totalLate ?? 0,'color'=>'warning text-dark'], ]; @endphp @foreach($mini as $m)
{{ $m['title'] }}
{{ $m['value'] }}
@endforeach {{-- SAVINGS --}}
Nyota Savings
KSh {{ number_format($userSavings ?? 0, 2) }}
Target: KSh {{ number_format($savingsTarget ?? 0, 2) }} ({{ $savingsPercent ?? 0 }}%)
{{-- CHARTS + MODULES --}}
Weekly Attendance
Module Progress
@forelse($modules as $module)
{{ $module['name'] }} {{ $module['progress'] }}%
@empty

No module progress data available.

@endforelse
{{-- ACTIVITIES + MENTORSHIP --}}
{{-- My Activities --}}
My Activities
@if($activities->isEmpty())

No activities recorded yet.

@else
    @foreach($activities as $activity)
  • {{ $activity->name ?? 'N/A' }}
    {{ Str::limit($activity->description ?? '', 50) }}
    {{ ucfirst(str_replace('_', ' ', $activity->pivot->status ?? 'N/A')) }} @if(isset($activity->pivot->score))
    Score: {{ $activity->pivot->score }}%
    @endif
  • @endforeach
@endif
{{-- Mentorship Activities --}}
My Mentorship Activities
@if($mentorshipActivities->isEmpty())

No mentorship activities recorded yet.

@else
    @foreach($mentorshipActivities as $activity)
  • {{ $activity->mentor->name ?? 'N/A' }} • {{ \Carbon\Carbon::parse($activity->date)->format('d M Y') }}
    {{ Str::limit($activity->discussion_points, 50) }}
  • @endforeach
@endif
{{-- PERFORMANCE & ASSIGNMENTS --}}
Performance & Assessments
@forelse($progressRecords as $row) @empty @endforelse
Module Score Grade Trainer Remark
{{ $row->module_title }} {{ $row->score ?? '0' }}% {{ $row->grade ?? 'N/A' }} {{ $row->comments ?? '-' }}
No performance records
{{-- Recent Assignments --}}
Recent Assignments
    @forelse($recentAssignments as $assignment)
  • {{ $assignment->classRoom?->class_number ?? 'Class ' . ($assignment->class_room_id ?? 'N/A') }}
    {{ $assignment->center?->name ?? 'N/A' }} • {{ \Carbon\Carbon::parse($assignment->start_date)->format('d M Y') }}
    KSh {{ number_format($assignment->total_amount ?? 0, 2) }}
  • @empty
  • No recent assignments
  • @endforelse
{{-- Recent Attendance --}}
Recent Attendance
    @forelse($attendances as $rec)
  • {{ \Carbon\Carbon::parse($rec->attendance_date)->format('d M Y') }} • {{ $rec->classRoom?->class_number ?? 'N/A' }}
    {{ $rec->classRoom?->center?->name ?? 'N/A' }}
    {{ ucfirst($rec->status ?? 'N/A') }}
  • @empty
  • No recent attendance
  • @endforelse
{{-- CAREER READINESS --}}
Career Readiness
@forelse($careerItems as $item)
{{ $item['name'] }} @if($item['status'] == 'done') Completed @elseif($item['status'] == 'progress') In Progress @else Pending @endif
@empty

No career readiness items available.

@endforelse
@endsection @push('scripts') @endpush