-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
139 lines (130 loc) · 4.7 KB
/
index.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
<?php require('header.php'); ?>
<ul class="breadcrumb" style="margin-top:1px;">
<li>
<i class="icon-home"></i>
<a href="index.php">Vellore Bus Terminal</a>
<i class="icon-angle-right"></i>
</li>
<li><a href="#">Viewing Schedule</a></li>
</ul>
<table class="table table-striped table-bordered" style="width:90%; margin:auto;">
<h2 style="text-indent:20px;">To Bangalore</h2>
<thead>
<tr>
<th>Driver Name</th>
<th>Bus Number</th>
<th>Bus Type</th>
<th>From</th>
<th>Destination</th>
<th>Departure</th>
<th>Arrival</th>
<th>Terminal Location</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
include ('db/dbcon.php');
$result= mysql_query("select * from schedule
LEFT JOIN bus ON schedule.busid = bus.busid
LEFT JOIN driver ON schedule.driverid = driver.driverid
where destination_location='Bangalore' ORDER BY schedule.scheduleid DESC ") or die (mysql_error());
while ($row= mysql_fetch_array ($result) ){
$id=$row['scheduleid'];
$busid=$row['busid'];
$driverid=$row['driverid'];
?>
<tr>
<td><?php echo $row['firstname']." ".$row['lastname']; ?></td>
<td><span class="label label-success"><?php echo $row['bus_number']; ?></span></td>
<td><?php echo $row['bus_type']; ?></td>
<td><?php echo $row['from_location']; ?></td>
<td><?php echo $row['destination_location']; ?></td>
<td><span class="label label-info"><?php echo date("M d, Y H:i:s",strtotime($row['departure_time'])); ?></span></td>
<td><span class="label label-success"><?php echo ($row['arrival_time'] == "0000-00-00 00:00:00") ? "Travel" : date("M d, Y H:i:s",strtotime($row['arrival_time'])); ?></span></td>
<td><span class="label label-success"><?php echo $row['terminal_location']; ?></span></td>
<?php
if ($row['status_operation'] == 'On Travel') {
echo "<td><span class='label label-info'>".$row['status_operation']."</span></td>";
} elseif ($row['status_operation'] == 'Cancelled') {
echo "<td><span class='label label-warning'>".$row['status_operation']."</span></td>";
} else {
echo "<td><span class='label label-success'>".$row['status_operation']."</span></td>";
}
?>
</tr>
<?php } ?>
</tbody>
</table>
<br />
<br />
<br />
<table class="table table-striped table-bordered" style="width:90%; margin:auto;">
<h2 style="text-indent:20px;">To Chittoor</h2>
<thead>
<tr>
<th>Driver Name</th>
<th>Bus Number</th>
<th>Bus Type</th>
<th>From</th>
<th>Destination</th>
<th>Departure</th>
<th>Arrival</th>
<th>Terminal Location</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
include ('db/dbcon.php');
$result= mysql_query("select * from schedule
LEFT JOIN bus ON schedule.busid = bus.busid
LEFT JOIN driver ON schedule.driverid = driver.driverid
where destination_location='Chittoor' ORDER BY schedule.scheduleid DESC ") or die (mysql_error());
while ($row= mysql_fetch_array ($result) ){
$id=$row['scheduleid'];
$busid=$row['busid'];
$driverid=$row['driverid'];
?>
<tr>
<td><?php echo $row['firstname']." ".$row['lastname']; ?></td>
<td><span class="label label-success"><?php echo $row['bus_number']; ?></span></td>
<td><?php echo $row['bus_type']; ?></td>
<td><?php echo $row['from_location']; ?></td>
<td><?php echo $row['destination_location']; ?></td>
<td><span class="label label-info"><?php echo date("M d, Y H:i:s",strtotime($row['departure_time'])); ?></span></td>
<td><span class="label label-success"><?php echo ($row['arrival_time'] == "0000-00-00 00:00:00") ? "Travel" : date("M d, Y H:i:s",strtotime($row['arrival_time'])); ?></span></td>
<td><span class="label label-success"><?php echo $row['terminal_location']; ?></span></td>
<?php
if ($row['status_operation'] == 'On Travel') {
echo "<td><span class='label label-info'>".$row['status_operation']."</span></td>";
} elseif ($row['status_operation'] == 'Cancelled') {
echo "<td><span class='label label-warning'>".$row['status_operation']."</span></td>";
} else {
echo "<td><span class='label label-success'>".$row['status_operation']."</span></td>";
}
?>
</tr>
<?php } ?>
</tbody>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<?php require('footer.php'); ?>