-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhotelbook.php
103 lines (86 loc) · 3.48 KB
/
hotelbook.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
100
101
102
103
<?php
include $_SERVER["DOCUMENT_ROOT"] . '/IWP_project/core/init.php';
include $_SERVER["DOCUMENT_ROOT"] . '/IWP_project/includes/overall/header.php';
if(isset($_SESSION['to_city'])) {
$to = $_SESSION['to_city'];
}
$place = 0;
if ($to == 'Delhi') {
$place = 20;
}
if ($to == 'Hyderabad') {
$place = 21;
}
if (($to == 'chennai') || ($to == 'Chennai')) {
$place = 22;
}
if ($to == 'Mumbai') {
$place = 23;
}
echo '<h1>Hotels in ' . $to . '<br></h1>';
?>
<script>
document.body.style.backgroundImage = "url('./vendor/img/refs/<?php
mysql_data_seek($result, $place);
$row = mysql_fetch_row($result);
echo $row[3];
?>')";
document.body.style.backgroundSize = "100%";
document.body.style.backgroundRepeat = "no-repeat";
document.body.style.backgroundAttachment = "fixed";
document.body.style.backgroundPosition = "center";
document.getElementById("menu").style.display = "none";
</script>
<legend style = "opacity: 0.7;">Book hotels!</legend>
<div class=" w3-animate-bottom w3-display-middle">
<div style="top: 50px; position: fixed; align: center; width: 100%">
<?php
$str0 ="";
// $to="";
if(isset($_SESSION['to_city'])) {
$to = $_SESSION['to_city'];
}
echo '<form action="" method="POST">';
echo '<div class = "well">';
$query = "SELECT * FROM `hotels` WHERE `hotel_city` = '$to'";
$result = mysql_query($query);
if ($result) {
$temp = 0;
while ($row = mysql_fetch_assoc($result)) {
$hotel_name = $row['hotel_name'];
$hotel_address = $row['hotel_address'];
$hotel_review = $row['hotel_review'];
$price = $row['price'];
$hotel_rating = $row['hotel_rating'];
$rooms_available = $row['rooms_available'];
$review_count = $row['review_count'];
echo '<h3>' . $row['hotel_name'] . '</h3><br><br>';
echo 'Hotel Address:' . $hotel_address . ' <br>';
echo 'Hotel Review: ' . $hotel_review . "<br>";
echo 'Price: ' . $price . ' <br>';
echo 'Rating: ' . $hotel_rating . ' ' . '<br>';
echo 'Rooms available: ' . $rooms_available . ' <br>';
echo 'Review Count: ' . $review_count . ' <br>';
echo "<input type='hidden' value='$hotel_name' id='hotel_name' name='hotel_name' />";
//echo "<input type='hidden' value='$fno' id='p_fno' name='p_fno' />";
$str = 'hotelnumber' . $temp;
echo $str ;
echo "<input type='hidden' value='$str' id='str' name='str' />";
echo '<input type="submit" value=\'Book hotel!\' name="'. $str . '" class="btn success" style = "background-color: #b41515; float: right;" onclick ="'.name($hotel_name,$str,$to).'\" >Book Hotel!';
echo '<br/><hr>';
$temp += 1;
echo '</form>';
}
}
echo '</div>';
function name($hotel_name1,$str1,$to) {
if (isset($_POST["$str1"])) {
$str0 = "hotelconfirm.php?name=" . $hotel_name1."&to=".$to;
echo $str0;
echo '<script> window.location.href="'.$str0.'";</script>';
exit;
}
}
?>
</div>
</div>