-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.php
More file actions
77 lines (76 loc) · 2.45 KB
/
Copy pathform.php
File metadata and controls
77 lines (76 loc) · 2.45 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
<form action="#query.php" method="post" enctype="multipart/form-data">
<div class="form-row">
<div class="form-group col-md-4">
<select id="source" name="source" class="form-control" placeholder="Party" maxlength="50">
<?php
$cdquery="SELECT * FROM stops ORDER BY id ASC";
$cdresult=mysqli_query($con,$cdquery) or die ("Query to get data from firsttable failed: ".mysql_error());
while ($cdrow=mysqli_fetch_array($cdresult)) {
$N=$cdrow["name"];
echo "<option>
$N
</option>";
}
?>
</select>
</div>
<div class="form-group col-md-4">
<select id="destination" name="destination" class="form-control" placeholder="Party" maxlength="50">
<?php
$cdquery="SELECT * FROM stops ORDER BY id ASC";
$cdresult=mysqli_query($con,$cdquery) or die ("Query to get data from firsttable failed: ".mysql_error());
while ($cdrow=mysqli_fetch_array($cdresult)) {
$N=$cdrow["name"];
echo "<option>
$N
</option>";
}
?>
</select>
</div>
<div class="form-group col-md-4">
<button type="submit" name="search" class="btn btn-success">Search Buses</button>
</div>
</div>
</form>
<div class="container">
<div id="query">
<table class="table table-bordered">
<thead>
<tr>
<th>Rote Id</th>
<th>Route</th>
<th>Options</th>
</tr>
</thead>
<?php
if ( isset($_POST['search']) )
{
$source = $_POST['source'];
$dest = $_POST['destination'];
{
$get_route ="select * from routes where stops like '%$source%' or stops like '%$dest%'";
$run_route = mysqli_query($con,$get_route);
while($row_routes=mysqli_fetch_array($run_route))
{
?>
<tr>
<td><?php echo $row_routes['id']?></td>
<td>
<?php
$str=$row_routes['stops'];
$arr = explode(',', $str);
$k = strlen($str);
for($i=0;$i<$k-1;$i++){
echo $str[$i];
//$i=$i+2;
};
?></td>
<td>
<button type="button" class="btn btn-primary">Check Status</button>
<button type="button" class="btn btn-secondary"></button>
<button type="button" class="btn btn-success">Success</button></td>
</tr>
<?php }
}}
?>