@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'); $pesticidesUsed = old('pesticides', $items->get('Pesticides Used')?->value ?? ''); @endphp
← Back to coaches

Fumigation · 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 === 'Passed' ? 'Fumigated' : ($sgrCoachInspection->inspection_status === 'Failed' ? 'Not Fumigated' : 'Pending') }}
@csrf @error('inspection') @enderror

Section 1

Fumigation Details

Was this coach fumigated?
@error('inspection_status')

{{ $message }}

@enderror

Specify the chemicals or pesticides used for this coach.

@error('pesticides')

{{ $message }}

@enderror

Any notes, observations, or reasons why it was not fumigated.

@error('remarks')

{{ $message }}

@enderror

Section 2

Photo Evidence

@if($sgrCoachInspection->photo_path)

Current photo

Fumigation evidence for {{ $sgrCoachInspection->coach_number }}
@endif @if(! $isLocked)

Take a photo using the camera or upload an image. Max 5MB.

@error('photo')

{{ $message }}

@enderror @endif
@if(! $isLocked)
Cancel
@endif