-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_reserve.php
123 lines (121 loc) · 5.44 KB
/
add_reserve.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang = "en">
<head>
<title>Hotel Online Reservation</title>
<meta charset = "utf-8" />
<meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
<link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css " />
<link rel = "stylesheet" type = "text/css" href = "css/style1.css" />
</head>
<body>
<nav style = "background-color:rgba(0, 0, 0, 0.1);" class = "navbar navbar-default">
<div class = "container-fluid">
<div class = "navbar-header">
<h1 class = "heading-title" >Hotel Online Reservation</a></h1>
</div>
</div>
</nav>
<!-- <ul id = "menu">
<li><a href = "index.php">Home</a>
<li><a href = "aboutus.php">About us</a></li> |
<li><a href = "contactus.php">Contact us</a></li> |
<li><a href = "gallery.php">Gallery</a></li> |
<li><a href = "dineandlounge.php">Dine and Lounge</a></li> |
<li><a href = "reservation.php">Make a reservation</a></li> |
<li><a href = "rulesandregulation.php">Rules and Regulation</a></li>
</ul> -->
<div style = "margin-left:0;" class = "container">
<div class = "panel panel-default">
<div class = "panel-body">
<strong><h1>MAKE A RESERVATION</h1></strong>
<br />
<?php
require_once 'database.php';
$query = $db->query("SELECT * FROM `room` WHERE `room_id` = '$_REQUEST[room_id]'") or die(mysql_error());
$fetch = $query->fetch_array();
?>
<div style = "height:300px; width:800px;">
<div style = "float:left;">
<img src = "photo/<?php echo $fetch['photo']?>" height = "300px" width = "400px">
</div>
<div style = "float:left; margin-left:10px;">
<h3><?php echo $fetch['room_type']?></h3>
<h3 style = "color:#00ff00;"><?php echo "Php. ".$fetch['price'].".00";?></h3>
</div>
</div>
<br style = "clear:both;" />
<div class = "well col-md-4">
<form method = "POST" enctype = "multipart/form-data">
<div class = "form-group">
<label>Firstname</label>
<input type = "text" class = "form-control" name = "firstname" required = "required" />
</div>
<!-- <div class = "form-group">
<label>Middlename</label>
<input type = "text" class = "form-control" name = "middlename" required = "required" />
</div> -->
<div class = "form-group">
<label>Lastname</label>
<input type = "text" class = "form-control" name = "lastname" required = "required" />
</div>
<div class = "form-group">
<label>Address</label>
<input type = "text" class = "form-control" name = "address" required = "required" />
</div>
<div class = "form-group">
<label>Contact No</label>
<input type = "text" class = "form-control" name = "contactno" required = "required" />
</div>
<div class = "form-group">
<label>Room Type </label>
<select class = "form-control" required = required name = "room_type">
<option value = "">Choose an option</option>
<option value = "Standard" <?php if($fetch['room_type'] == "Standard"){echo "selected";}?>>Standard</option>
<option value = "Superior" <?php if($fetch['room_type'] == "Superior"){echo "selected";}?>>Superior</option>
<option value = "Super Deluxe" <?php if($fetch['room_type'] == "Super Deluxe"){echo "selected";}?>>Super Deluxe</option>
<option value = "Jr. Suite" <?php if($fetch['room_type'] == "Jr. Suite"){echo "selected";}?>>Jr. Suite</option>
<option value = "Executive Suite" <?php if($fetch['room_type'] == "Executive Suite"){echo "selected";}?>>Executive Suite</option>
</select>
</div>
<div class = "form-group">
<label>Check in</label>
<input type = "date" class = "form-control" name = "check_in" required = "required" />
</div>
<div class = "form-group">
<label>Check out</label>
<input type = "date" class = "form-control" name = "check_out" required = "required" />
</div>
<br />
<div class = "form-group">
<button class = "btn btn-info form-control" name = "add_guest"><i class = "glyphicon glyphicon-save"></i> Submit</button>
</div>
</form>
</div>
<div class = "col-md-4"></div>
<?php
require_once 'database.php';
if(ISSET($_POST['add_guest'])){
$firstname = $_POST['firstname'];
// $middlename = $_POST['middlename'];
$lastname = $_POST['lastname'];
$address = $_POST['address'];
$contactno = $_POST['contactno'];
$room_type = $_POST['room_type'];
$check_in = $_POST['check_in'];
$check_out = $_POST['check_out'];
$db->query("INSERT INTO `hoteL_guest` (firstname, lastname, address, contactno, room_type, check_in, check_out) VALUES('$firstname','$lastname', '$address', '$contactno', '$room_type', '$check_in', '$check_out')") or die(mysqli_error());
$query = $db->query("SELECT * FROM `hotel_guest` WHERE `firstname` = '$firstname' && `lastname` = '$lastname' && `contactno` = '$contactno' && `room_type` = '$room_type' && `check_in` = '$check_in' && `check_out` = '$check_out'") or die(mysqli_error());
$fetch = $query->fetch_array();
}?>
</div>
</div>
</div>
<br />
<br />
<!-- <div style = "text-align:right; margin-right:10px;" class = "navbar navbar-default navbar-fixed-bottom">
<label>© Copyright HOR 2017 </label>
</div> -->
</body>
<script src = "js/jquery.js"></script>
<script src = "js/bootstrap.js"></script>
</html>