Server : LiteSpeed System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64 User : u615232177 ( 615232177) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/u615232177/domains/debutlers.com/public_html/ |
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']);
include("header.php"); ?>
<title><?php echo $company_name; ?> - Payment</title>
<?php
$msg='';$captcha_error=""; $errors=0;
if (isset($_GET["save"])) {
if($errors == 0){
$first_name = mysqli_real_escape_string($con,$_GET['first_name']);
$last_name = mysqli_real_escape_string($con,$_GET['last_name']);
$email = mysqli_real_escape_string($con,$_GET['email']);
$phone = mysqli_real_escape_string($con,$_GET['phone']);
$room = mysqli_real_escape_string($con,$_GET['room']);
$check_in_raw = mysqli_real_escape_string($con,$_GET['check_in']);
$check_out_raw = mysqli_real_escape_string($con,$_GET['check_out']);
$fine_date = date("H:i:s Y-m-d");
$check_in_formatted1=date_create("$check_in_raw");
$check_in_format = date_format($check_in_formatted1,"D,dS M, Y");
$check_out_formatted1=date_create("$check_out_raw");
$check_out_format = date_format($check_out_formatted1,"D,dS M, Y");
//convert date to Y-mm-dd
$DateTime = new DateTime($check_in_raw);
$check_in = $DateTime->format('Y-m-d');
$DateTime1 = new DateTime($check_out_raw);
$check_out = $DateTime1->format('Y-m-d');
//get array of dates to see if anyone has booked them
$period = new DatePeriod(
new DateTime("$check_in"),
new DateInterval('P1D'),
new DateTime("$check_out")
);
//DatePeriod actually returns an object so create a new array from $period
// also create the 2 other arrays, one for dates from db the other to show user if date is unavailable.
$arr_chosen=[];
$arr_db=[];
$unavailable_dates=[];
foreach ($period as $key => $value) {
array_push($arr_chosen,$value->format('Y-m-d'));
}
//number of days, not sure we even need it
$no_days = count($arr_chosen);
if($no_days > 13){$discount = 12;$discount_text="Regular Discount";}
elseif($no_days > 29){$discount = 15;$discount_text="Super Discount";}
else{$discount = 10;$discount_text="Loyal Discount";}
if($no_days == 1){$s ="";}
else{$s="s";}
//check database and get dates from this room that have been approved.
$yes = "Yes";
$stmt_reser = $con -> prepare('SELECT check_in,check_out FROM reservations WHERE room=? AND approved = ?');
$stmt_reser -> bind_param('ss',$room,$yes);
$stmt_reser -> execute();
$stmt_reser -> store_result();
$stmt_reser -> bind_result($check_in_db,$check_out_db);
$numrows_reser = $stmt_reser -> num_rows();
if($numrows_reser > 0){
while ($stmt_reser -> fetch()) {
//get array of dates from db
$period_db = new DatePeriod(
new DateTime("$check_in_db"),
new DateInterval('P1D'),
new DateTime("$check_out_db")
);
//its actually an object, so create a new array from period_db
foreach ($period_db as $key_db => $value_db) {
array_push($arr_db,$value_db->format('Y-m-d'));
}
//check to see if there are any dates in common
$clashing_dates = array_intersect($arr_chosen,$arr_db);
if(count($clashing_dates) > 0){
foreach ($clashing_dates as $key_db1 => $value_db1) {
array_push($unavailable_dates,$value_db1);
}
$unavailable_dates_string = implode(" ",$unavailable_dates);
//$_SESSION["action"] = "true";
//$message="$unavailable_dates_string already booked.";
//echo "<meta http-equiv=\"refresh\" content=\"0; url=failure.php?u=index.php&m=$message\">";
//exit();
}
}
}
}
}
else{echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php\">";exit();}
?>
<section class="page-header">
<div class="page-header__bg" style="background-image: url(site_img/general/<?php echo "$gen_img[8]"; ?>);"></div>
<div class="container">
<img src="assets/images/shapes/page-header-s-1.png" alt="About Us" class="page-header__shape">
<h2 class="page-header__title">Booking Summary</h2>
<ul class="solinom-breadcrumb list-unstyled">
<li><a href="index.php">Home</a></li>
<li><span>Reservations</span></li>
</ul>
</div>
</section>
<!-- About Section Start -->
<div class="about-one">
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="room-details__item wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='300ms'>
<h3>Review Your Booking</h3>
<div class="room-details__amenities">
<?php
$stmt = $con -> prepare('SELECT * FROM rooms WHERE id=?');
$stmt -> bind_param('i',$room);
$stmt -> execute();
$stmt -> store_result();
$stmt -> bind_result($room_id,$header,$paragraph,$price,$feature1,$feature2,$feature3,$feature4,$feature5,$picture1,$picture2,$picture3,$picture4,$f,$feature1_wu,$feature2_wu,$feature3_wu,$feature4_wu,$feature5_wu,$number_rooms,$discount_f);
$numrows = $stmt -> num_rows();
if($numrows > 0){
while ($stmt -> fetch()) { }
}
echo "
<ul class='room-details__amenities__list list-unstyled'>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Name</strong>: $first_name $last_name</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Email</strong>: $email</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Phone</strong>: $phone</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Check in</strong>: $check_in_format</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Check out</strong>: $check_out_format</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Duration</strong>: $no_days night$s</li>
<li class='room-details__amenities__item'><i class='icon-mark'></i><strong>Room</strong>: $header</li>
</ul>
"; ?>
<br/><br/>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="about-one__content wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='300ms'>
<h3>Please Read Carefully Before Booking</h3><br/>
<div style='line-height:15px;'>
<b>No Refunds on Reservations</b> <br>
All reservations made on our website are non-refundable. Once a booking is confirmed, the payment is final, and no refunds will be issued in the event of cancellation or modification. <br><br>
<b>Changes to Booking Dates</b> <br>
Due to our strict policy, we are unable to accommodate changes to booking dates once the reservation is confirmed. Please ensure the accuracy of your booking details before completing your reservation. <br><br>
<b>Exceptions</b> <br>
Refunds or changes to bookings may only be considered under extenuating circumstances at the discretion of hotel management. However, this does not guarantee a refund or modification. <br><br>
<b>Booking Accuracy</b> <br>
We encourage all guests to review their booking information carefully before submitting. Any errors in dates, room types, or other booking details cannot be adjusted after confirmation without penalty. <br><br>
By proceeding with your booking, you agree to these terms and acknowledge that this reservation is final and non-refundable.</div>
<hr>
<?php
//get price
//calculate discount
//$percentInDecimal = $discount / 100;
//$percent = $percentInDecimal * $total;
//$discounted_price = $total - $percent;
if($discount_f == ""){
$total = $price * $no_days;
echo"<span style='text-decoration:;color:#333;'>$currency";
echo number_format((float)$price, 2, '.', ',');echo" (Per Night)</span>";
echo"<br><span style='text-decoration:;color:#333;'>$currency";
echo number_format((float)$price, 2, '.', ',');echo" x $no_days = $currency";echo number_format($total);echo" (For $no_days night$s)</span>";
}
if($discount_f !== ""){
$amount_to_remove = calculatePercentageOfNumber($price, $discount_f);
$discounted_price = $price - $amount_to_remove;
$total = $discounted_price * $no_days;
echo"<span style='text-decoration:;color:#333;'>$currency";
echo number_format((float)$discounted_price, 2, '.', ',');echo" (Per Night)</span>";
echo"<br><span style='text-decoration:;color:#333;'>$currency";
echo number_format((float)$discounted_price, 2, '.', ',');echo" x $no_days = $currency";echo number_format($total);echo" (For $no_days night$s)</span>";
}
//echo"<br><span style='text-decoration:;color:forestgreen;'>- ₦";
//echo number_format($percent);echo" ($discount_text - $discount%)</span>";
/*echo"
<br/><span style='color:forestgreen;'>₦"; echo number_format($discounted_price); echo" (To pay)</span>
";*/
?>
<br/><br/>
<!--<div style='float:left;width:25%;'>
<img src='img/fn.png' style='width:80px;height:80px;border-radius:5px;'>
</div>
<div style='float:right;width:70%;position:relative;top:-10px;'>
Kindly make the payment of ₦<?php echo number_format($discounted_price); ?> ONLY to<br/>
<b>Guaranty Trust Bank<b><br>
Account Name: <b>Frengeda Ventures</b><br/>
Account Number: <b>0030718460</b>
</div>-->
<div class="booking-form">
<form action="payment_transfer.php" method="post" style='clear:both;'>
<input type='hidden' name='name' value='<?php echo "$first_name $last_name"; ?>'>
<input type='hidden' name='email' value='<?php echo $email; ?>'>
<input type='hidden' name ='phone' value='<?php echo $phone; ?>'>
<input type='hidden' name='room' value='<?php echo $room; ?>'>
<input type='hidden' name='check_in' value='<?php echo $check_in_raw; ?>'>
<input type='hidden' name='check_out' value='<?php echo $check_out_raw; ?>'>
<input type='hidden' name='fine_date' value='<?php echo $fine_date; ?>'>
<input type='hidden' name='amount' value='<?php echo $total; ?>'>
<input type='hidden' name='header' value='<?php echo $header; ?>'>
<button type="submit" name='pay' class="about-one__btn solinom-btn solinom-btn--base">Confirm</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- About Section End -->
<?php include("footer.php"); ?>