@if ($bookingType == 'TWOWAY')
@if ($bookingFlightType == 'both')
@foreach ($bookingDetails['travplans'][0]->Results->Segments[0] as $bookingKey => $segment)
@if ($firstKey == 'travplans')
OUTBOUND
@else
INBOUND
@endif
{{ $segment->Airline->AirlineName }}
{{ $segment->Airline->FlightNumber }}
-
{{ 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
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->FName }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->FNo }}
-
{{ 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
{{ $bookingKafila->SelectedFlight[0]->Itinerary[0]->FName }}
{{ $bookingKafila->SelectedFlight[0]->Itinerary[0]->FNo }}
-
{{ 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 --}}
{{ $segment->Airline->AirlineName }}
{{ $segment->Airline->FlightNumber }}
-
{{ 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)
{{ $segment->Airline->AirlineName }}
{{ $segment->Airline->FlightNumber }}
-
{{ 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
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->FName }}
{{ $bookingDetails['kafila'][0]->SelectedFlight[0]->Itinerary[0]->FNo }}
-
{{ 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
@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
@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
@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
@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
@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
@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
@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
@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