@extends('layouts.app') @section('title', 'NDRT Surge Profile') @section('content')
@if(session('success'))
{{ session('success') }}
@endif
@if($ndrt->photo_path) {{ $ndrt->full_name }} @else
{{ substr($ndrt->first_name, 0, 1) }}{{ substr($ndrt->surname, 0, 1) }}
@endif

{{ $ndrt->full_name }}

{{ $ndrt->id_type }}: {{ $ndrt->id_number }}

@if($ndrt->available_for_deployment) Available for Deployment @else Not Available @endif
Quick Stats
Age: {{ $ndrt->age }} years
Gender: {{ $ndrt->gender }}
Blood Group: {{ $ndrt->blood_group ?? 'N/A' }}
Total Deployments: {{ $ndrt->deployment_count }}
Active Deployments: {{ $ndrt->active_deployments }}
Completed: {{ $ndrt->completed_deployments }}
Personal Information
Date of Birth:
{{ $ndrt->date_of_birth->format('d M Y') }}
Physical Address:
{{ $ndrt->physical_address ?? 'N/A' }}
Location
Location Type:
{{ $ndrt->location_type }}
Branch:
{{ $ndrt->branch->name ?? 'N/A' }}
Unit:
{{ $ndrt->unit ?? 'N/A' }}
Contact Details
Primary Phone:
{{ $ndrt->phone_1 }}
Secondary Phone:
{{ $ndrt->phone_2 ?? 'N/A' }}
Email:
{{ $ndrt->email ?? 'N/A' }}
Emergency Contact / Next of Kin
Name:
{{ $ndrt->emergency_contact_name }}
Relation:
{{ $ndrt->emergency_contact_relation }}
Primary Phone:
{{ $ndrt->emergency_contact_phone_1 }}
Secondary Phone:
{{ $ndrt->emergency_contact_phone_2 ?? 'N/A' }}
Address:
{{ $ndrt->emergency_contact_address ?? 'N/A' }}
Other Details
Languages Spoken:
@if($ndrt->languages_spoken) @foreach($ndrt->languages_spoken as $lang) {{ $lang }} @endforeach @else N/A @endif
Health Conditions:
{{ $ndrt->health_conditions ?? 'None reported' }}
Disability Status:
@if($ndrt->has_disability) Yes
{{ $ndrt->disability_details }} @else No @endif
Education
Education Level:
{{ $ndrt->education_level ?? 'N/A' }}
Area of Study:
{{ $ndrt->area_of_study ?? 'N/A' }}
@if($ndrt->work_experience)
Work Experience
@foreach($ndrt->work_experience as $exp)
{{ $exp['position'] ?? '' }} ({{ $exp['year'] ?? '' }})

Institution: {{ $exp['institution'] ?? '' }}

{{ $exp['description'] ?? '' }}

@endforeach
@endif @if($ndrt->competencies)
Competencies / Specializations
@foreach($ndrt->competencies as $comp) {{ $comp }} @endforeach
@endif
Training History
@php // Pull trainings where this officer's id is inside trainings.participants (JSON array) $jsonTrainings = \App\Models\Training::whereJsonContains('participants', (string) $ndrt->id)->orderByDesc('start_date')->get(); // Load existing grades $grades = \App\Models\TrainingGrading::where('ndrt_officer_id', $ndrt->id) ->whereIn('training_id', $jsonTrainings->pluck('id')) ->get() ->keyBy('training_id'); @endphp @if($jsonTrainings->count() > 0)
@foreach($jsonTrainings as $training) @php $existingGrade = $grades->get($training->id); @endphp @endforeach
Training Name Date Location Grade Actions
{{ $training->name }} {{ optional($training->start_date)->format('d M Y') }} {{ $training->location }} @if($existingGrade) @if($existingGrade->grade == '1-Needs further training') 1 - Needs further training @elseif($existingGrade->grade == '2-Deploy with Support') 2 - Deploy with Support @elseif($existingGrade->grade == '3-Strong') 3 - Strong @else {{ $existingGrade->grade }} @endif @else Not graded @endif
@else

No training records yet.

@endif
Deployment Months
@php $deployment_months = json_decode($ndrt->deployment_months ?? '[]', true); @endphp @if(count($deployment_months) > 0) @foreach($deployment_months as $month) {{ $month }} @endforeach @else

No deployment months yet.

@endif
Training Sector
{{ $ndrt->training_sector ?? 'N/A' }}
Deployment History
@if($ndrt->deployments->count() > 0)
@foreach($ndrt->deployments as $deployment) @endforeach
Mission Location Start Date End Date Status
{{ $deployment->mission_location }} {{ $deployment->start_date->format('d M Y') }} {{ $deployment->end_date->format('d M Y') }} @if($deployment->status == 'Active') Active @else Completed @endif
@else

No deployment records yet.

@endif
@if(isset($jsonTrainings) && $jsonTrainings->count() > 0) @foreach($jsonTrainings as $training) @php $existingGrade = isset($grades) ? $grades->get($training->id) : null; @endphp @endforeach @endif @endsection