<?php require_once "includes/sessions.php";
$Websettingsz1 = new Websettings();
$Webfooter_get1= $Websettingsz1->getAllContacts();
$webfooter_row1= $Webfooter_get1->fetch(PDO::FETCH_ASSOC);
$Websettings_get_about1= $Websettingsz1->getAllAbout();
$web_row_about1= $Websettings_get_about1->fetch(PDO::FETCH_ASSOC);
$Webslide_get= $Websettingsz1->getAllSlide();
$webslide_row= $Webslide_get->fetch(PDO::FETCH_ASSOC);
$bg = 'admin/panel/uploads/slides/'.DecryptInput($webslide_row['image1']);
$active="Room";
if (isset($_GET['Enc'])) {
$roomID=DecryptInputurl($_GET['Enc']);
$ima2 = New Images();
$room = New Room();
$room_getDetails2= $room->getSingleRoom($roomID);
$room_row2= $room_getDetails2->fetch(PDO::FETCH_ASSOC);
$roomget22= $ima2->getRoomimages($roomID);
$roomget33= $ima2->getRoomimages($roomID);
}
else{
header("Location: index.php");
}
?>
<!doctype html>
<html class="no-js" lang="eng">
<head>
<title>Z Village Lodge - Zanzibar - Book Your Garden view Lodge in Paje</title>
<?php include_once("includes/meta.includes.php");?>
<style>
.tbl-price table {
width: 100%;
border-collapse: collapse;
border: 1px solid #ddd;
font-family: Arial, sans-serif;
color: #333;
}
.tbl-price td {
width: 50%;
padding: 12px;
font-size: 1rem;
font-weight: bold;
background-color: #f4f4f4;
}
.tbl-price input {
font-size: 120%;
font-weight: bolder ;
width: 10%;
float: left
text-align: center;
border: none;
border-radius: 4px;
padding: 5px;
font-weight: bold;
}
.tbl-price input:disabled {
background-color: transparent;
border: 0px;
padding: 0px;
font-weight: bold;
}
.tbl-price td input {
font-weight: normal;
}
.tbl-price .header-cell {
background-color: #f4f4f4;
font-weight: bold;
}
.tbl-price .value-cell {
text-align: center;
font-weight: bold;
}
</style>
</head>
<body>
<!--[if lte IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- preloader start -->
<!-- <div id="preloader">
<div class="preloader-close">x</div>
<div class="sk-three-bounce">
<div class="sk-child sk-bounce1"></div>
<div class="sk-child sk-bounce2"></div>
<div class="sk-child sk-bounce3"></div>
</div>
</div> -->
<!-- preloader start -->
<!-- Backtotop start -->
<div class="backtotop-wrap cursor-pointer">
<svg class="backtotop-circle svg-content" width="100%" height="100%" viewBox="-1 -1 102 102">
<path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98" />
</svg>
</div>
<!-- Backtotop end -->
<!-- Offcanvas area start -->
<?php include_once("includes/Offcanvas.includes.php");?>
<!-- Offcanvas area start -->
<!-- Header area start -->
<?php include_once("includes/header-2.includes.php");?>
<main>
<div class="breadcrumb__area dark-green breadcrumb-space overflow-hidden position-relative z-1" data-background="<?=$bg;?>">
<div class="breadcrumb__shapes">
<img class="upDown" src="assets/imgs/breadcrumb/shape.png" alt="img not found">
</div>
<div class="container">
<div class="row align-items-center justify-content-between">
<div class="col-12">
<div class="breadcrumb__content">
<div class="breadcrumb__title-wrapper mb-15 mb-sm-10 mb-xs-5">
<h1 class="breadcrumb__title color-white wow fadeInLeft animated" data-wow-delay=".2s">Room Details</h1>
</div>
<div class="breadcrumb__menu wow fadeInLeft animated" data-wow-delay=".4s">
<nav>
<ul>
<li><span><a href="index.php">Home</a></span></li>
<li class="active"><span>Room Details</span></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<!--room-details-->
<section class="room-details__area section-space">
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="room-details__wrapper">
<!-- <div class="room-details__thumb">
<img src="assets/imgs/inner-page-img/room-detils-img-1.png" alt="img not found">
</div> -->
<!-- ========================================================================== -->
<!-- ======================================== -->
<section class="splide" aria-labelledby="carousel-heading">
<div class="splide__track">
<ul class="splide__list">
<?php
$n=0;
while($tour_row22 = $roomget22->fetch(PDO::FETCH_ASSOC)){
//$fl ="admin/panel/uploads/images/zanzibar excursion--99574390-1642165273.jpg";
$fl = "admin/panel/uploads/hotel/".DecryptInput($tour_row22['pic']);
//var_dump($fl);
if (file_exists($fl)) {
$tourimageNamefile = $fl;
if ($n==0) {
?>
<li class="splide__slide">
<div class="room-details__thumb" style="background-image: url('<?=$tourimageNamefile;?>'); background-position: center; height: 380px; background-repeat: no-repeat; background-size: contain;">
</div>
</li>
<?php
}else{
?>
<li class="splide__slide">
<div class="room-details__thumb" style="background-image: url('<?=$tourimageNamefile;?>'); background-position: center; height: 380px; background-repeat: no-repeat; background-size: contain;">
</div>
</li>
<?php
}
}
$n++;
}
?>
</ul>
</div>
</section>
<!-- ================================================== -->
<script>
new Splide( '.splide' ).mount();
</script>
<!-- ========================================================================== -->
<div class="room-details__star-wrap mt-30">
<div class="room-details__cat">
<?php include_once("includes/bedtype.svg.includes.php");?>
<div class="room-details__cat-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.0935 4.75H6.125C5.89294 4.75 5.67038 4.84219 5.50628 5.00628C5.34219 5.17038 5.25 5.39294 5.25 5.625V19.875C5.25 20.3585 5.642 20.75 6.125 20.75H17.875C18.1071 20.75 18.3296 20.6578 18.4937 20.4937C18.6578 20.3296 18.75 20.1071 18.75 19.875V5.625C18.75 5.39294 18.6578 5.17038 18.4937 5.00628C18.3296 4.84219 18.1071 4.75 17.875 4.75H15.9065C15.7727 5.18433 15.5032 5.56434 15.1376 5.8343C14.772 6.10426 14.3295 6.24995 13.875 6.25H10.125C9.67052 6.24995 9.22802 6.10426 8.86241 5.8343C8.4968 5.56434 8.22732 5.18433 8.0935 4.75ZM15.9065 3.5H17.875C18.4386 3.5 18.9791 3.72388 19.3776 4.1224C19.7761 4.52091 20 5.06141 20 5.625V19.875C20 20.4386 19.7761 20.9791 19.3776 21.3776C18.9791 21.7761 18.4386 22 17.875 22H6.125C5.56141 22 5.02091 21.7761 4.6224 21.3776C4.22388 20.9791 4 20.4386 4 19.875V5.625C4 5.06141 4.22388 4.52091 4.6224 4.1224C5.02091 3.72388 5.56141 3.5 6.125 3.5H8.0935C8.22732 3.06567 8.4968 2.68566 8.86241 2.4157C9.22802 2.14574 9.67052 2.00005 10.125 2H13.875C14.3295 2.00005 14.772 2.14574 15.1376 2.4157C15.5032 2.68566 15.7727 3.06567 15.9065 3.5ZM9.25 4.125C9.25 4.608 9.642 5 10.125 5H13.875C13.9899 5 14.1037 4.97737 14.2098 4.93339C14.316 4.88942 14.4125 4.82497 14.4937 4.74372C14.575 4.66247 14.6394 4.56601 14.6834 4.45985C14.7274 4.35369 14.75 4.23991 14.75 4.125C14.75 4.01009 14.7274 3.89631 14.6834 3.79015C14.6394 3.68399 14.575 3.58753 14.4937 3.50628C14.4125 3.42503 14.316 3.36058 14.2098 3.31661C14.1037 3.27263 13.9899 3.25 13.875 3.25H10.125C9.89294 3.25 9.67038 3.34219 9.50628 3.50628C9.34219 3.67038 9.25 3.89294 9.25 4.125ZM12 8.75C11.6022 8.75 11.2206 8.90804 10.9393 9.18934C10.658 9.47064 10.5 9.85218 10.5 10.25C10.5 10.6478 10.658 11.0294 10.9393 11.3107C11.2206 11.592 11.6022 11.75 12 11.75C12.3978 11.75 12.7794 11.592 13.0607 11.3107C13.342 11.0294 13.5 10.6478 13.5 10.25C13.5 9.85218 13.342 9.47064 13.0607 9.18934C12.7794 8.90804 12.3978 8.75 12 8.75ZM9.25 10.25C9.25 9.52065 9.53973 8.82118 10.0555 8.30546C10.5712 7.78973 11.2707 7.5 12 7.5C12.7293 7.5 13.4288 7.78973 13.9445 8.30546C14.4603 8.82118 14.75 9.52065 14.75 10.25C14.75 10.9793 14.4603 11.6788 13.9445 12.1945C13.4288 12.7103 12.7293 13 12 13C11.2707 13 10.5712 12.7103 10.0555 12.1945C9.53973 11.6788 9.25 10.9793 9.25 10.25ZM8.25 15.9C8.25 15.7276 8.31848 15.5623 8.44038 15.4404C8.56228 15.3185 8.72761 15.25 8.9 15.25H15.1C15.2724 15.25 15.4377 15.3185 15.5596 15.4404C15.6815 15.5623 15.75 15.7276 15.75 15.9C15.75 16.6285 15.4115 17.185 14.787 17.586C14.1385 18.003 13.175 18.25 12 18.25C10.825 18.25 9.8615 18.003 9.213 17.586C8.5885 17.185 8.25 16.6285 8.25 15.9ZM8.9 14C8.39609 14 7.91282 14.2002 7.5565 14.5565C7.20018 14.9128 7 15.3961 7 15.9C7 17.1035 7.599 18.035 8.537 18.6375C9.451 19.2255 10.675 19.5 12 19.5C13.325 19.5 14.549 19.225 15.463 18.6375C16.401 18.035 17 17.1035 17 15.9C17 15.6505 16.9509 15.4034 16.8554 15.1729C16.7599 14.9424 16.6199 14.7329 16.4435 14.5565C16.2671 14.3801 16.0576 14.2401 15.8271 14.1446C15.5966 14.0491 15.3495 14 15.1 14H8.9Z" fill="#0E1730"/>
</svg>
<span><?=$room_row2['maxPeople']; ?> Guest</span>
</div>
</div>
<div class="room-details__content-box-star">
<?=str_repeat('<i class="fa-solid fa-star"></i>', $room_row2['roomstarRating']); ?>
</div>
</div>
<h2 class="room-details__title mt-20"><?=DecryptInput($room_row2['roomName']); ?></h2>
<h3 class="room-details__dolar-title mt-20 mb-20">
<?php
$offerPriceResult = checkOfferPrice($room_row2['roomID']);
// Check the success value returned by the function
if ($offerPriceResult['success'] == 1) {
// Success case
?>
<span class="dolar">
<strike style="font-size: 50%;"> $<?=$room_row2['roomPrice']; ?> </strike>
$<?=$room_row2['offerPrice']; ?>
</span>
<span class="span"><?=DecryptInput($room_row2['priceType']); ?></span>
<?php
} elseif ($offerPriceResult['success'] == 0) {
// No offer case
?>
<span class="dolar">$<?=$room_row2['roomPrice']; ?> </span>
<span class="span"><?=DecryptInput($room_row2['priceType']); ?></span>
<?php
}
//var_dump(checkOfferPrice($room_row2['roomID'][0]));?>
</h3>
<p class="room-details__dec"><?=strip_tags($room_row2['Roomdescription']) ; ?></p>
<h3 class="room-details__sm-title mt-20 mb-20">Room Amenities</h3>
<div class="room-details__list">
<div class="room-details__list-item">
<ul class="row">
<?php
if(DecryptInput($room_row2['Airconditioning'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Airconditioning']).'</li>';
}
if($room_row2['Terrace']!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Terrace']).'</li>';
}
if(DecryptInput($room_row2['TV'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['TV']).'</li>';
}
if(DecryptInput($room_row2['Hairdryer'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Hairdryer']).'</li>';
}
if(DecryptInput($room_row2['Ensuitebathroom'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Ensuitebathroom']).'</li>';
}
if(DecryptInput($room_row2['parking'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['parking']).'</li>';
}
if(DecryptInput($room_row2['water'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['water']).'</li>';
}
if(DecryptInput($room_row2['Telephone'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Telephone']).'</li>';
}
if(DecryptInput($room_row2['closet'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['closet']).'</li>';
}
if(DecryptInput($room_row2['Refrigerator'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Refrigerator']).'</li>';
}
if(DecryptInput($room_row2['net'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['net']).'</li>';
}
if(DecryptInput($room_row2['Fan'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Fan']).'</li>';
}
if(DecryptInput($room_row2['Balcony'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Balcony']).'</li>';
}
if(DecryptInput($room_row2['Safety'])!=''){
echo '<li class="col-md-6">'.DecryptInput($room_row2['Safety']).'</li>';
}
if(DecryptInput($room_row2['Towels'])!=''){
echo '<li class="col-md-6"><i class="fa-solid fa-chevrons-right"></i>'.DecryptInput($room_row2['Towels']).'</li>';
}
?>
</ul>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="room-details__sidebar">
<h3 class="room-details__sidebar-title">Reserve</h3>
<h4 class="room-details__sidebar-dolar">
<form method="post" action="contact.php">
<input type="hidden" id="pricetype" name="pricetype" value="<?=DecryptInput($room_row2['priceType']); ?>">
<input type="hidden" id="roomID" name="roomID" value="<?=$roomID; ?>">
<input type="hidden" id="totalPrice" name="totalPrice" value="0">
<input type="hidden" id="roomName" name="roomName" value="<?=DecryptInput($room_row2['roomName']);?>">
<?php
$offerPriceResult = checkOfferPrice($room_row2['roomID']);
// Check the success value returned by the function
if ($offerPriceResult['success'] == 1) {
// Success case
?>
<input style="font-style: bold; font-size: 150%; width: 50%;" type="text" disabled id="priceToBe" name="priceToBe" value="$<?=$room_row2['offerPrice']; ?>">
<input style="font-style: bold; font-size: 150%; width: 50%;" type="hidden" disabled id="priceToBe1" name="priceToBe1" value="$<?=$room_row2['offerPrice']; ?>">
<input style="font-style: bold; font-size: 150%; width: 50%;" type="hidden" disabled id="offer" name="offer" value="1">
<span >/<?=DecryptInput($room_row2['priceType']); ?></span>
<?php
} elseif ($offerPriceResult['success'] == 0) {
// No offer case
?>
<input style="font-style: bold; font-size: 150%; width: 50%;" type="text" disabled id="priceToBe" name="priceToBe" value="$<?=$room_row2['roomPrice']; ?>">
<input style="font-style: bold; font-size: 150%; width: 50%;" type="hidden" disabled id="priceToBe1" name="priceToBe1" value="$<?=$room_row2['roomPrice']; ?>">
/<span><?=DecryptInput($room_row2['priceType']); ?></span>
<table class="tbl-price">
<tr>
<td class="header-cell">Get a discount of:</td>
<td class="value-cell">
<input type="text" disabled id="disRate" name="disRate" value="<?=$room_row2['discountRate']; ?>"> %
</td>
</tr>
<?php if($room_row2['discountNights'] > 0){ ?>
<tr>
<td class="header-cell">When Nights Exceeds:</td>
<td class="value-cell">
<input type="text" disabled id="discountNights" name="discountNights" value="<?=$room_row2['discountNights']-1; ?>">
</td>
</tr>
<?php } else if($room_row2['discountAdults'] > 0){ ?>
<tr>
<td class="header-cell">When Adults are:</td>
<td class="value-cell">
<input type="text" disabled id="discountAdults" name="discountAdults" value="<?=$room_row2['discountAdults']; ?>">
</td>
</tr>
<?php } ?>
</table>
<input style="font-style: bold; font-size: 150%; width: 50%;" type="hidden" disabled id="offer" name="offer" value="0">
<br>
<?php
}
//var_dump($room_row2);?>
</h4>
<!-- <div class="form-group">
<label> </label>
<button type="submit" name="bookroom" class="theme-btn btn-style-one"><span class="txt">Request Price</span></button>
</div> -->
<input type="hidden" name="Enc" value="<?=$_GET['Enc'];?>">
<div class="room-details__sidebar-item">
<div class="room-details-seclect">
<h4 class="title">Check in</h4>
</div>
<div class="sidebar-right-info">
<input class="room-details__form" id="datepicker" name="Checkinn" type="text" placeholder="dd/mm/yyyy">
</div>
</div>
<div class="room-details__sidebar-item">
<div class="room-details-seclect">
<h4 class="title">Check Out</h4>
</div>
<div class="sidebar-right-info">
<input class="room-details__form" id="datepicker1" name="Checkout" type="text" placeholder="dd/mm/yyyy">
</div>
</div>
<div class="room-details__sidebar-item">
<div class="room-details-seclect">
<h4 class="title">Adults</h4>
</div>
<div class="sidebar-right-info">
<input class="room-details__form" id="Adults" value="1" max="5" name="Adults" type="number" placeholder="">
</div>
</div>
<div class="room-details__sidebar-item">
<div class="room-details-seclect">
<h4 class="title">Kids</h4>
</div>
<div class="sidebar-right-info">
<input class="room-details__form" min="0" max="5" value="0" id="Kids" name="Kids" type="number" placeholder="">
</div>
</div>
<!-- <div class="room-details__total__info">
<h4>Total Cost & Availalbility will be shared <i class="fa-regular fa-angle-down"></i></h4>
<h4></h4>
</div> -->
<div class="room_btn2">
<button type="submit" name="bookroom" class="room_btn2" > Book Now <i class="fa-regular btn fa-arrow-right"></i> </button>
</div>
</form>
</div>
</div>
<!--accomodation section-->
<?php include_once("includes/accomodation.includes.php");?>
<!--gallery section-->
<!-- include_once("includes/restaurant.includes.php") -->
</div>
</div>
</section>
</main>
<div id="scroll-percentage"><span id="scroll-percentage-value"></span></div>
<!-- Footer area start -->
<?php include_once("includes/footer.includes.php");?>
<!-- Footer area end -->
<!-- JS here -->
</body>
<!-- Mirrored from html.sthemeit.com/boostay/room-details.html by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 29 Dec 2024 09:31:15 GMT -->
</html>
<script>
// Get tomorrow's date
const tomorrow = new Date();
const tomorrowButOne = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrowButOne.setDate(tomorrowButOne.getDate() + 2);
// Format the date as DD/MM/YYYY for the input value
const formattedDate = formatDate(tomorrow);
const formattedDate2 = formatDate(tomorrowButOne);
function formatDate(date) {
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${month}/${day}/${year}`;
}
// Set the input value to tomorrow's date
document.getElementById('datepicker').value = formattedDate;
document.getElementById('datepicker1').value = formattedDate2;
$(document).ready(function() {
let basePrice = parseFloat($("#priceToBe1").val().replace('$', ''));
let adults = parseInt($("#Adults").val());
let kids = parseInt($("#Kids").val()) || 0;
let checkinDate = $("#datepicker").val();
let checkoutDate = $("#datepicker1").val();
let pricetype = $("#pricetype").val();
let offer = $("#offer").val();
$("#Adults").on("keyup", function( event ) {
let adults0 = parseInt($("#Adults").val());
if (!isNaN(adults0) && adults0 >0) {
adults = adults0;
} else {
adults = 0;
}
//event.preventDefault();
updatePrice();
});
$("#datepicker, #datepicker1").on("change", function() {
checkinDate = $("#datepicker").val();
checkoutDate = $("#datepicker1").val();
adults = parseInt($("#Adults").val());
updatePrice();
});
function getDateDiff() {
const checkin = new Date(checkinDate);
const checkout = new Date(checkoutDate);
const timeDifference = checkout.getTime() - checkin.getTime();
const daysDifference = timeDifference / (1000 * 3600 * 24); // Convert milliseconds to days
return daysDifference;
}
function updatePrice() {
const daysDifference = getDateDiff();
let totalPrice = 0;
// check if price is on offer
if (offer == 1) {
// if price is on offer dont use discount
if (pricetype == "Price Per Night") {
totalPrice = basePrice * daysDifference;
//alert("one");
}
else if(pricetype == "Price Per Person") {
totalPrice = (adults * basePrice) * daysDifference;
//alert("Two, adults:" + adults);
}
}else{// price not on offer
// if price is not on offer get discount rate
// and check if number of nights is zero or not
let disRate = $("#disRate").val();
let disNight = parseInt($("#discountNights").val()) || 0;
let disAdults = parseInt($("#discountAdults").val()) || 0;
// check if price has discount by nights
// also check that the days are equavalant to discount
if (disRate!==0 && disNight !== 0 && daysDifference>=disNight) {
// check if number of nights for user == disnight
if (pricetype == "Price Per Night") {
// baseprice *
totalPrice = (basePrice * daysDifference) - ((basePrice * daysDifference)*disRate/100);
//alert("one");
}
else if(pricetype == "Price Per Person") {
totalPrice = ((adults * basePrice) * daysDifference) - (((adults * basePrice) * daysDifference)*disRate/100);
//alert("Two, adults:" + adults);
}
}
else if (disRate!==0 && disNight == 0 && adults>=disAdults) {
//alert(adults);
if (pricetype == "Price Per Night") {
// baseprice *
totalPrice = (basePrice * daysDifference) - ((basePrice * daysDifference)*disRate/100);
//alert("one");
}
else if(pricetype == "Price Per Person") {
totalPrice = ((adults * basePrice) * daysDifference) - (((adults * basePrice) * daysDifference)*disRate/100);
//alert("Two, adults:" + adults);
}
}
else {
if (pricetype == "Price Per Night") {
// baseprice *
totalPrice = basePrice * daysDifference;
//alert("one");
}
else if(pricetype == "Price Per Person") {
totalPrice = (adults * basePrice) * daysDifference;
//alert("Two, adults:" + adults);
}
}
}
const formattedPrice = "$" + totalPrice.toFixed(2);
$("#priceToBe").val(formattedPrice);
$("#totalPrice").val(formattedPrice);
}
//updatePrice();
});
</script>