@php use Carbon\Carbon; @endphp @php $total = 0; $pax = ['Adults', 'Children', 'Infants']; $rt = $ret_data['fare']['FareBreakdown'] ?? []; $destination = $fare['Segments'][0][count($fare['Segments'][0]) - 1]['Destination']; $passport = $fare['IsPassportRequiredAtBook'] || $fare['IsPassportRequiredAtTicket'] || ($ret_data['fare']['IsPassportRequiredAtBook'] ?? false) || ($ret_data['fare']['IsPassportRequiredAtTicket'] ?? false); if (!function_exists('air_date')) { function air_date($d) { $da = explode('-', substr($d, 0, 10)); preg_match('/T(.*):/', $d, $t); return '

' . $t[1] . '' . $da[2] . '-' . $da[1] . '-' . $da[0] . '

'; } } // dd($fare, $pax); $adult = $fare['FareBreakdown'][0]['PassengerCount']; $child = $fare['FareBreakdown'][1]['PassengerCount'] ?? 0; $infant = $fare['FareBreakdown'][2]['PassengerCount'] ?? 0; @endphp @inject('countries', App\Models\Country::class) @extends('user.components.layout') @push('css') @endpush @section('main')
Time Left
@csrf
@foreach ($fare['Segments'][0] as $i => $segment) @php $airline = $segment['Airline']; $origin = $segment['Origin']; $destination = $segment['Destination']; @endphp @if ($i > 0) @php // dd($segment); // Create Carbon instances for arrival and departure time $arrivalDateTime = Carbon::parse($fare['Segments'][0][0]['Destination']['ArrTime']); $departureDateTime = Carbon::parse( $fare['Segments'][0][1]['Origin']['DepTime']); // Calculate the time difference $timeDifference = $arrivalDateTime->diff($departureDateTime); // Format the time difference $timeDifferenceFormatted = $timeDifference->format('%h Hours %i Minutes'); @endphp
{{ $timeDifferenceFormatted }} {{-- {{ floor(($segment['GroundTime'] ?? 0) / 60) }} {{ ($segment['GroundTime'] ?? 0) % 60 }} --}}
@endif
{{ $airline['AirlineName'] }} {{ $airline['AirlineCode'] }}-{{ $airline['FlightNumber'] }}

{{ $fare['Segments'][0][0]['Origin']['Airport']['AirportCode'] }} - {{ $fare['Segments'][0][count($fare['Segments'][0]) - 1]['Destination']['Airport']['AirportCode'] }}

{{ $origin['Airport']['AirportCode'] }} {{ $origin['Airport']['CityName'] }}

@if ($origin['Airport']['Terminal'] != '') T-{{ $origin['Airport']['Terminal'] }} @endif {{ $origin['Airport']['AirportName'] }}

{!! air_date($origin['DepTime']) !!}

{{ $destination['Airport']['CityName'] }} {{ $destination['Airport']['AirportCode'] }}

@if ($destination['Airport']['Terminal'] != '') T-{{ $destination['Airport']['Terminal'] }} @endif {{ $destination['Airport']['AirportName'] }}

{!! air_date($destination['ArrTime']) !!}

{{ floor($segment['Duration'] / 60) }} Hours {{ $segment['Duration'] % 60 }} Minutes

{{ $segment['CabinBaggage'] }} Cabin

{{ $segment['Baggage'] }}

@endforeach
@isset($ret_data)
@foreach ($ret_data['fare']['Segments'][0] as $i => $segment) @php $airline = $segment['Airline']; $origin = $segment['Origin']; $destination = $segment['Destination']; @endphp @if ($i > 0) @php // dd($ret_data); // Create Carbon instances for arrival and departure time $arrivalDateTime = Carbon::parse($ret_data['fare']['Segments'][0][0]['Destination']['ArrTime']); $departureDateTime = Carbon::parse( $ret_data['fare']['Segments'][0][1]['Origin']['DepTime']); // Calculate the time difference $timeDifference = $arrivalDateTime->diff($departureDateTime); // Format the time difference $timeDifferenceFormatted = $timeDifference->format('%h Hours %i Minutes'); @endphp
{{ $timeDifferenceFormatted }} {{-- {{ floor(($segment['GroundTime'] ?? 0) / 60) }} {{ ($segment['GroundTime'] ?? 0) % 60 }} --}}
@endif
{{ $airline['AirlineName'] }} {{ $airline['AirlineCode'] }}-{{ $airline['FlightNumber'] }}

{{ $ret_data['fare']['Segments'][0][0]['Origin']['Airport']['AirportCode'] }} - {{ $ret_data['fare']['Segments'][0][count($ret_data['fare']['Segments'][0]) - 1]['Destination']['Airport']['AirportCode'] }}

{{ $origin['Airport']['AirportCode'] }} {{ $origin['Airport']['CityName'] }}

@if ($origin['Airport']['Terminal'] != '') T-{{ $origin['Airport']['Terminal'] }} @endif {{ $origin['Airport']['AirportName'] }}

{!! air_date($origin['DepTime']) !!}

{{ $destination['Airport']['CityName'] }} {{ $destination['Airport']['AirportCode'] }}

@if ($destination['Airport']['Terminal'] != '') T-{{ $destination['Airport']['Terminal'] }} @endif {{ $destination['Airport']['AirportName'] }}

{!! air_date($destination['ArrTime']) !!}

{{ floor($segment['Duration'] / 60) }} Hours {{ $segment['Duration'] % 60 }} Minutes

{{ $segment['CabinBaggage'] }} Cabin

{{ $segment['Baggage'] }}

@endforeach
@endisset @isset($fare['Segments'][1])
@foreach ($fare['Segments'][1] as $i => $segment) @php $airline = $segment['Airline']; $origin = $segment['Origin']; $destination = $segment['Destination']; @endphp @if ($i > 0) @php // dd($segment); // Create Carbon instances for arrival and departure time $arrivalDateTime = Carbon::parse($fare['Segments'][1][0]['Destination']['ArrTime']); $departureDateTime = Carbon::parse( $fare['Segments'][1][1]['Origin']['DepTime']); // Calculate the time difference $timeDifference = $arrivalDateTime->diff($departureDateTime); // Format the time difference $timeDifferenceFormatted = $timeDifference->format('%h Hours %i Minutes'); @endphp
{{ $timeDifferenceFormatted }} {{-- {{ floor(($segment['GroundTime'] ?? 0) / 60) }} {{ ($segment['GroundTime'] ?? 0) % 60 }} --}}
@endif
{{ $airline['AirlineName'] }} {{ $airline['AirlineCode'] }}-{{ $airline['FlightNumber'] }}

{{ $fare['Segments'][1][0]['Origin']['Airport']['AirportCode'] }} - {{ $fare['Segments'][1][count($fare['Segments'][1]) - 1]['Destination']['Airport']['AirportCode'] }}

{{ $origin['Airport']['AirportCode'] }} {{ $origin['Airport']['CityName'] }}

@if ($origin['Airport']['Terminal'] != '') T-{{ $origin['Airport']['Terminal'] }} @endif {{ $origin['Airport']['AirportName'] }}

{!! air_date($origin['DepTime']) !!}

{{ $destination['Airport']['CityName'] }} {{ $destination['Airport']['AirportCode'] }}

@if ($destination['Airport']['Terminal'] != '') T-{{ $destination['Airport']['Terminal'] }} @endif {{ $destination['Airport']['AirportName'] }}

{!! air_date($destination['ArrTime']) !!}

{{ floor($segment['Duration'] / 60) }} Hours {{ $segment['Duration'] % 60 }} Minutes

{{ $segment['CabinBaggage'] }} Cabin

{{ $segment['Baggage'] }}

@endforeach
@endisset
Cancellation & Re-Issue {{ $fare['MiniFareRules'][0][0]['JourneyPoints'] ?? $rules[0]['Origin'] . '-' . $rules[count($rules) - 1]['Destination'] }}View Charges
@isset($fare['MiniFareRules'])
@foreach ($fare['MiniFareRules'][0] as $rule) @if ($rule['Type'] == 'Reissue') @endif @endforeach
If Rescheduled Charges
{{ intval($rule['From'] ?? 0) + 2 }}-{{ $rule['To'] ? $rule['To'] + 2 : 'More' }} {{ $rule['Unit'] }} {{ $rule['Details'] }}
{{-- @php dd($fare['MiniFareRules'][0]) ; @endphp @foreach ($fare['MiniFareRules'][0] as $rule) @if ($rule['Type'] == 'Cancellation') @endif @endforeach --}} {{-- @php dd($fare['MiniFareRules'][0]); @endphp --}} @foreach ($fare['MiniFareRules'][0] as $rule) @if ($rule['Type'] == 'Cancellation') @endif @endforeach
If Cancelled Charges
{{ ($rule['From'] ?? 0) + 2 }}-{{ $rule['To'] ? $rule['To'] + 2 : 'More' }} {{ $rule['Unit'] }} {{ $rule['Details'] }}
@php // Check if 'From' is a valid numeric value $from = is_numeric($rule['From']) ? (int)$rule['From'] + 2 : '0'; // Check if 'To' is a valid numeric value, otherwise use 'More' $to = is_numeric($rule['To']) ? (int)$rule['To'] + 2 : 'More'; @endphp {{ $from }}-{{ $to }} {{ $rule['Unit'] }} {{ $rule['Details'] }}
@else
{!! $rules[0]['FareRuleDetail'] !!}
@endisset
@isset($ret_data)
Cancellation & Re-Issue {{ $ret_data['fare']['MiniFareRules'][0][0]['JourneyPoints'] ?? $ret_data['rules'][0]['Origin'] . '-' . $ret_data['rules'][count($ret_data['rules']) - 1]['Destination'] }}View Charges
@isset($ret_data['fare']['MiniFareRules'])
@foreach ($ret_data['fare']['MiniFareRules'][0] as $rule) @if ($rule['Type'] == 'Reissue') @endif @endforeach
If Rescheduled Charges
{{ ($rule['From'] ?? 0) + 2 }}-{{ $rule['To'] ? $rule['To'] + 2 : 'More' }} {{ $rule['Unit'] }} {{ $rule['Details'] }}
@foreach ($ret_data['fare']['MiniFareRules'][0] as $rule) @if ($rule['Type'] == 'Cancellation') @endif @endforeach
If Cancelled Charges
{{ ($rule['From'] ?? 0) + 2 }}-{{ $rule['To'] ? $rule['To'] + 2 : 'More' }} {{ $rule['Unit'] }} {{ $rule['Details'] }}
@else
{!! $ret_data['rules'][0]['FareRuleDetail'] !!}
@endisset
@endisset
Travellers Details {{ $adult }} {{ $adult > 1 ? 'Adults' : 'Adult' }} @if ($child > 0) , {{ $child }} {{ $child > 1 ? 'Children' : 'Child' }} @endif @if ($infant > 0) , {{ $infant }} {{ $infant > 1 ? 'Infants' : 'Infant' }} @endif
@for ($i = 0; $i < $adult; $i++)
@if ($passport)
@foreach ($countries::all()->toArray() as $country)
{{ $country['country_name'] }}
@endforeach
@endif
@endfor
@if ($child > 0)
@for ($i = 0; $i < $child; $i++)
@if ($passport)
@foreach ($countries::all()->toArray() as $country)
{{ $country['country_name'] }}
@endforeach
@endif
@endfor
@endif @if ($infant > 0)
@for ($i = 0; $i < $infant; $i++)
@if ($passport)
@foreach ($countries::all()->toArray() as $country)
{{ $country['country_name'] }}
@endforeach
@endif
@endfor
@endif
Contact & Address

These Details will be used to create your profile

@foreach ($countries::all()->toArray() as $country)
{{ $country['country_name'] }}
@endforeach
Fill details carefully. These will be used to send booking ticket and details.
Company Details (Optional)
For GST Purpose
@if (isset($ssr['MealDynamic']) || isset($ssr['Baggage']) || isset($ssr['SeatDynamic']) || isset($ret_data['ssr']['MealDynamic']) || isset($ret_data['ssr']['Baggage']) || isset($ret_data['ssr']['SeatDynamic']))
Add On (Baggage, Meal, Seat)

These Add-on are optional. There are for your comfortable journey.

@isset($ret_data)
@endisset
{{ $fare['Segments'][0][0]['Origin']['Airport']['AirportCode'] }} - {{ $fare['Segments'][0][count($fare['Segments'][0]) - 1]['Destination']['Airport']['AirportCode'] }}
@for ($i = 0; $i < $adult; $i++)
@isset($ssr['MealDynamic'])
@endisset @isset($ssr['Baggage'])
@endisset @isset($ssr['SeatDynamic'])
@foreach ($ssr['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@if ($child > 0)
@for ($i = 0; $i < $child; $i++)
@isset($ssr['MealDynamic'])
@endisset @isset($ssr['Baggage'])
@endisset @isset($ssr['SeatDynamic'])
@foreach ($ssr['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@endif @if ($infant > 0 && isset($ssr['MealDynamic']))
@for ($i = 0; $i < $infant; $i++)
Infant can not acquire seat and carry baggage. @endfor
@endif
@isset($ssr['MealDynamic'][1])
{{ $fare['Segments'][1][0]['Origin']['Airport']['AirportCode'] }} - {{ $fare['Segments'][1][count($fare['Segments'][1]) - 1]['Destination']['Airport']['AirportCode'] }}
@for ($i = 0; $i < $adult; $i++)
@isset($ssr['MealDynamic'])
@endisset @isset($ssr['Baggage'])
@endisset @isset($ssr['SeatDynamic'])
@foreach ($ssr['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@if ($child > 0)
@for ($i = 0; $i < $child; $i++)
@isset($ssr['MealDynamic'])
@endisset @isset($ssr['Baggage'])
@endisset @isset($ssr['SeatDynamic'])
@foreach ($ssr['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@endif @if ($infant > 0 && isset($ssr['MealDynamic']))
@for ($i = 0; $i < $infant; $i++)
Infant can not acquire seat and carry baggage. @endfor
@endif
@endisset @isset($ret_data)
{{ $ret_data['fare']['Segments'][0][0]['Origin']['Airport']['AirportCode'] }} - {{ $ret_data['fare']['Segments'][0][count($ret_data['fare']['Segments'][0]) - 1]['Destination']['Airport']['AirportCode'] }}
@for ($i = 0; $i < $adult; $i++)
@isset($ret_data['ssr']['MealDynamic'])
@endisset @isset($ret_data['ssr']['Baggage'])
@endisset @isset($ret_data['ssr']['SeatDynamic'])
@foreach ($ret_data['ssr']['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@if ($child > 0)
@for ($i = 0; $i < $child; $i++)
@isset($ssr['MealDynamic'])
@endisset @isset($ssr['Baggage'])
@endisset @isset($ret_data['ssr']['SeatDynamic'])
@foreach ($ret_data['ssr']['SeatDynamic'][0]['SegmentSeat'] as $j => $seg)
@endforeach
@endisset
@endfor
@endif @if ($infant > 0 && isset($ssr['MealDynamic']))
@for ($i = 0; $i < $infant; $i++)
Infant can not acquire seat and carry baggage. @endfor
@endif
@endisset
@endif
@endsection @push('popup') @isset($ssr['SeatDynamic'])
@php $deps=[]; @endphp @foreach ($ssr['SeatDynamic'][0]['SegmentSeat'] as $i => $flight) @php $deps[]=$flight['RowSeats'][0]['Seats'][0]['Origin']."-".$flight['RowSeats'][0]['Seats'][0]['Destination']; @endphp
$i == 0])>
@foreach ($flight['RowSeats'] as $j => $row) @if ($j != 0 && $flight['RowSeats'][$j - 1]['Seats'][0]['Deck'] != $row['Seats'][0]['Deck'])
@endif @php $seats=count($row['Seats']); @endphp
@foreach ($row['Seats'] as $k => $seat) @if ($k == 3 || $k == $seats - 3) @endif @endforeach
@endforeach

Paid Seat

Booked Seat

7F

Free Seat

7F

Selected Seat

{{ $deps[count($deps) - 1] }}
@for ($x = 0; $x < $adult + $child; $x++)

Pax {{ $x + 1 }}

--- - ---rs

@endfor
@endforeach @if (count($deps) > 1)
@foreach ($deps as $i => $depp) @endforeach
@endif
@endisset @isset($ret_data['ssr']['SeatDynamic'])
@php $rets=[]; @endphp @foreach ($ret_data['ssr']['SeatDynamic'][0]['SegmentSeat'] as $i => $flight) @php $rets[]=$flight['RowSeats'][0]['Seats'][0]['Origin']."-".$flight['RowSeats'][0]['Seats'][0]['Destination']; @endphp
$i == 0])>
@foreach ($flight['RowSeats'] as $j => $row) @if ($j != 0 && $flight['RowSeats'][$j - 1]['Seats'][0]['Deck'] != $row['Seats'][0]['Deck'])
@endif @php $seats=count($row['Seats']); @endphp
@foreach ($row['Seats'] as $k => $seat) @if ($k == 3 || $k == $seats - 3) @endif @endforeach
@endforeach

Paid Seat

Booked Seat

7F

Free Seat

7F

Selected Seat

{{ $rets[count($rets) - 1] }}
@for ($x = 0; $x < $adult + $child; $x++)

Pax {{ $x + 1 }}

--- - ---rs

@endfor
@endforeach @if (count($rets) > 1)
@foreach ($rets as $i => $depp) @endforeach
@endif
@endisset @endpush @push('js') @endpush