@extends('layouts.training_centre_layout') @section('content') @php function statusBadge($status) { return match($status) { 'approved' => 'bg-success-subtle text-success-emphasis', 'approved_with_conditions' => 'bg-info-subtle text-info-emphasis', 'rejected' => 'bg-danger-subtle text-danger-emphasis', 'requires_re_inspection' => 'bg-warning-subtle text-warning-emphasis', default => 'bg-secondary-subtle text-secondary-emphasis' }; } function statusLabel($status) { return str_replace('_', ' ', strtoupper($status)); } @endphp
@if ($inspectionDetails->count() > 0) @foreach ($inspectionDetails as $details) @php $yearStart = \Carbon\Carbon::parse($details->inspection_date)->year; $yearEnd = $yearStart + 1; @endphp

Inspection Year

{{ $yearStart }} - {{ $yearEnd }}
{{ statusLabel($details->overall_status) }}
Details
Date {{ \Carbon\Carbon::parse($details->inspection_date)->format('d-M-Y') }}
Inspector {{ $details->inspector_name }}
Result {{ statusLabel($details->overall_status) }}
@if ($details->final_remarks)
Inspector Remark
{{ $details->final_remarks }}
@endif @if ($details->recommendations)
Recommendation
{{ $details->recommendations }}
@endif
@endforeach @endif
@endsection @section('pages-scripts') @endsection