-
Notifications
You must be signed in to change notification settings - Fork 0
/
booking.php
99 lines (86 loc) · 2.62 KB
/
booking.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
session_start();
require_once './conn.php';
if (isset($_GET['hotel'])) {
$Hotel = $_GET['hotel'];
// Check if the values exist in the database
$query = "SELECT * FROM `hotel` WHERE hotel_id='$Hotel'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_array($result);
$name = $row['hotel_name'];
$description = $row['description'];
$imgname = $row['image'];
} else {
echo
"<script>
alert('Hotel Not Available');
window.location.href='./book.php';
</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Amora Resort</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/booking.css">
<?php
echo "
<style>
.conMain {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-image: url('./assets/hotel/{$imgname}');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
width: 100%;
height: 100vh;
}
</style>";
?>
</head>
<?php include "./partials/header.php" ?>
<body>
<div class="conMain">
<div class="main-overlay">
<div class="text">
<?php
echo '<h1>' . $name . '</h1>';
echo '<div class="description">';
echo '<p>' . $description . '</p>';
echo '</div>';
?>
</div>
</div>
</div>
<div class="title">
<h1>Packages</h1>
</div>
<div class="packages">
<?php
$query = "SELECT * FROM `package` WHERE hotel_id='$Hotel';";
$result = mysqli_query($conn, $query);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$pkgid = $row['package_id'];
$pkgname = $row['package_name'];
$pkgimg = $row['image'];
$price = $row['price'];
echo '<div class="card">';
echo '<img src="./assets/package/' . $pkgimg . '" alt="hotel">';
echo '<h1>' . $pkgname . '</h1>';
echo '<h2>$ ' . $price . '</h2>';
echo '<button onclick="location.href=\'./checkout.php?hotel=' . $Hotel . '&pkg=' . $pkgid . '\'" type="button">Checkout</button>';
echo '</div>';
}
}
?>
</div>
</body>
<?php include "./partials/footer.php" ?>
</html>