forked from myshri123/bus_tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
120 lines (112 loc) · 4.6 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
<?php require('header.php'); ?>
<ul class="breadcrumb" style="margin-top:1px;">
<li>
<i class="icon-home"></i>
<a href="index.php">Sagay 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;">Bacolod to Sagay City </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='Sagay City' 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;">Sagay to Bacolod City </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='Bacolod City' 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 />
<?php require('footer.php'); ?>