@php $logoPath = public_path('assets/images/logo.png'); @endphp @if(file_exists($logoPath)) Logo @else
Company Logo
@endif

{{ strtoupper($display_type) }} MAINTENANCE SCHEDULE REPORT

Crane: {{ $crane->company_name }} {{ $crane->serial_no }} | Report Date: {{ now()->format('d M Y') }}

Crane Information
Crane ID: {{ $crane->company_name }} {{ $crane->serial_no }}
Model: {{ $crane->model ?? 'N/A' }}
Platform: {{ $crane->platform ?? 'N/A' }}
Manufacturer: {{ $crane->manufacturer ?? 'N/A' }}
Tag No: {{ $crane->tag_no ?? 'N/A' }}
SWL: {{ $crane->swl ?? 'N/A' }}
Maintenance Checklist
@php $groupedItems = $scheduleItems->groupBy('section'); $summary = [ 'total_items' => count($scheduleItems), 'completed' => 0, 'pending' => 0, 'sections' => [] ]; @endphp @foreach($sections as $sectionCode => $sectionData) @if(isset($groupedItems[$sectionCode]) && $groupedItems[$sectionCode]->count() > 0) @php $sectionItems = $groupedItems[$sectionCode]; $sectionCompleted = $sectionItems->where('status', 'Completed')->count(); $sectionPending = $sectionItems->where('status', 'Pending')->count(); $summary['completed'] += $sectionCompleted; $summary['pending'] += $sectionPending; $summary['sections'][$sectionCode] = [ 'total' => count($sectionItems), 'completed' => $sectionCompleted ]; @endphp
Section {{ $sectionCode }}: {{ $sectionData['title'] }} Completion: {{ round(($sectionCompleted/count($sectionItems))*100) }}%
@foreach($sectionItems as $index => $item) @endforeach
No Component Activity Pre-Condition Post-Condition Status Remarks
{{ $index + 1 }} {{ $item->item_name ?? 'N/A' }} {{ $item->activity ?? 'N/A' }} {{ $item->pre_condition ?? 'N/A' }} {{ $item->post_condition ?? 'N/A' }} {{ $item->status ?? 'Pending' }} {{ $item->remark ?? '-' }}
@endif @endforeach @if($summary['total_items'] == 0)
No maintenance items found for this schedule
@endif
@php $itemsWithImages = $scheduleItems->filter(function($item) { return !empty($item->file_path); })->groupBy('section'); @endphp @if($itemsWithImages->isNotEmpty())
Attached Images/Remarks by Section
@foreach($sections as $sectionCode => $sectionData) @if(isset($itemsWithImages[$sectionCode]) && $itemsWithImages[$sectionCode]->count() > 0)
Section {{ $sectionCode }}: {{ $sectionData['title'] }}
@foreach($itemsWithImages[$sectionCode] as $item) @if($item->file_path) @php $absolutePath = storage_path('app/public/' . $item->file_path); @endphp

@if(file_exists($absolutePath)) Maintenance Image @else
Image file not found at: {{ $item->file_path }}
@endif
Remarks: {{ $item->remark ?? 'No remarks' }}
Status: {{ $item->status ?? 'Pending' }}
Date: {{ $item->created_at->format('d M Y') }}
@endif @endforeach
@endif @endforeach
@else
Attached Images/Remarks
No images attached to this maintenance report
@endif

Inspected By:


_________________________

Name/Signature/Date

Verified By:


_________________________

Name/Signature/Date

This is a computer generated report. No signature is required.

Report generated on: {{ now()->format('d M Y H:i:s') }}