-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddBooking.php
366 lines (245 loc) · 7.21 KB
/
AddBooking.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<?php
session_start();
include("connection.php");
include("function.php");
$user_data = check_login($conn);
?>
<?php include("connection.php")?>
<!--
<!DOCTYPE html>
<html>
<head>
<title>admin Panel suraksha</title>
</head>
<body>
<?php// echo "welcome:". $_SESSION['id']; ?>
<a href="adminLogout.php"><button class="btnHome">logout</button></a>
</body>
</html>
-->
<!DOCTYPE html>
<html>
<head>
<title>booking page</title>
<!--cdn icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="cssfile/sidebar.css">
<link rel="stylesheet" href="cssfile/signUp.css">
<style type="text/css">
body{
background-image: url("image/1.jpg");
background-position: center;
background-size: cover;
height: 700px;
background-repeat: no-repeat;
background-attachment: fixed;
}
.adminTopic{
text-align: center;
color: #fff;
}
table
{
width:99%;
border-collapse: separate !important;
margin:auto;
/*/table-layout:fixed;/*/
text-align:center;
margin-top:50px;
background-color: rgb(255, 255, 255);
border-radius: 10px 10px 0px 0px;
}
table th
{
border-bottom:2px solid rgb(187, 187, 187);
padding:10px 0px 10px 0px;
font-family: "balsamiq_sansitalic" !important;
}
table tr td
{
border-right: 2px solid rgb(187, 187, 187);
height: 58px;
padding: 22px 0px 0px 0px;
font-family: "monospace;" !important;
border-bottom: 2px solid rgb(187, 187, 187);
font-size: 20px;
}
table tr td a
{
/*background-color: rgb(255, 196, 0);*/
color: white;
border-radius: 5px;
padding: 6px;
text-decoration: none;
margin: 10px;
font-weight: 700;
}
table tr td button:hover
{
/*
background: rgb(255, 255, 255);
text-decoration:underline;
color:tomato;
padding: 4px;
border:2px solid tomato;
transition:background-color 0.2s;*/
padding: 5px 5px 5px 5px;
border: 2px solid yellow;
border-radius: 7px;
background-color: red;
color: white;
cursor: pointer;
}
button
{
padding: 5px 5px 5px 5x;
}
.btnPolicy{
padding: 5px 5px 5px 5px;
border: 2px solid yellow;
border-radius: 7px;
background-color: red;
color: white;
margin-left: 20px;
}
.btnPolicy:hover{
background:red;
padding: 7px 7px 7px 7px;
cursor: pointer;
}
.idclass{
width: 100%;
border-radius: 3px;
border: 1px solid #9597a6;
padding: 10px;
outline: none;
color: black;
}
</style>
</head>
<body>
<input type="checkbox" id="check">
<label for="check">
<i class="fa fa-bars" id="btn"></i>
<i class="fa fa-times" id="cancle"></i>
</label>
<div class="sidebar">
<header><img src="image/Re.png">
<p><?php echo $user_data['username'];?></p>
</header>
<ul>
<li><a href="viewBus.php">Ticket Booking</a></li>
<li><a href="profile.php">Profile</a></li>
<li><a href="logout.php">logout</a></li>
<!-- <li><a href="#">Event</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Service</a></li>
<li><a href="#">Contact</a></li>-->
</ul>
<!-- <li>
<div class="social-links">
<a href="#" class="twitter"><i class="fa fa-twitter"></i></a>
<a href="#" class="facebook"><i class="fa fa-facebook"></i></a>
<a href="#" class="instagram"><i class="fa fa-instagram"></i></a>
<a href="#" class="google-plus"><i class="fa fa-youtube"></i></a>
</div>
</li>-->
</div>
<div class="sidebar2">
<h1 class="adminTopic">Get Your Ticket...</h1>
<?php
/*
$sqlget="SELECT * FROM bus";
$sqldata=mysqli_query($conn,$sqlget) or die('error getting');
echo "<table>";
echo "<tr>
<th>ID</th>
<th>Bus Name</th>
<th>Tel</th>
<th>Book Now</th>
</tr>";
while ($row=mysqli_fetch_array($sqldata,MYSQLI_ASSOC))
{
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['Bus_Name'];
echo "</td><td>";
echo $row['Tel'];
echo "</td>";
?>
<td>
<button style="border:2px solid yellow; border-radius:7px; background-color:red;color:white;">
<a href="Viewbooking.php">
Book Now
</a>
</button>
</td></tr>
<?php
}
echo "</table>";
*/
?>
<?php
if(isset($_POST['AddBooking'])){
$passenger=$_POST['passenger_name'];
$tel=$_POST['tel'];
$email=$_POST['email'];
$board_place=$_POST['board_place'];
$desti=$_POST['Your_destination'];
if($conn->connect_error)
{
die('Connection Failed :'.$conn->connect_error);
}
else
{
$stmt=$conn->prepare("INSERT INTO booking(passenger_name,telephone,email,boarding_place,Your_destination) VALUES(?,?,?,?,?)");
//table3 is the table name//
$stmt->bind_param("sssss",$passenger,$tel,$email,$board_place,$desti);
$stmt->execute();
echo ("<script LANGUAGE='JavaScript'>
window.alert('Succesfully added!!!');
window.location.href='AddPay.php';
</script>");
$stmt->close();
$conn->close();
}
}
?>
<div class="wrapper">
<div class="registration_form">
<div class="title">
Geting A Ticket...
</div>
<form action="#" method="POST">
<div class="form_wrap">
<div class="input_wrap">
<label for="title">Passenger Name</label>
<input type="text" id="title" name="passenger_name" placeholder="Passenger Name" required>
</div>
<div class="input_wrap">
<label for="title">Telephone</label>
<input type="text" id="title" name="tel" placeholder="Tel" required>
</div>
<div class="input_wrap">
<label for="title">E-mail</label>
<input type="E-mail" id="title" name="email" placeholder="E-mail" class="idclass" required>
</div>
<div class="input_wrap">
<label for="title">Board Place</label>
<input type="text" id="title" name="board_place" placeholder="board place" required>
</div>
<div class="input_wrap">
<label for="title">Your destination</label>
<input type="text" id="title" name="Your_destination" placeholder="Your destination" required>
</div>
<div class="input_wrap">
<input type="submit" value="Booking Now" class="submit_btn" name="AddBooking">
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>