-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbooking.php
167 lines (153 loc) · 7.4 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
include('header.php');
include('connection.php');
extract($_REQUEST);
if(isset($savedata))
{
$sql= mysqli_query($con,"select * from room_booking_details where email='$email' and room_type='$room_type' and address='$address' and check_in_date='$cdate' and check_out_date='$codate'");
if(mysqli_num_rows($sql))
{
$msg= "<h1 style='color:red'>You have already booked this room</h1>";
}
else
{
$sql="insert into room_booking_details(name, email, phone, address, room_type,check_in_date, check_out_date, confirmation)
values('$name','$email','$phone','$address', '$room_type','$cdate','$codate','No')";
if(mysqli_query($con,$sql))
{
$msg= "<h1 style='color:blue'>You have Successfully booked this room</h1>";
}
}
}
?>
<body class="bg">
<div class="container">
<!-- start #header -->
<header id="header">
<!-- start #menu -->
<?php
include('navbar.php')
?>
<!-- end #menu -->
</header>
<!-- end #header -->
<!-- start main -->
<main>
<!-- start banner
<section class="mt-5 remove-margin">
<div class="bannerm">
<img class="img-fluid about-image" src="assets/img/slider/coxsbazar.jfif" alt="">
<div class="row banner-overlay">
<div class="col-12 banner-text">
<h2>Hotel Sea Alif</h2>
<span>Cheap | Comfort | Safety | Security</span>
</div>
</div>
</div>
</section> -->
<?php
include('banner.php')
?>
<!-- end banner -->
<!-- start booking form -->
<section class="container mt-5 forms">
<form class="form-horizontal" method="post">
<div class="row">
<?php echo @$msg; ?>
<div class="col-sm-12 col-md-5 pe-5">
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4> Name :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="text" class="form-control" name="name" placeholder="Enter Your Name" required>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4>Email :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="email" class="form-control" name="email" placeholder="Enter Your Email" required />
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4>Mobile :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="text" class="form-control" name="phone" placeholder="Type Your Phone Number" required>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4> Address :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="text" class="form-control" name="address" placeholder="Enter Your Address" required>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-7">
<div class="form-group">
<div class="row mb-2">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4>Room Type:</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<select class="form-control" name="room_type" required>
<option>Couple AC Room</option>
<option>Twin Couple AC Room</option>
<option>Couple Deluxe Non-AC Room</option>
<option>Twin Couple Deluxe Non-AC Room</option>
<option>Couple Economy Non-AC Room</option>
<option>Twin Couple Economy Non-AC Room</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4>Check In Date :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="date" name="cdate" class="form-control" required>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="control-label col-sm-12 col-md-3 col-lg-3">
<h4>Check Out Date :</h4>
</div>
<div class="col-sm-12 col-md-9 col-lg-9">
<input type="date" name="codate" class="form-control" required>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-sm-12 d-flex justify-content-center">
<input type="submit" value="Book Now" name="savedata" class="booking-button" required />
</div>
</div>
</form>
</section>
<!-- end booking form -->
</main>
<!-- end main -->
<?php
include('footer.php')
?>
</div>
</body>