added login to reserve a room functionality
This commit is contained in:
parent
eb5076d91a
commit
3f50e10ba7
1 changed files with 23 additions and 15 deletions
|
@ -22,6 +22,12 @@
|
|||
color: #B0A695;
|
||||
text-shadow: 1px 1px 2px #EAD8C0;
|
||||
}
|
||||
.custom-alert-t{
|
||||
position:fixed;
|
||||
top: 100px;
|
||||
right: 25px;
|
||||
z-index: 10000;
|
||||
}
|
||||
@media (max-width:765px){
|
||||
.booking-hero{
|
||||
height: 100px;
|
||||
|
@ -126,9 +132,14 @@
|
|||
$cover_res = mysqli_fetch_assoc($cover_q);
|
||||
$room_cover = ROOM_IMG_PATH.$cover_res['image'];
|
||||
}
|
||||
//booking & shutdown booking process
|
||||
$booking = "";
|
||||
if(!$settings_r['shutdown']){
|
||||
$booking = "<a href='#' class='btn-main d-block mb-2' style='font-size: 14px;'>Book</a>";
|
||||
$login = 0;
|
||||
if(isset($_SESSION['login']) && $_SESSION['login'] == true){
|
||||
$login=1;
|
||||
}
|
||||
$booking = "<button onclick='loginToBook($login, $room_data[id])' class='btn-main d-block mb-2' style='font-size: 14px;'>Book</button>";
|
||||
}
|
||||
//display room (---**accommodation section did not use from database**---)
|
||||
echo <<< data
|
||||
|
@ -169,22 +180,19 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--footer-->
|
||||
<?php require('./components/footer.php'); ?>
|
||||
|
||||
<?php require('./components/script.php') ?>
|
||||
|
||||
<script>
|
||||
function loginToBook(status, room_id){
|
||||
if(status){
|
||||
window.location.href='confirm_booking.php?id='+room_id;
|
||||
} else{
|
||||
alert('error', 'Please login to reserve a room');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue