@extends('layouts.frontend') @section('content')

Flight boking

@php $timeCalculate = new \App\Http\Controllers\Frontend\FlightController(); $bookingType = session()->get('booking_type'); $bookingDetails = session()->get('booking_details'); if ($bookingType == 'ONEWAY') { if (isset($bookingDetails['kafila'])) { $bookingFlightType = 'kafila'; } elseif (isset($bookingDetails['travplans'])) { $bookingFlightType = 'travplans'; } } else { if (isset($bookingDetails['kafila']) && isset($bookingDetails['travplans'])) { $bookingFlightType = 'both'; } elseif (isset($bookingDetails['travplans'])) { $bookingFlightType = 'travplans'; } elseif (isset($bookingDetails['kafila'])) { $bookingFlightType = 'kafila'; } } $firstKey = 'travplans'; if ($bookingFlightType == 'both') { foreach ($bookingDetails as $key => $bt) { $firstKey = $key; break; } } @endphp
@if ($bookingType == 'TWOWAY') @if ($bookingFlightType == 'both') @foreach ($bookingDetails['travplans'][0]->Results->Segments[0] as $bookingKey => $segment) @if ($firstKey == 'travplans')

OUTBOUND

@else

INBOUND

@endif
  • {{ date('d-m-Y H:i', strtotime($segment->Origin->DepTime)) }} {{ $segment->Origin->Airport->AirportCode }} ({{ $segment->Origin->Airport->CityName }})
  • {{ date('d-m-Y H:i', strtotime($segment->Destination->ArrTime)) }} {{ $segment->Destination->Airport->AirportCode }} ({{ $segment->Destination->Airport->CityName }})
@php $minutes = $segment->Duration; $hours = floor($minutes / 60); $min = $minutes - $hours * 60; @endphp
{{ $hours . 'h :' . $min . 'm' }}
{{ count($bookingDetails->Results->Segments[0]) }} Stop
@endforeach @if ($firstKey == 'travplans')

INBOUND

@else

OUTBOUND

@endif
  • {{ date('d-m-Y H:i', strtotime($bookingDetails['kafila'][0]->SelectedFlight[0]->DDate)) }} {{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->DArpt }}
  • {{ date('d-m-Y H:i', strtotime($bookingDetails['kafila'][0]->SelectedFlight[0]->ADate)) }} {{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->AArpt }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Dur }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Stop }} Stop
@elseif($bookingFlightType == 'kafila') @foreach ($bookingDetails['kafila'] as $btKey => $bookingKafila) @if ($btKey == 0)

OUTBOUND

@else

INBOUND

@endif
  • {{ date('d-m-Y H:i', strtotime($bookingKafila->SelectedFlight[0]->DDate)) }} {{ $bookingKafila->SelectedFlight[0]->Itinerary[0]->DArpt }}
  • {{ date('d-m-Y H:i', strtotime($bookingKafila->SelectedFlight[0]->ADate)) }} {{ $bookingKafila->SelectedFlight[0]->Itinerary[0]->AArpt }}
{{ $bookingKafila->SelectedFlight[0]->Dur }}
{{ $bookingKafila->SelectedFlight[0]->Stop }} Stop
@endforeach @elseif($bookingFlightType == 'travplans') @foreach ($bookingDetails['travplans'] as $btKey => $segments) @if ($btKey == 0)

OUTBOUND

@else

INBOUND

@endif @foreach ($segments->Results->Segments[0] as $bookingKey => $segment) {{-- @php if($bookingKey != 0){ break; } @endphp --}}
  • {{ date('d-m-Y H:i', strtotime($segment->Origin->DepTime)) }} {{ $segment->Origin->Airport->AirportCode }} ({{ $segment->Origin->Airport->CityName }})
  • {{ date('d-m-Y H:i', strtotime($segment->Destination->ArrTime)) }} {{ $segment->Destination->Airport->AirportCode }} ({{ $segment->Destination->Airport->CityName }})
@php $minutes = $segment->Duration; $hours = floor($minutes / 60); $min = $minutes - $hours * 60; @endphp
{{ $hours . 'h :' . $min . 'm' }}
{{ count($segments->Results->Segments[0]) }} Stop
@endforeach @endforeach @endif @else @if ($bookingFlightType == 'travplans') @foreach ($bookingDetails['travplans'][0]->Results->Segments[0] as $bookingKey => $segment)
  • {{ date('d-m-Y H:i', strtotime($segment->Origin->DepTime)) }} {{ $segment->Origin->Airport->AirportCode }} ({{ $segment->Origin->Airport->CityName }})
  • {{ date('d-m-Y H:i', strtotime($segment->Destination->ArrTime)) }} {{ $segment->Destination->Airport->AirportCode }} ({{ $segment->Destination->Airport->CityName }})
