<?php
require_once("models/orders.class.php");
$item = [];
if (isset($_GET["id"])) {
    $item = ResOrders::readById($_GET["id"]);
}

?>
<h1>Details of Orders</h1>
<a href="orders" class="btn btn-primary mb-3">Back to Manage</a>

<?php if (!empty($item)) { ?>
<table class="table table-striped">
  <tr>
    <th>Id</th>
    <td><?php echo ($item['id']); ?></td>
  </tr>
  <tr>
    <th>Order Id</th>
    <td><?php echo ($item['order_id']); ?></td>
  </tr>
  <tr>
    <th>Table Id</th>
    <td><?php echo ($item['table_id']); ?></td>
  </tr>
  <tr>
    <th>Total Amount</th>
    <td><?php echo ($item['total_amount']); ?></td>
  </tr>
  <tr>
    <th>Special Request</th>
    <td><?php echo ($item['special_request']); ?></td>
  </tr>
  <tr>
    <th>Order Status Id</th>
    <td><?php echo ($item['order_status_id']); ?></td>
  </tr>
</table>
<?php } else { echo "<p>No data found.</p>"; } ?>
