@php $checklist = $inspection->inspection_checklist ?? []; $totalItems = 0; $passedItems = 0; $failedItems = 0; foreach($checklist as $section => $items) { if(is_array($items)) { foreach($items as $key => $value) { $totalItems++; $lowerValue = strtolower($value ?? ''); if(in_array($lowerValue, ['pass', 'good', 'excellent', 'satisfactory', 'yes'])) { $passedItems++; } elseif(in_array($lowerValue, ['fail', 'poor', 'unsatisfactory', 'no', 'damaged'])) { $failedItems++; } } } } $passRate = $totalItems > 0 ? round(($passedItems / $totalItems) * 100) : 0; @endphp @if($totalItems > 0)

Inspection Summary

{{ $totalItems }}
Total Items
{{ $passedItems }}
Passed
{{ $failedItems }}
Failed
{{ $passRate }}%
Pass Rate
@endif

Job Card Information

Job Card No: {{ $jobCard->job_card_number }}
Date Created: {{ $jobCard->created_at->format('d M Y') }}
Status: {{ ucwords(str_replace('_', ' ', $jobCard->status)) }}
Branch: {{ $jobCard->branch->name ?? 'N/A' }}

Customer Information

Name: {{ $jobCard->customer->name }}
Email: {{ $jobCard->customer->email }}
Phone: {{ $jobCard->customer->phone }}
Address: {{ $jobCard->customer->address ?: 'N/A' }}

Vehicle Information

Make & Model: {{ $jobCard->vehicle->make }} {{ $jobCard->vehicle->model }}
Year: {{ $jobCard->vehicle->year }}
License Plate: {{ $jobCard->vehicle->license_plate }}
VIN: {{ $jobCard->vehicle->vin ?: 'N/A' }}

Inspection Details

Type: {{ ucwords(str_replace('_', ' ', $inspection->inspection_type)) }}
Date: {{ $inspection->created_at->format('d M Y H:i') }}
Inspector: {{ $inspection->inspector->name ?? 'N/A' }}
Current Mileage: {{ number_format($inspection->current_mileage) }} km

Vehicle Condition

Fuel Level: {{ $inspection->fuel_level }}%
Overall Condition: {{ ucfirst($inspection->overall_condition ?? 'Good') }}
Cleanliness: {{ ucfirst($inspection->cleanliness_rating ?? 'Clean') }}
@if($inspection->quality_rating)
Quality Rating: {{ $inspection->quality_rating }}/10
@endif

Inspection Checklist

@php $checklist = $inspection->inspection_checklist ?? []; @endphp
@if(isset($checklist['documentation']))

📋 Documentation

@foreach($checklist['documentation'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif @if(isset($checklist['exterior']))

🚗 Exterior

@foreach($checklist['exterior'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif @if(isset($checklist['interior']))

🏠 Interior

@foreach($checklist['interior'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif @if(isset($checklist['engine']))

� Engine & Mechanical

@foreach($checklist['engine'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif @if(isset($checklist['under_hood']))

⚡ Under Hood

@foreach($checklist['under_hood'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif @if(isset($checklist['under_vehicle']))

🔍 Under Vehicle

@foreach($checklist['under_vehicle'] as $key => $value)
{{ ucwords(str_replace('_', ' ', $key)) }} {{ strtoupper($value ?: 'N/A') }}
@endforeach
@endif
@if($inspection->damage_diagram_data)

Vehicle Damage Report

@php $damageData = is_string($inspection->damage_diagram_data) ? json_decode($inspection->damage_diagram_data, true) : $inspection->damage_diagram_data; @endphp @if($damageData && is_array($damageData) && count($damageData) > 0)
@foreach($damageData as $index => $damage)
Damage {{ $index + 1 }}
Position: {{ $damage['x'] ?? 'N/A' }}, {{ $damage['y'] ?? 'N/A' }}
Type: {{ $damage['type'] ?? 'Unknown' }}
@endforeach
@else

No damage recorded during inspection.

@endif
@endif
Inspector Signature
{{ $inspection->inspector->name ?? 'N/A' }}
Date: {{ $inspection->created_at->format('d/m/Y') }}
Customer Signature
{{ $jobCard->customer->name }}
Date: ________________
Service Manager
Name: ________________
Date: ________________

This report was generated on {{ now()->format('d M Y \a\t H:i') }}

{{ app(\App\Settings\GeneralSettings::class)->shop_name ?? 'Car Repairs Shop' }} - Professional Vehicle Inspection Services

Report ID: {{ $inspection->id }} | Job Card: {{ $jobCard->job_card_number }}