@php $minutes = $segment->Duration; $hours = floor($minutes / 60); $min = $minutes - $hours * 60; @endphp
{{ $hours . 'h :' . $min . 'm' }}
{{ count($bookingDetails['travplans'][0]->Results->Segments[0]) }} Stop
@endforeach @else
  • {{ date('d-m-Y H:i', strtotime($bookingDetails['kafila'][0]->SelectedFlight[0]->DDate)) }} {{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->DArpt }}
  • {{ date('d-m-Y H:i', strtotime($bookingDetails['kafila'][0]->SelectedFlight[0]->ADate)) }} {{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->AArpt }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Dur }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Stop }} Stop
@endif @endif @php @endphp
@csrf {{-- --}}

Traveller Details

@if(isset($bookingDetails['travplans'])) @php $customerfareTravplans = $timeCalculate->fare_markup($bookingDetails['travplans'][0]->Results->Fare->OfferedFare, $bookingDetails['travplans'][0]->Results->Fare->PublishedFare,$bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->AirlineCode, $bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->FlightNumber, $bookingDetails['travplans'][0]->Results->Fare->BaseFare, $bookingDetails['travplans'][0]->Results->Fare->YQTax); @endphp @foreach ($bookingDetails['travplans'][0]->Results->FareBreakdown as $breakdown) @php $getPaxCount = $breakdown->PassengerCount; @endphp @for ($i = 0; $i < $getPaxCount; $i++)
{{ $breakdown->PassengerType == 1 ? 'Adult' : ($breakdown->PassengerType == 2 ? 'Child' : 'Infant ') }} {{$i +1}} -
@if ($breakdown->PassengerType != 1)
@else
@endif
@endfor @endforeach @else @php $customerfareKafila = $timeCalculate->fare_markup($bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->FName, $bookingDetails['kafila'][0]->SelectedFlight[0]->FNo, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->YqTotal); @endphp @php $getPaxCount = $bookingDetails['kafila'][0]->Param->Adt + $bookingDetails['kafila'][0]->Param->Chd; @endphp @for ($i = 0; $i < $getPaxCount; $i++)
{{-- {{ $breakdown->PassengerType == 1 ? 'Adult' : ($breakdown->PassengerType == 2 ? 'Child' : 'Infant ') }} {{$i +1}} - --}}
{{-- --}}
{{-- @if ($breakdown->PassengerType != 1)
@else --}}
{{-- @endif --}}
@endfor @endif
Contact Details

Acknowledgment

@if (Auth::check() && Auth::User()->roles()->first()->title == 'Agent') @if(isset($customerfareTravplans)) @if($customerWalletBalance >= $customerfareTravplans['customer_fare'])
@else @endif @else @if($customerWalletBalance >= $customerfareKafila['customer_fare'])
@else @endif @endif @endif
@if ($bookingType == 'TWOWAY')
@if ($bookingFlightType == 'both') @php $customerfareTravplans = $timeCalculate->fare_markup($bookingDetails['travplans'][0]->Results->Fare->OfferedFare, $bookingDetails['travplans'][0]->Results->Fare->PublishedFare,$bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->AirlineCode, $bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->FlightNumber, $bookingDetails['travplans'][0]->Results->Fare->BaseFare, $bookingDetails['travplans'][0]->Results->Fare->YQTax); $publishedPrice = $customerfareTravplans['customer_fare']; $basePrice = $bookingDetails['travplans'][0]->Results->Fare->BaseFare; $tax = $bookingDetails['travplans'][0]->Results->Fare->Tax; $passengerCount = $bookingDetails['travplans'][0]->Results->FareBreakdown[0]->PassengerCount; @endphp

Fare Details (OUTBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}
@php $customerfareKafila = $timeCalculate->fare_markup($bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->FName, $bookingDetails['kafila'][0]->SelectedFlight[0]->FNo, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->YqTotal); $publishedPrice = $customerfareKafila['customer_fare']; $basePrice = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal; $tax = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->TaxesTotal; $passengerCount = $bookingDetails['kafila'][0]->Param->Adt + $bookingDetails['kafila'][0]->Param->Chd; @endphp

Fare Details (INBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}
@elseif($bookingFlightType == 'kafila') @php $customerfareKafila = $timeCalculate->fare_markup($bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->FName, $bookingDetails['kafila'][0]->SelectedFlight[0]->FNo, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->YqTotal); $publishedPrice = $customerfareKafila['customer_fare']; // $publishedPrice = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal; $basePrice = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal; $tax = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->TaxesTotal; $passengerCount = $bookingDetails['kafila'][0]->Param->Adt + $bookingDetails['kafila'][0]->Param->Chd; @endphp

