{{--@foreach ($flights->lines as $k => $line)--}} @foreach ($flights as $k => $items) {{-- @php $items = $line->getFlights() @endphp --}} @php $depFlight = $depFn = $depAp = $arrAp = $depAC = null @endphp @if (count($items) == 2) @php $depFlight = $items[0] @endphp @php $depAp = getFlightDepartureAirport($depFlight, false, true) @endphp @php $arrAp = getFlightArrivalAirport($depFlight, false, true) @endphp @php $depSTD = $depFlight->std && $depFlight->std != EMPTY_DATETIME ? baseDateFormat($depFlight->std, true) : null @endphp @php $depSTDDate = $depSTD ? date("Y-m-d", strtotime($depSTD)) : null @endphp @php $depFn = getFlightNumberFull($depFlight->flightNumber) @endphp @php $depAC = getFlightAircraft($depFlight) @endphp @php $depACType = getFlightAircraftType($depFlight) @endphp @php $arrFlight = $items[1] @endphp @php $arrFN = getFlightNumberFull($arrFlight->flightNumber) @endphp @php $arrDepAp = getFlightDepartureAirport($arrFlight, false, true) @endphp @php $arrSTA = $arrFlight->sta && $arrFlight->sta != EMPTY_DATETIME ? baseDateFormat($arrFlight->sta, true) : null @endphp @php $arrSTADate = $arrSTA ? date("Y-m-d", strtotime($arrSTA)) : null @endphp {{ getFlightDepartureInitialDate($depFlight, true)}} {{--Departure Flight--}} {{ $depAp }} {{ $depFn }} {{ $arrAp }} {{ baseTimeFormat($depSTD) }} {{--Arrival Flight--}} {{ $arrFN }} {{ $arrDepAp }} {{ ($depSTDDate != $arrSTADate ? $arrSTADate." " : ""). baseTimeFormat($arrSTA) }} {{ $depAC }} {{ $depACType }} {{--Arrival flight ATA--}} {{ $arrFlight->ata && $arrFlight->ata != EMPTY_DATETIME ? baseTimeFormat($arrFlight->ata) : "" }} {{--Departure flight ATD--}} {{ $depFlight->atd && $depFlight->atd != EMPTY_DATETIME ? baseTimeFormat($depFlight->atd) : "" }} {{--DELAYS OUT--}} @php list($codes, $times) = getFlightDelays($depFlight) @endphp @if (count($codes)) DL {{ implode("/", $codes) }} {{ implode("/", $times) }} @else @endif {{--- PAX IN---}} {{ getFlightPaxTotal($arrFlight, true) }} {{ $arrFlight->pax_inf_actual }} {{--- PAX OUT---}} {{ getFlightPaxTotal($depFlight, true) }} {{ $depFlight->pax_inf_actual }} {{--- Baggage IN---}} {{ $arrFlight->baggage_pcs }} {{ $arrFlight->baggage }} {{--- Baggage OUT---}} {{ $depFlight->baggage_pcs }} {{ $depFlight->baggage }} {{--- Cargo IN---}} {{ $arrFlight->cargo_pcs }} {{ $arrFlight->cargo }} {{--- Cargo OUT---}} {{ $depFlight->cargo_pcs }} {{ $depFlight->cargo }} {{--Counters--}} {{ $depFlight->ckin_num }} {{--SSR--}} @foreach($ssrList as $ssr) {{--IN--}} @if ($arrFlight->ssr_ready && isset($arrFlight->ssr_ready[$ssr])) {{ $arrFlight->ssr_ready[$ssr] }} @else @endif {{--OUT--}} @if ($depFlight->ssr_ready && isset($depFlight->ssr_ready[$ssr])) {{ $depFlight->ssr_ready[$ssr] }} @else @endif @endforeach @else @php $flight = $items[0] @endphp @php $fn = getFlightNumberFull($flight->flightNumber) @endphp @if ($flight->type == DEPARTURE) @php $ac = getFlightAircraft($flight) @endphp @php $acType = getFlightAircraftType($flight) @endphp @php $depAp = getFlightDepartureAirport($flight, false, true) @endphp @php $arrAp = getFlightArrivalAirport($flight, false, true) @endphp {{--{{ $k + 1 }}--}} {{ getFlightDepartureInitialDate($flight, true) }} {{--Departure Flight--}} {{ $depAp }} {{ $fn }} {{ $arrAp }} {{--Departure Flight--}} {{ $flight->std && $flight->std != EMPTY_DATETIME ? baseTimeFormat($flight->std) : "" }} {{--Arrival Flight--}} {{ $ac }} {{ $acType }} {{--Arrival flight ATA--}} {{--Departure flight ATD--}} {{ $flight->atd && $flight->atd != EMPTY_DATETIME ? baseTimeFormat($flight->atd) : "" }} @php list($codes, $times) = getFlightDelays($flight) @endphp @if (count($codes)) DL {{ implode("/", $codes) }} {{ implode("/", $times) }} @else @endif {{--- PAX IN---}} {{--- PAX OUT---}} {{ getFlightPaxTotal($flight, true) }} {{ $flight->pax_inf_actual }} {{--- BAGGAGE IN---}} {{--- BAGGAGE OUT---}} {{ $flight->baggage_pcs }} {{ $flight->baggage }} {{--- Cargo IN---}} {{--- Cargo OUT---}} {{ $flight->cargo_pcs }} {{ $flight->cargo }} {{--Counters--}} {{ $flight->ckin_num }} {{--SSR--}} @foreach($ssrList as $ssr) {{--IN--}} {{--OUT--}} @if ($flight->ssr_ready && isset($flight->ssr_ready[$ssr])) {{ $flight->ssr_ready[$ssr] }} @else @endif @endforeach @else @php $arrAp = getFlightArrivalAirport($flight, false, true) @endphp @php $arrDepAp = getFlightDepartureAirport($flight, false, true) @endphp @php $arrSTA = $flight->sta && $flight->sta != EMPTY_DATETIME ? baseDateFormat($flight->sta, true) : null @endphp @php $arrSTADate = $arrSTA ? date("Y-m-d", strtotime($arrSTA)) : null @endphp {{ getFlightDepartureInitialDate($flight, true)}} {{--Departure Flight--}} {{ $arrAp }} {{--Arrival Flight--}} {{ $fn }} {{ $arrDepAp }} {{ $arrSTADate." ". baseTimeFormat($arrSTA) }} {{--Arrival flight ATA--}} {{ $flight->ata && $flight->ata != EMPTY_DATETIME ? baseTimeFormat($flight->ata) : "" }} {{--Departure flight ATD--}} {{--DELAYS OUT--}} {{--- PAX IN---}} {{ getFlightPaxTotal($flight, true) }} {{ $flight->pax_inf_actual }} {{--- PAX OUT---}} {{--- Baggage IN---}} {{ $flight->baggage_pcs }} {{ $flight->baggage }} {{--- Baggage OUT---}} {{--- Cargo IN---}} {{ $flight->cargo_pcs }} {{ $flight->cargo }} {{--- Cargo OUT---}} {{--Counters--}} {{ $flight->ckin_num }} {{--SSR--}} @foreach($ssrList as $ssr) {{--IN--}} @if ($flight->ssr_ready && isset($flight->ssr_ready[$ssr])) {{ $flight->ssr_ready[$ssr] }} @else @endif {{--OUT--}} @endforeach @endif @endif @endforeach