/
viewBuses.php
136 lines (105 loc) · 3.46 KB
/
viewBuses.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
<!DOCTYPE html>
<html>
<head>
<title>
Available-buses
</title>
<?php
$from=$_POST["from"];
$to = $_POST["to"];
$date=$_POST["date"];
?>
<style type="text/css">
body{
margin: 0px;
}
td{
max-width: 150px;
min-width: 150px;
}
input[type=submit]{
background: url('ticket.png');
background-size: 100px;
background-repeat: no-repeat;
min-width: 100px;
min-height: 52px;
color: transparent ;
border:0px;
}
input[type=submit]:hover{cursor: pointer;}
</style>
</head>
<body>
<div style="background-color:#F63E46;
padding: 5px;color: white;
font-family: candara;
font-size: 20px;
">
<table align="center">
<tr>
<th>
<?php echo "$from"; ?>
</th>
<th>
<img src="arrow.png" height="30" style="transform: rotate(90deg);padding-left: 15px;padding-right: 15px;">
</th>
<th>
<?php echo "$to"; ?>
</th>
</tr>
</table>
</div>
<?php
$DB_Connect = mysqli_connect('localhost','root','','safar') or die('Error Establishing DB Connection');
$query = "select * from bus_info";
$Result = mysqli_query($DB_Connect,$query) or die('Error Fetching labour info');
while($DATA_ROW = mysqli_fetch_array($Result))
{
$id = $DATA_ROW['ID'];
$img = $DATA_ROW['img'];
$name = $DATA_ROW['cname'];
$seats = $DATA_ROW['seats'];
$price = $DATA_ROW['price'];
$time = $DATA_ROW['time'];
$duration = $DATA_ROW['duration'];
//echo "<tr><td style='padding-top:3px;padding-left:5px;padding-right:5px;padding-bottom:3px';> $id</td>";
//echo "<td style='padding-top:3px;padding-left:5px;padding-right:5px;padding-bottom:3px';> $n</td>";
// echo "<td style='padding-top:3px;padding-left:5px;padding-right:5px;padding-bottom:3px';> $m</td>";
// echo "<td style='padding-top:3px;padding-left:5px;padding-right:5px;padding-bottom:3px';> $l_add</td>";
// echo "<td style='padding-top:3px;padding-left:5px;padding-right:5px;padding-bottom:3px';> $l_pay</td>";
echo "<div style='
position:relative;
margin-top: 40px;
box-shadow: 0px 3px 8px 0px rgba(9,0,0,0.2);;
margin-top:10px;
background-color:#f9f9f9;
padding: 15px;
'>";
echo "<table width='100%' rules='cols'>";
echo "<tr>
<td align='center'>
<img src='$img' height='40'>
</td>";
echo "<td align='center'>
$name
</td>";
echo "<td align='center'>
$seats seats
</td>";
echo "<td align='center'>
$price /-
</td>";
echo "<td align='center'>
$time
</td>";
echo "<td align='center'>
$duration hrs
</td>";
echo "<td align='center'>
<form action='bookBus.php' method='post'><input type='hidden' name='from' value='$from'><input type='hidden' name='to' value='$to'><input type='hidden' name='date' value='$date'><input type='submit' value=$id name='id' ></form>
</td>
</tr></table></div>";
}
?>
</body>
</html>