Fare Details (OUTBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}
@php $customerfareKafila = $timeCalculate->fare_markup($bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][1]->SelectedFlight[0]->FName, $bookingDetails['kafila'][1]->SelectedFlight[0]->FNo, $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->BasicTotal, $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->YqTotal); $publishedPrice = $customerfareKafila['customer_fare']; // $publishedPrice = $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->GrandTotal; $basePrice = $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->BasicTotal; $tax = $bookingDetails['kafila'][1]->SelectedFlight[0]->Fare->TaxesTotal; $passengerCount = $bookingDetails['kafila'][1]->Param->Adt + $bookingDetails['kafila'][1]->Param->Chd; @endphp

Fare Details (INBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}
@elseif($bookingFlightType == 'travplans') @php $customerfareTravplans = $timeCalculate->fare_markup($bookingDetails['travplans'][0]->Results->Fare->OfferedFare, $bookingDetails['travplans'][0]->Results->Fare->PublishedFare,$bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->AirlineCode, $bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->FlightNumber, $bookingDetails['travplans'][0]->Results->Fare->BaseFare, $bookingDetails['travplans'][0]->Results->Fare->YQTax); // $publishedPrice = $customerfareTravplans['customer_fare']; // $publishedPrice = $bookingDetails['travplans'][0]->Results->Fare->PublishedFare; $basePrice = $bookingDetails['travplans'][0]->Results->Fare->BaseFare; // $tax = $bookingDetails['travplans'][0]->Results->Fare->Tax; $passengerCount = $bookingDetails['travplans'][0]->Results->FareBreakdown[0]->PassengerCount; $publishedPrice = $customerfareTravplans['customer_fare']; $tax = $customerfareTravplans['customer_fare'] - $basePrice; @endphp

Fare Details (OUTBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}
@php $customerfareIbTravplans = $timeCalculate->fare_markup($bookingDetails['travplans'][1]->Results->Fare->OfferedFare, $bookingDetails['travplans'][1]->Results->Fare->PublishedFare,$bookingDetails['travplans'][1]->Results->Segments[0][0]->Airline->AirlineCode, $bookingDetails['travplans'][1]->Results->Segments[0][0]->Airline->FlightNumber, $bookingDetails['travplans'][1]->Results->Fare->BaseFare, $bookingDetails['travplans'][1]->Results->Fare->YQTax); // $publishedPrice = $customerfareTravplans['customer_fare']; // $publishedPrice = $bookingDetails['travplans'][1]->Results->Fare->PublishedFare; $basePrice = $bookingDetails['travplans'][1]->Results->Fare->BaseFare; // $tax = $bookingDetails['travplans'][1]->Results->Fare->Tax; $passengerCount = $bookingDetails['travplans'][1]->Results->FareBreakdown[0]->PassengerCount; $publishedPrice = $customerfareIbTravplans['customer_fare']; $tax = $customerfareIbTravplans['customer_fare'] - $basePrice; @endphp

Fare Details (INBOUND)

  • ₹ 3530
  • Tax₹ {{ $tax }}
  • Total Fare {{ $publishedPrice }}

Total Fare

  • Total Fare {{ $customerfareTravplans['customer_fare'] + $customerfareIbTravplans['customer_fare'] }}
@endif
@else @if (isset($bookingDetails['travplans'])) @php $customerfareTravplans = $timeCalculate->fare_markup($bookingDetails['travplans'][0]->Results->Fare->OfferedFare, $bookingDetails['travplans'][0]->Results->Fare->PublishedFare,$bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->AirlineCode, $bookingDetails['travplans'][0]->Results->Segments[0][0]->Airline->FlightNumber, $bookingDetails['travplans'][0]->Results->Fare->BaseFare, $bookingDetails['travplans'][0]->Results->Fare->YQTax); $basePrice = $bookingDetails['travplans'][0]->Results->Fare->BaseFare; $otherCharges = $bookingDetails['travplans'][0]->Results->Fare->OtherCharges; $passengerCount = 0; $publishedPrice = $customerfareTravplans['customer_fare']; $tax = $customerfareTravplans['customer_fare'] - $basePrice; @endphp @foreach ($bookingDetails['travplans'][0]->Results->FareBreakdown as $breakdown) @php $passengerCount += $breakdown->PassengerCount; @endphp @endforeach

Fare Details

  • ₹{{ $basePrice }}
  • Tax ₹{{ $tax }}
  • Other Charges ₹{{ $otherCharges }}
  • Total Fare {{ $publishedPrice }}
@else @php $customerfareKafila = $timeCalculate->fare_markup($bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->FName, $bookingDetails['kafila'][0]->SelectedFlight[0]->FNo, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal, $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->YqTotal); $publishedPrice = $customerfareKafila['customer_fare']; // $publishedPrice = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->GrandTotal; $basePrice = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->BasicTotal; $tax = $bookingDetails['kafila'][0]->SelectedFlight[0]->Fare->TaxesTotal; $passengerCount = $bookingDetails['kafila'][0]->Param->Adt + $bookingDetails['kafila'][0]->Param->Chd; @endphp

Fare Details

@endif @endif
@endsection @section('scripts') @endsection