@extends('layouts.app') @section('content') @php $img = $hotel['images']['url'] ?? 'https://via.placeholder.com/800x400'; $facilities = explode(';', $hotel['facilities'] ?? ''); $rates = $hotel['rates'] ?? []; @endphp
@if (!empty($images) && count($images) > 1) @php $thumbnailImages = array_slice($images, 1, 4); $hasMoreImages = count($images) > 5; @endphp
@foreach ($thumbnailImages as $index => $image)
@if ($loop->last && $hasMoreImages)
+{{ count($images) - 5 }}
@endif
@endforeach
@endif

{{ $hotel['name'] ?? 'Hotel Name' }}

{{ $hotel['description'] }}

Address: {{ $hotel['address'] }}

Category: {{ $hotel['category'] ?? 'N/A' }} Star

{{-- City Code: {{ $hotel['city_code'] }}--}} Country: {{ $Countryname->name }}

Available Rooms & Rates

@php $hasBundle = collect($rates)->contains(function($rate) { return count($rate['rooms'] ?? []) > 1; }); $Com_Markup = DB::table('users')->where('id',1)->get(); $Age_Markup = []; $User_id = 0; if(Auth::user()->agency_id != ""){ $emp_id = Auth::user()->agency_id; $Age_Markup = DB::table('users')->where('id',$emp_id)->get(); }else{ $User_id = auth()->id(); } if(count($Com_Markup) && $User_id != 1 ){ $Com_Amt = $Com_Markup[0]->markup; $type = "percentage"; } if(count($Age_Markup) && $User_id != 1 && isset($emp_id)){ $Age_Amt = $Age_Markup[0]->markup; } $Lastval = end($hotel['rates']); if($Lastval['no_of_rooms'] == 1 ){ $isBundle = 1; $hasBundleval = 1; } @endphp @if($hasBundle)
@endif @php $maxRooms = 0; foreach($rates as $rate) { if(isset($rate['no_of_rooms']) && $rate['no_of_rooms'] > $maxRooms) { $maxRooms = $rate['no_of_rooms']; } } $Roomcount = $maxRooms; @endphp @foreach($rates as $rate) @if($Roomcount == $rate['no_of_rooms'] || isset($hasBundleval)) @php $rooms = $rate['rooms'] ?? []; $inclusions = $rate['other_inclusions'] ?? []; $price = $rate['price'] ?? 0; $board = implode(', ', $rate['boarding_details'] ?? []); $currency = $rate['currency'] ?? 'INR'; // Promo Discount $discountPercent = 0; $promoText = $rate['promotions_details'][0] ?? ''; if (preg_match('/(\d+)\s?%/', $promoText, $matches)) { $discountPercent = (int)$matches[1]; } // Price Calculation $val = $price; if ($discountPercent > 0) { $val = ceil($price / (1 - ($discountPercent / 100))); } $originalPrice1 = $val; // Tax & Surcharge $taxAmount = 0; $surchargeAmount = 0; foreach(($rate['price_details']['surcharge_or_tax'] ?? []) as $surcharge) { $surchargeAmount += $surcharge['amount'] ?? 0; $taxAmount += $surcharge['amount'] ?? 0; } $originalPrice = $price - $surchargeAmount; $price = $originalPrice; $isBundle = count($rooms) > 1; $bundleClass = $isBundle ? 'bundle-rate' : 'non-bundle-rate'; $val = 0 ; $P_val = 0 ; $O_val = 0; $val1 = 0 ; if (isset($Com_Amt)) { if ($type == "percentage") { $val1 = ($originalPrice1 * $Com_Amt) / 100; $val = ($price * $Com_Amt) / 100; } else { $val = $Com_Amt; } } $originalPrice1 = $originalPrice1 + $val1; $price = $price + $val; if (isset($Age_Amt) && isset($emp_id)) { $originalPrice1 = ($originalPrice1 * $Age_Amt) / 100 + $originalPrice1; $price = ($price * $Age_Amt) / 100 + $price; } // Refundability status //print_r($rate); $isNonRefundable = $rate['non_refundable']; $supportsCancellation = $rate['supports_cancellation'] ?? 0; //print_r($rate['cancellation_policy']['cancel_by_date']); if ($isNonRefundable == 1) { $refundText = "Non-Refundable"; $refundClass = "text-danger"; $refundIcon = "bi-x-circle-fill"; $badgeClass = "badge bg-danger"; } elseif ($isNonRefundable == 0 && isset($rate['cancellation_policy']['cancel_by_date'])) { $refundText = "Refundable"; $refundClass = "text-success"; $refundIcon = "bi-check-circle-fill"; $badgeClass = "badge bg-success"; } else { $refundText = "Partially Refundable"; $refundClass = "text-warning"; $refundIcon = "bi-exclamation-triangle-fill"; $badgeClass = "badge bg-warning text-dark"; } // Get rate comments $rateComments = $rate['rate_comments'] ?? []; $paxComments = $rateComments['pax_comments'] ?? ''; $remarks = $rateComments['remarks'] ?? ''; // Generate unique ID for accordion $accordionId = 'rateDetails' . uniqid(); @endphp {{-- ROOM RATE CARD --}}
{{-- Non-Refundable Badge on Top Right --}}
{{ $refundText }}
@if($isBundle) {{ count($rooms) }} Room Bundle

{{ $rooms[0]['description'] ?? 'Room' }} @else {{ $rooms[0]['description'] ?? 'Room' }} @endif
{{-- Room Details --}} @foreach($rooms as $index => $room)

Room {{ $index + 1 }}: {{ $room['description'] ?? 'Room' }}

{{ $room['no_of_adults'] }} Adults   {{ $room['no_of_children'] }} Children

@endforeach {{-- Meal Plan --}}

Meal Plan: {{ $board }}

{{-- Inclusions --}} @if(!empty($inclusions))
@foreach($inclusions as $incl)
{{ $incl }}

@endforeach
@endif {{-- Rate Details & Policies Accordion --}}
{{-- Price & Booking --}}
@if(strtolower($currency) == "inr") ₹ @endif {{ number_format($originalPrice1) }} {{ $currency }}
@if(strtolower($currency) == "inr") ₹ @endif {{ number_format($price) }} {{ $currency }}
@if($taxAmount > 0)
+ @if(strtolower($currency) == "inr") ₹ @endif {{ number_format($taxAmount, 2) }} taxes & fees
@else
Taxes included
@endif
agency_id !="") action="{{ route('employeepayment.initiaterecheck') }}" @else action="{{ route('payment.initiaterecheck') }}" @endif target="_blank" method="POST" style="margin-top: 12px;" > @csrf
@endif @endforeach
@foreach($rates as $index => $rate) @if($Roomcount != $rate['no_of_rooms']) @php $rooms = $rate['rooms'] ?? []; $roomcount = count($rooms); $inclusions = $rate['other_inclusions'] ?? []; $price = $rate['price'] ?? 0; $board = implode(', ', $rate['boarding_details'] ?? []); $currency = $rate['currency'] ?? 'INR'; // Refundability status $supportsCancellation = $rate['supports_cancellation']; $supportsAmendment = $rate['supports_amendment'] ?? 0; $paymentType = implode(', ', $rate['payment_type'] ?? []); $panRequired = $rate['pan_required'] ?? 0; $rateType = $rate['rate_type'] ?? ''; $childrenAges = $rooms[0]['children_ages'] ?? []; $cancellationPolicy = $rate['cancellation_policy'] ?? []; $hasPromotions = $rate['has_promotions'] ?? false; $paxComments = $rate['rate_comments']['pax_comments'] ?? ''; $isNonRefundable = $rate['non_refundable'] ?? 0; // Refund status text and styling //print_r($rate['cancellation_policy']['cancel_by_date']); if ($isNonRefundable == 1 ) { $refundText = "Non-Refundable"; $refundClass = "badge-danger"; $refundIcon = "bi-x-circle-fill"; } elseif ($isNonRefundable == 0 && isset($rate['cancellation_policy']['cancel_by_date'])) { $refundText = "Refundable"; $refundClass = "badge-success"; $refundIcon = "bi-check-circle-fill"; } else { $refundText = "Partially Refundable"; $refundClass = "badge-warning"; $refundIcon = "bi-exclamation-triangle-fill"; } // Promo Discount $discountPercent = 0; $promoText = $rate['promotions_details'][0] ?? ''; if (preg_match('/(\d+)\s?%/', $promoText, $matches)) { $discountPercent = (int)$matches[1]; } // Price Calculation $val = $price; if ($discountPercent > 0) { $val = ceil($price / (1 - ($discountPercent / 100))); } $originalPrice1 = ($val ?? 0); // Tax & Surcharge $taxAmount = 0; $surchargeAmount = 0; foreach(($rate['price_details']['surcharge_or_tax'] ?? []) as $surcharge) { $surchargeAmount += $surcharge['amount'] ?? 0; $taxAmount += $surcharge['amount'] ?? 0; } $taxAmount = ($taxAmount ?? 0); $originalPrice = $price - $surchargeAmount; $price = ($originalPrice ?? 0); //echo $price.'---'; $val = 0 ; $P_val = 0 ; $O_val = 0; $val1 = 0; if (isset($Com_Amt)) { if ($type == "percentage") { // Calculate percentage of original and discounted price $val1 = ($originalPrice1 * $Com_Amt) / 100; $val = ($price * $Com_Amt) / 100; } else { $val = $Com_Amt; } } $price = $price+$val; $originalPrice1 = $originalPrice1+$val1; if (isset($Age_Amt)) { $originalPrice1 = ($originalPrice1 * $Age_Amt) / 100 + $originalPrice1; $price = ($price * $Age_Amt) / 100 + $price; } @endphp @endif @endforeach

Hotel Facilities

@foreach($facilities as $f)
{{ trim($f) }}
@endforeach

Location

@endsection