-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotel.php
60 lines (47 loc) · 1.61 KB
/
hotel.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
<?php
session_start()
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hotel</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/hotel.css">
</head>
<?php include "./partials/header.php" ?>
<body>
<div class="main">
<div class="title">
<h1>HOTELS</h1>
</div>
<div class="search-container">
<input type="text" id="hotelSearch" placeholder="Search for hotels...">
<button onclick="searchHotels()">Search</button>
</div>
<div class="cardContainer">
<?php
require_once './conn.php';
$query = "SELECT * FROM `hotel`";
$result = mysqli_query($conn, $query);
// $row = mysqli_fetch_array($result);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$id = $row['hotel_id'];
$name = $row['hotel_name'];
$imgname = $row['image'];
echo '<div class="card">';
echo '<img src="./assets/hotel/' . $imgname . '" alt=hotel>';
echo '<h1>' . $name . '</h1>';
echo '<button onclick="location.href=\'./booking.php?hotel=' . $id . '\'" type="button">Book Now</button>';
echo '</div>';
}
}
?>
</div>
</div>
</body>
<script src="./js/search.js"></script>
<?php include "./partials/footer.php" ?>
</html>