Here are the aircraft that were available overnight, what was serviced and what was
missed, deferred, or has no schedules.
@if (isset($data['snapshot']))
@foreach ($data['snapshot'] as $item)
@if (isset($data['schedules'][$item['registration']]))
-
@php
$arrival = now()->parse($item['scheduled_on'])->tz('America/Chicago');
$departure = null;
$noSchedules = false;
if (isset($data['departures'][$item['departure_id']]['scheduled_out'])) {
$departure = now()->parse($data['departures'][$item['departure_id']]['scheduled_out'])->tz('America/Chicago');
$diff = $departure->diffInHours($arrival);
}
if (empty($data['schedules'][$item['registration']]['schedules'])) {
$noSchedules = true;
} else {
$serviced = $data['serviced']->where('tail_number_id', $data['schedules'][$item['registration']]['schedules'][0]['tail_number_id'])->keyBy('task_id');
}
@endphp
Operator |
Tail # |
Reg |
Arrival |
Departure |
Ground |
{{ $item['operator'] }} |
{{ $data['schedules'][$item['registration']]['tail_number'] ?? 'NA' }} |
{{ $item['registration'] }} |
{{ $arrival->format('m/d H:i') ?? '-' }} |
{{ (is_null($departure)) ? '-' : $departure->format('m/d H:i') }} |
{{ $diff ?? '-' }} hrs |
@if ($serviced)
@foreach ($serviced as $entry)
@if ($entry->utp_reason > 0)
-
@else
-
@endif
{{ $data['tasks'][$entry['task_id']]['group_title'] ?? $entry['task_id'] }}: {{ $data['tasks'][$entry['task_id']]['title']?? 'NA' }} serviced {{ $entry['start'] }}
@endforeach
@endif
@foreach ($data['schedules'][$item['registration']]['schedules'] as $schedule)
@if (isset($data['tasks'][$schedule['task_id']]))
-
{{ $data['tasks'][$schedule['task_id']]['group_title'] }}: {{ $data['tasks'][$schedule['task_id']]['title'] }} due {{ $schedule['date'] }}
@endif
@endforeach
@if ($noSchedules === true)
-
No schedules available for aircraft.
@endif
@else
-
{{ $item['operator'] }} {{ $item['registration'] }} scheduled on {{ now()->parse($item['scheduled_on'])->tz('America/Chicago')->format('m/d H:i') }}
- Registration number not matched to fleet.
@endif
@endforeach
@endif