-
Notifications
You must be signed in to change notification settings - Fork 10
/
printmulti.php
111 lines (74 loc) · 2.44 KB
/
printmulti.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
<html>
<head>
<title> Star Bus </title>
</head>
<?php
$con=mysqli_connect("localhost","root","niket123","bus_ticket");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pnr='';
$apnr=$_POST['pnr'];
if (empty($apnr))
{
echo("plz select");
}
else
{
$n=count($apnr);
$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='$apnr[0]' and reserves.rid=route.rid " ;
$retval = mysqli_query( $con, $sql);
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
$row=mysqli_fetch_array($retval);
echo "<br><br><center><table border='3' style='border-color: black; cellspacing='11' cellpadding='11' ;'width =70%'>
<td><imgl>
    <img src='images/logo.png' />
</imgl>
<br>
<br>
<br>
<font face='System' font size='4' color='black'>Name : ". $row['name'] . "
                
". $row['fromLoc'] . " to ". $row['toLoc'] . "
       
Date : ". $row['dep_date'] . " Time: ". $row['dep_time'] ."
<br><br>
Mobile: ". $row['mob'] . "
     
Bus_id : ". $row['bid'] . "
      
         
Total Fare : ".$n." *". $row['fare'] . " = ₹ ".$n * $row['fare'] ."/-
<br><br>
Email: ". $row['email'] . "
                
<font face='impact' font size='5' color='red'>". $row['status'] . "</font>
    
<img src='paid.png' width='35px' height='35px' />
<br><br>
<table border='1' style='border-color: black; cellspacing='5' cellpadding='5' ;'width =70%'>
<tr><td>Tickets Numbers</tr>";
for ($i=0; $i<$n; $i++)
{
$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='$apnr[$i]' and reserves.rid=route.rid " ;
$retval = mysqli_query( $con, $sql);
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
$row=mysqli_fetch_array($retval);
echo "
<tr><td>".$apnr[$i]."</tr>";
}
echo"</table>
</table>
";
}
mysqli_close($con);
?>
</body>
</html>