-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathticket.php
More file actions
98 lines (69 loc) · 2.01 KB
/
Copy pathticket.php
File metadata and controls
98 lines (69 loc) · 2.01 KB
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
<html>
<?php
$con=mysqli_connect("localhost","root","","bus_ticket");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pid='';
$no_of_tickets='';
if (isset($_POST['pid']))
{
$pid=$_POST['pid'];
}
if (isset($_POST['no_of_tickets']))
{
$no_of_tickets=$_POST['no_of_tickets'];
}
$sql = " SELECT * FROM reserves,route WHERE reserves.rid=route.rid and pid='$pid' " ;
$retval = mysqli_query( $con, $sql);
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
$row=mysqli_fetch_array($retval);
echo "<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'>Bus_id : ". $row['bid'] . "
      
". $row['fromLoc'] . " to ". $row['toLoc'] . "
       
       
   
Departure : ". $row['dep_date'] . " ". $row['dep_time'] ."
<br><br>
Pid: ". $row['pid'] . "
           ";
echo"
Total Fare : ". $no_of_tickets." * ".$row['fare']." = ₹ ". $no_of_tickets * $row['fare']
."/-
   
Arrival : ". $row['arr_date'] . " ". $row['arr_time'] . "
<br><br>";
echo"DOT : ". $row['DOT'] . "
          
<font face='impact' font size='5' color='red'>". $row['status'] . "</font>
    
<br><br>
<table border='1' style='border-color: black; cellspacing='5' cellpadding='5' ;'width =70%'>
<tr><td>Tickets Numbers</tr>";
$sql = " SELECT * FROM reserves WHERE pid='$pid' " ;
$retval = mysqli_query( $con, $sql);
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysqli_fetch_array($retval))
{
echo "<tr><td border='2'> <center>". $row['pnr']."</center></tr>";
}
echo"</table>
</table> </center>";
mysqli_close($con);
?>
</html>