-
Notifications
You must be signed in to change notification settings - Fork 0
/
table-accepted-ride.php
63 lines (57 loc) · 1.72 KB
/
table-accepted-ride.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
<?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 accepted_rides";
$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>Initial Reading</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>{$row['Initial_Reading']} <b>Km</b>.<br> <b>Updated On:</b> {$row['Initial_Reading_Timestamp']}</td>
</tr>
";
}
?>
</table>