setup shutdown booking functionality for client side
This commit is contained in:
parent
02edcd600b
commit
e6a1151759
3 changed files with 49 additions and 19 deletions
|
@ -126,6 +126,10 @@
|
|||
$cover_res = mysqli_fetch_assoc($cover_q);
|
||||
$room_cover = ROOM_IMG_PATH.$cover_res['image'];
|
||||
}
|
||||
$booking = "";
|
||||
if(!$settings_r['shutdown']){
|
||||
$booking = "<a href='#' class='btn-main d-block mb-2' style='font-size: 14px;'>Book</a>";
|
||||
}
|
||||
//display room (---**accommodation section did not use from database**---)
|
||||
echo <<< data
|
||||
<div class="card mb-3 shadow">
|
||||
|
@ -154,7 +158,7 @@
|
|||
</div>
|
||||
<div class="col-md-1">
|
||||
<p class="mb-4 text-center mt-lg-0 mt-4" style="font-size: 14px;">$$room_data[price]/night</p>
|
||||
<a href="#" class="btn-main d-block mb-2" style="font-size: 14px;">Book</a>
|
||||
$booking
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
<?php
|
||||
require('admin/components/db_config.php');
|
||||
require('admin/components/utils.php');
|
||||
|
||||
|
||||
$settings_q = "SELECT * FROM `settings` WHERE `sr_no`=?";
|
||||
$values = [1];
|
||||
$settings_r = mysqli_fetch_assoc(select($settings_q, $values, 'i'));
|
||||
if($settings_r['shutdown']){
|
||||
echo <<<data
|
||||
<div class="text-center p-1" style="background-color: red; z-index: 100; color: white; font-weight: 600;">
|
||||
Bookings are temporarily closed!
|
||||
</div>
|
||||
data;
|
||||
}
|
||||
?>
|
||||
|
||||
<!--Navbar section (bootstrap)-->
|
||||
<div class="wrap w-100">
|
||||
<div class="row align-items-center m-0 d-none d-md-flex sticky-top">
|
||||
|
@ -93,12 +106,32 @@
|
|||
<li class="nav-item">
|
||||
<a href="../contact.php" class="nav-link">Contact</a>
|
||||
</li>
|
||||
<li style="padding-top: 50px">
|
||||
<buton type="button" class="nav-link btn shadow-none" data-bs-toggle="modal" data-bs-target="#loginBackdrop" style="border: 1px solid white; font-weight: 500; color: white;">Login</button>
|
||||
</li>
|
||||
<li style="padding-top: 5px">
|
||||
<buton type="button" class="nav-link btn shadow-none" data-bs-toggle="modal" data-bs-target="#registerBackdrop" style="background-color: #EEEEEE; font-weight: 500; color: black;">Register</button>
|
||||
</li>
|
||||
<?php
|
||||
if(isset($_SESSION['login']) && $_SESSION['login'] == true){
|
||||
echo <<<data
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false" style="outline: none; box-shadow: none;">
|
||||
$_SESSION[userName]
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-lg-end">
|
||||
<li><a href="profile.php" class="dropdown-item" style="color: black;">Profile</a></li>
|
||||
<li><a href="user_booking.php" class="dropdown-item" style="color: black;">Booking</a></li>
|
||||
<li><a href="logout.php" class="dropdown-item" style="color: black;">Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
data;
|
||||
} else{
|
||||
echo <<<data
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-secondary dropdown-toggle" style="outline: none; box-shadow: none; background-color: transparent;" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">Join</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink" style="background-color: #272829;">
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="modal" data-bs-target="#loginBackdrop" style="cursor: pointer;">Login</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="modal" data-bs-target="#registerBackdrop" style="cursor: pointer;">Register</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
data;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -119,13 +152,10 @@
|
|||
<label class="form-label">Email</label>
|
||||
<input type="text" name="email" required class="form-control shadow-none">
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<input type="password" name="password" required class="form-control shadow-none">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<a href="javascript: void(0)" style="font-size: 14px; color: gray;">Forgot your password?</a>
|
||||
</div>
|
||||
<div class="mb-3 d-grid">
|
||||
<button type="submit" class="btn btn-dark shadow-none d-block ">Login</button>
|
||||
</div>
|
||||
|
@ -189,7 +219,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function alert(type, msg, position='body'){
|
||||
|
@ -293,7 +322,6 @@
|
|||
|
||||
xhr.send(data);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
|
@ -56,7 +56,7 @@
|
|||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="d-grid" style="align-items: center; margin-top: 30px;">
|
||||
<button type="submit" class="btn btn-dark shadow-none d-block" style="font-size: 14px; font-weight: 500;">Serach</button>
|
||||
<button type="submit" class="btn btn-dark shadow-none d-block" style="font-size: 14px; font-weight: 500;">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -159,7 +159,6 @@
|
|||
data;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="col-lg-12 text-center mt-5 mb-2">
|
||||
<a href="./booking.php" class="btn-th">Booking</a>
|
||||
</div>
|
||||
|
@ -226,8 +225,7 @@
|
|||
</div>
|
||||
<!--footer-->
|
||||
<?php require('./components/footer.php'); ?>
|
||||
|
||||
|
||||
|
||||
<?php require('./components/script.php') ?>
|
||||
<script>
|
||||
var swiper = new Swiper(".mySwiper", {
|
||||
|
|
Loading…
Add table
Reference in a new issue