@php $operationCoaches = $sgrTrainOperation->coachInspections->sortBy('position')->values(); $coachIndex = $operationCoaches->search(fn ($coach) => $coach->id === $sgrCoachInspection->id); $previousCoach = $coachIndex !== false && $coachIndex > 0 ? $operationCoaches[$coachIndex - 1] : null; $nextCoach = $coachIndex !== false && $coachIndex < $operationCoaches->count() - 1 ? $operationCoaches[$coachIndex + 1] : null; $isLocked = $sgrTrainOperation->status === 'Submitted'; $items = $sgrCoachInspection->items->keyBy('activity_label'); $valueFor = fn ($label) => old("checklist_data.{$label}", $items->get($label)?->value ?? ''); $checklistGroups = [ 'Cleaning and disinfection' => [ 'Hand Wash Soap Provision' => ['Provided', 'Not Provided'], 'Interleave Tissue / Hand Paper Towel Provision' => ['Provided', 'Not Provided'], 'Inside Window Cleaning' => ['Cleaned', 'Not Cleaned'], 'Floor Cleaning' => ['Cleaned', 'Not Cleaned'], 'Seats Cleaning' => ['Cleaned', 'Not Cleaned'], 'Seat Covers Cleaning (Setti Clean)' => ['Cleaned', 'Not Cleaned'], 'Vacuum Cleaning' => ['Cleaned', 'Not Cleaned'], 'Tables Cleaning' => ['Cleaned', 'Not Cleaned'], 'Application of Certified Detergents' => ['Applied', 'Not Applied'], 'Window Glass Cleaning' => ['Cleaned', 'Not Cleaned'], 'Door Rubber Cleaning' => ['Cleaned', 'Not Cleaned'], 'Diaphragm Cleaning' => ['Cleaned', 'Not Cleaned'], 'Luggage Carrier Cleaned' => ['Cleaned', 'Not Cleaned'], 'AC Poles Cleaned' => ['Cleaned', 'Not Cleaned'], ], 'Sanitary bins and solid waste' => [ 'Sanitary Bin Provision' => ['Provided', 'Not Provided'], 'Sanitary Bin Emptied' => ['Emptied', 'Not Emptied'], 'Sanitary Bin Cleaned' => ['Cleaned', 'Not Cleaned'], 'Plastic Bags Provision' => ['Provided', 'Not Provided'], 'External Cleaning of Coaches' => ['Cleaned', 'Not Cleaned'], ], 'Decantation' => [ 'Decantation of Coaches' => ['Decanted', 'Not Decanted'], 'Flashing of Decanted Tanks' => ['Flashed', 'Not Flashed'], 'Cleanliness of Storage Tank Exterior' => ['Cleaned', 'Not Cleaned'], ], ]; @endphp
← Back to coaches

SGR coach cleaning · Coach inspection

Coach {{ $sgrCoachInspection->coach_number }}

Train {{ $sgrTrainOperation->train_number }} Position {{ str_pad((string) $sgrCoachInspection->position, 2, '0', STR_PAD_LEFT) }} {{ $sgrTrainOperation->station?->name ?? $branch->name }} {{ $dailyControl->date->format('d M Y') }}

{{ $isLocked ? 'Submitted · read only' : 'Draft · editing allowed' }} {{ $sgrCoachInspection->inspection_status }}
@csrf @error('inspection') @enderror

Section 1

Cleaning checklist

Record the observed result for each legacy checklist item using its listed responses.

{{ $items->count() }} / 22 recorded
@error('checklist_data')

{{ $message }}

@enderror
@foreach($checklistGroups as $groupTitle => $groupItems)

{{ $groupTitle }}

@foreach($groupItems as $label => $options)
{{ $label }}
@foreach($options as $option) @endforeach
@error('checklist_data.'.$label)

{{ $message }}

@enderror
@endforeach
@endforeach

Section 2

Water levels

Record litres for each tank at arrival and departure.

@foreach([ 'Arrival' => ['water_arrival_p' => ['label' => 'Tank A (P)', 'value' => $sgrCoachInspection->water_arrival_p], 'water_arrival_t' => ['label' => 'Tank B (T)', 'value' => $sgrCoachInspection->water_arrival_t]], 'Departure' => ['water_departure_p' => ['label' => 'Tank A (P)', 'value' => $sgrCoachInspection->water_departure_p], 'water_departure_t' => ['label' => 'Tank B (T)', 'value' => $sgrCoachInspection->water_departure_t]], ] as $phase => $fields)
{{ $phase }} @foreach($fields as $name => $field)
L
@error($name)

{{ $message }}

@enderror
@endforeach
@endforeach

Section 3

Findings and comments

@error('inspection_status')

{{ $message }}

@enderror
@error('remarks')

{{ $message }}

@enderror

Section 4

Photo evidence

Attach a photo when it helps document a finding. Optional.

@if($sgrCoachInspection->photo_path)
Inspection evidence for coach {{ $sgrCoachInspection->coach_number }}
Current inspection evidence
@endif @if(! $isLocked)

Image files up to 5 MB.

@error('photo')

{{ $message }}

@enderror @endif
@if(! $isLocked)
Back to coaches
@else
This operation has been submitted. Inspection details are locked and read-only.
@endif
@if(! $isLocked) @endif