-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage_bikes.php
44 lines (43 loc) · 1.35 KB
/
manage_bikes.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manage Bikes</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Manage Bikes</h1>
<form action="add_bike.php" method="POST">
<input type="text" name="bike_name" placeholder="Bike Name" required>
<input type="text" name="bike_type" placeholder="Bike Type" required>
<button type="submit">Add Bike</button>
</form>
<h2>Current Bikes</h2>
<table>
<tr>
<th>Bike ID</th>
<th>Bike Name</th>
<th>Bike Type</th>
<th>Actions</th>
</tr>
<?php
include 'db.php';
$query = "SELECT * FROM bikes";
$result = mysqli_query($conn, $query);
while($row = mysqli_fetch_assoc($result)) {
echo "<tr>
<td>{$row['id']}</td>
<td>{$row['bike_name']}</td>
<td>{$row['bike_type']}</td>
<td>
<a href='edit_bike.php?id={$row['id']}'>Edit</a>
<a href='delete_bike.php?id={$row['id']}'>Delete</a>
</td>
</tr>";
}
?>
</table>
<a href="index.php">Back to Main</a>
</body>
</html>