<?php include '/etc/rr_inventory.php'; ?>

<h1>Rolling Stock</h1>
<a href="edit.php">Add New</a>

<table border="1">
<tr>
<th>Road</th><th>Number</th><th>Type</th><th>Owner</th><th>Actions</th>
</tr>

<?php
$result = $mysqli->query("SELECT * FROM rolling_stock ORDER BY road, road_number");

while ($row = $result->fetch_assoc()):
?>
<tr>
<td><?= $row['road'] ?></td>
<td><?= $row['road_number'] ?></td>
<td><?= $row['type'] ?></td>
<td><?= $row['owner'] ?></td>
<td><a href="edit.php?id=<?= $row['id'] ?>">Edit</a></td>
</tr>
<?php endwhile; ?>
</table>
