-
Notifications
You must be signed in to change notification settings - Fork 10
/
print.php
267 lines (169 loc) · 5.76 KB
/
print.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
<html>
<head>
<title> Star Bus </title>
</head>
<style>
k{
color:green;
font-size:20px;
background-color:#f28858;
height:100px;
width:1345px;
position:absolute;
top:1px;
left:0px;
right:0px;
}
n{
color:white;
font-size:20px;
background-color:#f28858;
height:220px;
width:100%;
position:absolute;
left:0px;
}
nav {
background-color:#f28858;
height: 40px;
width: 1345px;
position:absolute;
top:97;
right:0px;
}
nav ul{
list-style-type:none;
float:right;
}
nav li{
float:left;
margin-right:12px;
}
div{
position:absolute;
top:200px;
right:80px;
border:1px solid black;
background:skyblue;
width:400px;
border-radius:15px;
}
body
{
background-color:white;
}
pub{
text-align:center;
background-color: blue;
position:absolute;
height: 42px;
width: 440px;
top:145;
left:460px;
}
puk{
text-align:center;
background-color: blue;
position:absolute;
height: 53px;
width: 300px;
top:145;
left:520px;
}
</style>
<k>
<nav>
<ul >
<li><a href="index.html"><font face="Gunplay" font size="4" color="white">HOME</a></li></font>
<li><a href="about.html"><font face="Gunplay" font size="4" color="white">About</a></li></font>
<li><a href="mybookings.html"><font face="Gunplay" font size="4" color="white">My Booking</a></li></font>
<li><a href="cancellation.html"><font face="Gunplay" font size="4" color="white">Cancellation</a></li></font>
<li><a href="support.html"><font face="Gunplay" font size="4" color="white">Support</a></li></font>
<li><a href="contact.html"><font face="Gunplay" font size="4" color="white">Contact Us</a></li></font>
</ul></nav>
<imgl>
    <img src="images/logo.png" />
</imgl>
</k>
<br><br><br><br><br><br><br><br>
<?php
$con=mysqli_connect("localhost","root","niket123","bus_ticket");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pnr='';
$mob='';
if (isset($_POST['pnr']))
{
$pnr=$_POST['pnr'];
}
if (isset($_POST['mob']))
{
$mob=$_POST['mob'];
}
$sql = "SELECT email,name,pnr,bid,fromLoc,toLoc,dep_date,dep_time ,arr_time,fare,mob,status FROM reserves,passenger,route WHERE passenger.pid = reserves.pid and pnr='$pnr' and mob ='$mob' and reserves.rid=route.rid " ;
$retval = mysqli_query( $con, $sql);
if(! $retval )
{
die('Could not get data: ' . mysql_error());
echo " ticket number doesn't exists";
}
$row=mysqli_fetch_array($retval);
if ($row['mob'] == $_POST['mob'] && $pnr != '' && $mob!= '')
{
echo
<puk>
<font face='Impact' font size='9' color='yellow'>Your Ticket</font>
</puk>
<br><br><br>
<center><table border='3' style='border-color: black; cellspacing='11' cellpadding='11' ;'width =70%'><h2>
<tr><th>PNR :<th> " .$pnr . " <th>Name :<th> ". $row['name'] . "</tr>
<tr><th>Date : <th>". $row['dep_date'] . "<th>Mobile :<th> ". $row['mob'] . "</tr>
<tr><th>Time : <th>". $row['dep_time'] ."<th>Email : <th>". $row['email'] . " </tr>
<tr><th>Bus_id : <th>". $row['bid'] . "<th>Status<th> <font face='Franklin Gothic' font size='4' color='red'>". $row['status'] . "</font></tr>
<tr><th>". $row['fromLoc'] . " <th>to   ". $row['toLoc'] . "
<th>Fare :<th>₹ ". $row['fare'] . "/-</tr>
</table>
<br><form action='printmulti.php' method='post'><input type='hidden' name='pnr[]' value=". $row['pnr']."</form><input type='submit' value='print'>
</center>"
;
}
else
{
echo
<pub>
<font face='Bernard MT' font size='6' color='yellow'>Invalid PNR Or Mobile number</font></a>
</pub>
<br><br><br><br><br><br><br><br><br><br><br><br><br>
";
}
mysqli_close($con);
?>
<br><br><br><br>
<n>
<font face="Gunplay" font size="3" color="white"><h3>  About STAR Bus Booking</h3></font>
<font face="Gunplay" font size="2" color="white"><p>  Star Bus is a registerd online bus booking website by the Our Star team. <br>  Any issues can be brought up to the judicial of the Bangalore High Court, Bangalore. </p></font>
<ul >
<li><a href="about.html"> <font face="Gunplay" font size="2" color="white">About</a> </li></font>
<li><a href="tc.html"> <font face="Gunplay" font size="2" color="white">Term of Services</a> </li></font>
</ul>
<font face="Gunplay" font size="2" color="white">  STAR BUS BOOKING COPYRIGHT © 2002-2015 ALL RIGHT RESERVED.            
                
                
                
                
                
                
                
                
                
                
</font>
<img2>
<img src="soc.png" />
</img2>
</n>
</body>
</html>