added user booking page

This commit is contained in:
Juthatip McDevitt 2024-06-29 21:38:57 -05:00
parent cc43dd3495
commit 32c69958c9
2 changed files with 154 additions and 1 deletions

View file

@ -373,7 +373,7 @@
<p style="text-align: center; margin-left: 20px; margin-right: 20px;">Can't find the contact and information you're looking for? Write to us via this quick form.</p>
<div class="contact-form-container shadow">
<form method="POST">
<input type="text" name="name" placeholder="Your Name" required>
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" size="30" required></label>
<input type="text" name="subject" placeholder="Subject" required>
<textarea name="message" placeholder="Message" style="height:200px" required></textarea>

View file

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Booking | Midtown Hotel</title>
<?php require('./components/link.php') ?>
<style>
input[type=number]{
-moz-appearance: textfield;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button{
-webkit-appearance: none;
margin: 0;
}
.booking-hero{
position: relative;
width: 100%;
background-color: #194141;
display: flex;
flex-direction: column;
box-shadow: 0px 3px 3px #BFCBCB;
}
.booking-title{
margin: 50px;
text-align: center;
text-transform: uppercase;
font-size: 22px;
color: #B0A695;
text-shadow: 1px 1px 2px #EAD8C0;
}
.custom-alert-t{
position:fixed;
top: 100px;
right: 25px;
z-index: 10000;
}
.room-book-img{
width: 100%;
height: 550px;
object-fit: cover;
}
.room-title{
font-size: 20px;
text-transform: uppercase;
}
.btn-third{
background-color: #194141;
border: none;
color: white;
padding: 6px 12px;
text-align: center;
font-size: 14px;
border-radius: 3px;
}
@media (max-width:765px){
.booking-hero{
height: 100px;
}
}
@media (max-width:580px){
.room-book-img{
height: 350px;
}
}
@media (max-width:450px){
.room-title{
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="booking-hero">
<?php
require('./components/header.php') ;
if(!(isset($_SESSION['login']) && $_SESSION['login'] == true)){
redirect('index.php');
}
?>
</div>
<div class="container">
<div class="row">
<div class="col-12 mt-5 mb-4">
<h4 style="text-transform: uppercase; letter-spacing: 2px; color: #194141;">Booking<h4>
</div>
<?php
$query = "SELECT bo.*, bd.* FROM `booking_order` bo INNER JOIN `booking_detail` bd ON bo.booking_id = bd.booking_id
WHERE ((bo.booking_status ='pending') OR (bo.booking_status ='cancel')) AND (bo.user_id=?) ORDER BY bo.booking_id DESC";
$result = select($query, [$_SESSION['uerID']], 'i');
echo <<< data
<div class='table-responsive col-12'>
<table class="table">
<thead>
<tr class='bg-light'>
<th scope="col" style='width: 25%;'>Date</th>
<th scope="col" style='width: 25%;'>Order ID</th>
<th scope="col" style='width: 50%;'>Action</th>
</tr>
</thead>
</table></div>
data;
while($data = mysqli_fetch_assoc($result)){
$date = date("F j, Y", strtotime($data['datentime']));
$checkin = date("M-d-Y", strtotime($data['check_in']));
$checkout = date("M-d-Y", strtotime($data['check_out']));
$status_bg = "";
$btn = "";
if($data['booking_status'] == 'pending'){
$status_bg = "bg-success";
if($data['arrival'] ==1){
$btn = "
<a href='generate_invoice.php&gen_pdf&id=$data[booking_id]' class='btn-third' >Download</a>
<button type='button' class='btn-second' style='font-size: 14px; padding: 5px; font-weight: 600;'>Review</button>
";
} else{
$btn = "
<button type='button' class='btn-cancel' style='font-size: 14px; padding: 5px; font-weight: 600;'>Cancel</button>
";
}
} else{
$status_bg = "bg-danger";
}
echo <<< data
<div class='table-responsive col-12'>
<table class="table">
<tbody'>
<tr>
<td style='width: 25%;'>$date</td>
<td style='width: 25%;'>$data[order_id]</td>
<td style='width: 50%;'>Action</td>
</tr>
</tbody>
</table></div>
data;
}
?>
</div>
</div>
<!--footer-->
<?php require('./components/footer.php'); ?>
<?php require('./components/script.php') ?>
</body>
</html>