
@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 }}
@foreach ($images as $key => $image)
@endforeach
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 --}}
Cancellation
{{ $supportsCancellation ? 'Allowed' : 'Not Allowed' }}
Amendments
{{ ($rate['supports_amendment'] ?? 0) ? 'Allowed' : 'Not Allowed' }}
Payment Type
{{ !empty($rate['payment_type']) ? implode(', ', $rate['payment_type']) : 'Flexible' }}
@if($rate['pan_required'] == 1)
@endif
@if(!empty($rate['promotions_details'][0]))
Special Offer: {{ $rate['promotions_details'][0] }}
@endif
{{-- Rate Comments Section --}}
@if(!empty($paxComments) || !empty($remarks))
@if(!empty($paxComments))
@endif
@if(!empty($remarks))
@endif
@endif
{{-- 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
@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
{{ $rooms[0]['description'] ?? 'Room' }}
{{-- Refund Status Badge --}}
{{ $refundText }}
{{-- Room Count and Occupancy --}}
No Of Rooms: {{ $rate['no_of_rooms'] }}
{{ $rate['rooms'][0]['no_of_adults'] ?? 0 }} Adults
@if(($rate['rooms'][0]['no_of_children'] ?? 0) > 0)
{{ $rate['rooms'][0]['no_of_children'] }} Children
@endif
{{-- Children Ages --}}
@if(!empty($childrenAges))
Children ages: {{ implode(', ', $childrenAges) }}
@endif
{{-- Meal Plan --}}
Meal Plan: {{ $board }}
{{-- Quick Policy Info --}}
Cancellation: {{ $supportsCancellation ? 'Yes' : 'No' }}
Amendments: {{ $supportsAmendment ? 'Yes' : 'No' }}
Payment: {{ $paymentType }}
@if($panRequired == 1 || $panRequired == "Yes")
PAN: {{ $panRequired ? 'Required' : 'Not Required' }}
@endif
{{-- Inclusions --}}
@if(!empty($inclusions))
Inclusions:
@foreach($inclusions as $incl)
{{ $incl }}
@endforeach
@endif
{{-- Pax Comments --}}
@if(!empty($paxComments))
@endif
{{-- Cancellation Policy Preview --}}
@if(isset($cancellationPolicy['detailss']))
@foreach($cancellationPolicy['details'] as $detail)
From {{ date('M d, Y', strtotime($detail['from'])) }}:
{{ $detail['currency'] }} {{ $detail['flat_fee'] }}
@endforeach
@if(!empty($cancellationPolicy['no_show_fee']))
No-show fee: {{ $cancellationPolicy['no_show_fee']['currency'] ?? '' }} {{ $cancellationPolicy['no_show_fee']['flat_fee'] ?? '' }}
@endif
@endif
{{-- Remarks --}}
@if(!empty($rate['rate_comments']['remarks']))
Remarks: {!! $rate['rate_comments']['remarks'] !!}
@endif
@if(strtolower($currency) == "inr") ₹ @endif {{ number_format($originalPrice1) }}
@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
@endif
@endforeach