@extends('layout.master') @push('plugin-styles') @endpush @section('content') @php use Carbon\Carbon; @endphp

{{ $schedule_type }} Schedule Report

@if($selected_date) Showing results for: {{ Carbon::parse($selected_date)->format('d F Y') }} @endif
Logo
Report Type: {{ ucfirst($schedule_type) }}
Report Date: {{ now()->format('d M Y H:i') }}
Prepared By: {{ Auth::user()->name ?? 'System' }}
@if(!$selected_date)
Filter by Date
@foreach($scheduleItems->groupBy(function($item) { return $item->created_at->format('Y-m-d'); }) as $date => $items) {{ Carbon::parse($date)->format('d M Y') }} ({{ $items->count() }}) @endforeach
@endif

Crane Details

Crane ID: {{ $crane->company_name }}{{ $crane->serial_no }}

Manufacturer: {{ $crane->manufacturer }}

Model: {{ $crane->model }}

Serial No: {{ $crane->serial_no }}

Location: {{ $crane->platform }}

SWL: {{ $crane->swl }}

Last Inspection: {{ $crane->last_inspection_date ? Carbon::parse($crane->last_inspection_date)->format('d M Y') : 'N/A' }}

Next Inspection: {{ $crane->next_inspection_date ? Carbon::parse($crane->next_inspection_date)->format('d M Y') : 'N/A' }}

@if($scheduleItems->count() > 0) @php $groupedItems = $scheduleItems->groupBy('section'); @endphp @foreach($groupedItems as $section => $items) @php $sectionData = [ 'B' => ['icon' => 'fas fa-gears', 'title' => 'Component'], 'C' => ['icon' => 'fas fa-bolt', 'title' => 'Primary '], 'D' => ['icon' => 'fas fa-shield-alt', 'title' => 'Sub Primary '], 'E' => ['icon' => 'fas fa-tachometer-alt', 'title' => 'Secondary '] ][$section] ?? ['icon' => 'fas fa-cog', 'title' => 'Section']; @endphp
Section {{ strtoupper($section) }} - {{ $sectionData['title'] }}
@foreach($items as $item) @endforeach
# Name Activity Pre-Condition Post-Condition Status Remarks Attachment Date
{{ $loop->iteration }} {{ $item->item_name }} {{ $item->activity }} @if($item->pre_condition === 'N/A') N/A @else {{ ucfirst($item->pre_condition) }} @endif @if($item->post_condition === 'N/A') N/A @else {{ ucfirst($item->post_condition) }} @endif @php $statusClass = [ 'P1' => 'badge-P1', 'P2' => 'badge-P2', 'P3' => 'badge-P3', 'N/A' => 'badge-NA' ][$item->status] ?? 'badge-secondary'; @endphp {{ $item->status }} {{ $item->remark ? Str::limit($item->remark, 50) : '-' }} @if($item->file_path) View @else - @endif {{ $item->created_at->format('d M Y') }}
@endforeach

Summary Statistics

Total Items

{{ $scheduleItems->count() }}

P1 (Good)

{{ $scheduleItems->where('status', 'P1')->count() }}

P2 (Fair)

{{ $scheduleItems->where('status', 'P2')->count() }}

P3 (Bad)

{{ $scheduleItems->where('status', 'P3')->count() }}

@else
@if($selected_date) No maintenance items found for {{ $schedule_type }} schedule on {{ Carbon::parse($selected_date)->format('d M Y') }}. @else No maintenance items found for this {{ $schedule_type }} schedule. @endif
@endif
Download PDF Export Excel @if($selected_date) Show All Dates @endif
@endsection @section('scripts') @endsection