@if ($sprMe) | @endif
@if ($flight->created_by_email)
@if ($flight->created_by_email == 1)
Auto created |
|
@else
Auto created by {{ $flight->created_by_email }} |
@if ($flight->email_id)
{{ getFlightMessageByType($flight->created_by_email, $flight->email_id) }} |
@endif
@endif
@elseif ($flight->flight_schedule_id)
Flight Created by Schedule Upload |
|
@else
Flight Created Manually |
|
@endif
{{ $flight->email_type ? $flight->email_type : getUserFullName($flight->created_by) }} |
{{ baseUSDateFormat($flight->created_at, true, "-", false, false, "m") }} |
@php $ignoreData = [] @endphp
@php $dataExists = false @endphp
@if (isset($flightsAudit['flight']))
@foreach($flightsAudit["flight"] as $i => $each)
@if ($sprMe) | {{ $each->id }} | @endif
@foreach($each->old_values as $prop => $val)
@if (array_key_exists($prop, $each->new_values) && $val == $each->new_values[$prop])
@php $ignoreData[] = $prop @endphp
@continue
@endif
@if ($prop == "aircraft_id")
AC: {{ getAircraftById($val) }}
@elseif ($prop == "aircraft_type_id")
AC Type: {{ getAircraftTypeById($val) }}
@elseif ($prop == "flight_number_id")
FLT No: {{ getFlightNumberById($val) }}
@elseif ($prop == "flight_schedule_id")
SCHEDULE: {{ isset($flightSchedules[$val]) ? $flightSchedules[$val] : "ID: {$val}" }}
@elseif ($prop == "flight_schedule_flight_id")
FLIGHT: {{ $val ? getFlightScheduleInfoById($val) : "Removed" }}
@else
@php $v = getAuditValue($prop, $val) @endphp
@if ($v || $v === 0)
{!! getAuditProp($prop) !!}{{ $v }}
@endif
{{-- {!! getAuditProp($prop, true) !!}{{ getAuditValue($prop, $val) }} --}}
@endif
@php $dataExists = true @endphp
@endforeach
{{ !$dataExists ? "-" : "" }}
|
@php $dataExists = false @endphp
@foreach($each->new_values as $prop => $val)
@if (in_array($prop, $ignoreData))
@continue
@elseif ($prop == "aircraft_id")
AC: {!! $val ? getAircraftById($val) : 'Removed' !!}
@elseif ($prop == "aircraft_type_id")
AC Type: {!! $val ? getAircraftTypeById($val) : 'Removed' !!}
@elseif ($prop == "flight_number_id")
FLT No: {!! $val ? getFlightNumberById($val) : 'Removed' !!}
@elseif ($prop == "flight_schedule_id")
SCHEDULE: {{ isset($flightSchedules[$val]) ? $flightSchedules[$val] : "ID: {$val}" }}
@elseif ($prop == "flight_schedule_flight_id")
FLIGHT: {!! $val ? getFlightScheduleInfoById($val) : 'Removed' !!}
@else
@php $v = getAuditValue($prop, $val) @endphp
@if ($v || $v === 0)
{!! getAuditProp($prop) !!}{{ $v }}
@endif
{{-- {!! getAuditProp($prop) !!}{{ getAuditValue($prop, $val, true) }} --}}
@endif
@php $dataExists = true @endphp
@endforeach
{{ !$dataExists ? "-" : "" }}
|
{{-- {{ getUserFullName($each->user_id) }} | --}}
{{ getUserName($each->user) }} |
{{-- {{ isset($usersByID[$each->user_id]) ? getUserName($usersByID[$each->user_id]) : "" }} | --}}
{{ baseUSDateFormat($each->created_at, true, "-", false, false, "m") }} |
@endforeach
@endif
@if (isset($flightsAudit['delays']))
@foreach($flightsAudit["delays"] as $i => $each)
@php $dlAdded = false @endphp
@if ($sprMe) | {{ $each->id }} | @endif
@if ($each->dl)
@php $dlAdded = true @endphp
DL {{ $each->dl->code." | ". $each->dl->description }}
@endif
@forelse($each->old_values as $prop => $val)
@if (!in_array($prop, ["position", "duration"]))
@continue
@endif
{!! getAuditProp($prop) !!}{{ $val }}
@empty
Created
@endforelse
|
@if (!$dlAdded && $each->dl)
DL {{ $each->dl->code." | ". $each->dl->description }}
@endif
@forelse($each->new_values as $prop => $val)
@if (!in_array($prop, ["position", "duration"]))
@continue
@endif
{!! getAuditProp($prop) !!}{{ $val }}
@empty
Removed
@endforelse
|
{{ getUserName($each->user) }} |
{{-- {{ isset($usersByID[$each->user_id]) ? getUserName($usersByID[$each->user_id]) : "" }} | --}}
{{ baseUSDateFormat($each->created_at, true, "-", false, true, "m") }} |
@endforeach
@endif
@if (isset($flightsAudit['flightStations']))
@foreach($flightsAudit["flightStations"] as $i => $each)
@if ($sprMe) | {{ $each->id }} | @endif
|
{{ $each->email_type }}
Station: {{ $each->airport }}
{{ $each->received_datetime }}
|
{{ getUserName($each->user) }} |
{{-- {{ isset($usersByID[$each->user_id]) ? getUserName($usersByID[$each->user_id]) : "" }} | --}}
{{ baseUSDateFormat($each->created_at, true, "-", false, true, "m") }} |
@endforeach
@endif