-
Notifications
You must be signed in to change notification settings - Fork 0
/
table-driver-list.php
66 lines (60 loc) · 1.82 KB
/
table-driver-list.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
<?php /*
include "database.php";
$sql = "select * from journey";
$result = $conn->query($sql);
if(!$result){
die("Invalid query!" .$conn->error);
}
while ($row = $result->fetch_assoc()) {
echo "
<!-- <tr>
<th>{$row['ID']}</th>
<td>{$row['User_name']}</td>
<td>{$row['start_pos']} TO {$row['end_pos']}</td>
<td>{$row['mobile']}</td>
<td>{$row['ID_no']}</td>
<td>
<a class='btn btn-success' href='delete.php?ID=$row[ID]'>Edit</a>
<a class='btn btn-danger' href='delete.php?ID=$row[ID]'>Delete</a>
</td>
</tr>
";
}
--> */
// Include your database connection or any necessary configurations here
// Perform the database query to retrieve data from the "journey" table
include('database.php');
$sql = "SELECT * FROM driver_ride_list";
$result = $conn->query($sql);
if (!$result) {
die("Invalid query: " . $conn->error);
}
?>
<table>
<tr>
<th>Serial No.</th>
<th>Reciepient Name</th>
<th>Journey Details</th>
<th>Mobile number</th>
<th>Driving License Number</th>
<th>Actions</th>
<!-- Add more columns as needed -->
</tr>
<?php
while ($row = $result->fetch_assoc()) {
echo "
<tr>
<th>{$row['ID']}</th>
<td>{$row['User_name']}</td>
<td>{$row['start_pos']} TO {$row['end_pos']}</td>
<td>{$row['mobile']}</td>
<td>{$row['ID_no']}</td>
<td>
<a class='btn btn-success' href='accept-driver.php?ID_no=$row[ID_no]'>Accept</a>
<a class='btn btn-danger' href='delete-driver.php?ID_no=$row[ID_no]'>Reject</a>
</td>
</tr>
";
}
?>
</table>