@php
$offer = json_decode($booking->flight_info, true);
@endphp
@if (isset($offer) && $offer != null)
@foreach ($offer['slices'] as $sliceIndex => $slice)
@php
$departureTime = \Carbon\Carbon::parse($slice['segments'][0]['departing_at']);
$arrivalTime = \Carbon\Carbon::parse($slice['segments'][0]['arriving_at']);
$duration = $departureTime->diffForHumans($arrivalTime, ['parts' => 2]);
$isNonStop = count($slice['segments']) === 1;
@endphp
{{ $departureTime->format('D, j M Y') }}, {{ $departureTime->format('H:i') }}
Depart from: {{ $slice['segments'][0]['origin']['name'] ?? 'Airport' }} ({{ $slice['segments'][0]['origin']['iata_code'] ?? 'N/A' }}) -
@if (isset($slice['segments'][0]['origin_terminal']))
Terminal {{ $slice['segments'][0]['origin_terminal'] }}
@endif
Flight Duration: {{ $duration }}
{{ $slice['segments'][0]['origin']['iata_code'] ?? 'N/A' }} - {{ $slice['segments'][0]['destination']['iata_code'] ?? 'N/A' }} - {{ $isNonStop ? 'Non-stop' : 'With stops' }}
{{ $arrivalTime->format('D, j M Y') }}, {{ $arrivalTime->format('H:i') }}
Arrive at: {{ $slice['segments'][0]['destination']['name'] ?? 'Airport' }} ({{ $slice['segments'][0]['destination']['iata_code'] ?? 'N/A' }}) -
@if (isset($slice['segments'][0]['destination_terminal']))
Terminal {{ $slice['segments'][0]['destination_terminal'] }}
@endif
@endforeach
Flight Information
Airline
{{ $booking->airline_name ?? 'N/A' }}
Flight Number
{{ $offer['slices'][0]['segments'][0]['operating_carrier_flight_number'] ?? 'N/A' }}
Cabin Class
{{ ucfirst($offer['slices'][0]['passengers'][0]['cabin_class_marketing_name'] ?? 'Economy') }}
Checked Baggage
@if (!empty($offer['slices'][0]['passengers'][0]['baggages']))
@foreach ($offer['slices'][0]['passengers'][0]['baggages'] as $baggage)
@if ($baggage['type'] === 'checked')
{{ $baggage['quantity'] ?? 1 }} bag
@endif
@endforeach
@else
N/A
@endif
Carry-on
@if (!empty($offer['slices'][0]['passengers'][0]['baggages']))
@foreach ($offer['slices'][0]['passengers'][0]['baggages'] as $baggage)
@if ($baggage['type'] === 'carry_on')
{{ $baggage['quantity'] ?? 1 }} bag
@endif
@endforeach
@else
N/A
@endif
@if (isset($offer['slices'][0]['segments'][0]['aircraft']['name']))
Aircraft
{{ $offer['slices'][0]['segments'][0]['aircraft']['name'] ?? 'N/A' }}
@endif
Passengers
@foreach ($passengers as $passengerIndex => $passenger)
Email
{{ $passenger['email'] ?? 'N/A' }}
Phone
{{ $passenger['phonecode'] ?? '' }} {{ $passenger['phone_number'] ?? 'N/A' }}
Date of Birth
{{ $passenger['born_on'] ?? 'N/A' }}
Gender
{{ ucfirst($passenger['gender'] ?? 'N/A') }}
@endforeach
Policies
Flight Change Policy
Make changes to this flight up until the departure date (a change penalty may apply)
Order Change Policy
Make changes to this order up until the initial departure date (a change penalty may apply)
Refund Policy
This order may be refundable subject to airline terms and conditions
@endif