<?php
include 'inc/Header.php';
?>
<!-- Loader ends-->
<!-- page-wrapper Start-->
<div class="page-wrapper compact-wrapper" id="pageWrapper">
  <!-- Page Header Start-->
  <?php
  include 'inc/Topbar.php';
  ?>
  <!-- Page Header Ends                              -->
  <!-- Page Body Start-->
  <div class="page-body-wrapper">
    <!-- Page Sidebar Start-->
    <?php
    include 'inc/Sidebar.php';
    ?>
    <!-- Page Sidebar Ends-->
    <div class="page-body">
      <div class="container-fluid">
        <div class="page-title">
          <div class="row">
            <div class="col-6">
              <h3>Store Orders Management</h3>
            </div>
            <div class="col-6">

            </div>
          </div>
        </div>
      </div>
      <!-- Container-fluid starts-->
      <div class="container-fluid default-page">
        <div class="row">
          <div class="col-sm-12">
            <div class="card">
              <div class="card-body">
                <div class="table-responsive">
                  <table class="display" id="basic-1">
                    <thead>
                      <tr>
                        <th>Sr No.</th>
                        <th>Customer Name</th>
                        <th>Order number</th>
                        <th>Total (GHc)</th>
                        <th>Delivery Option</th>
                        <th>Status</th>
                        <th>Action</th>
                      </tr>
                    </thead>
                    <tbody>
                      <?php
                      $city = $lundry->query("select * from store_orders order by id desc");
                      $i = 0;
                      while ($row = $city->fetch_assoc()) {
                        $i = $i + 1;
                        $user = $lundry->query("select * from tbl_user where id=" . $row['uid']);
                      ?>
                        <tr>
                          <td>
                            <?php echo $i; ?>
                          </td>

                          <td class="align-middle">
                            <?php echo $user->fetch_assoc()['name']; ?>
                          </td>

                          <td class="align-middle">
                            <?php echo $row['order_num']; ?>
                          </td>

                          <td class="align-middle">
                            <?php echo $row['total']; ?>
                          </td>

                          <td class="align-middle">
                            <?php echo $row['delivery_option']; ?>
                          </td>

                          <td class="align-middle">
                            <?php echo $row['status']; ?>
                          </td>

                          <td style="white-space: nowrap; width: 20%;">
                            <form method="post" class="d-flex">

                              <input type="hidden" name="type" value="update_storeorder_status">
                              <input type="hidden" name="order_id" value="<?php echo $row['id']; ?>">
                              <div class="d-grid">
                                <label>Update Status</label>
                                <select name="status" id="" class="form-control">
                                  <option value="">select</option>
                                  <option value="Pending">Pending</option>
                                  <option value="Washing">Washing</option>
                                  <option value="Drying">Drying</option>
                                  <option value="Completed">Completed</option>
                                </select>
                              </div>
                              <button type="submit" class="btn btn-sm btn-primary ms-2 mt-4">Update</button>
                              <a href="list_store_orders_details.php?order_id=<?php echo $row['order_num']; ?>" class="">
                             <img src="images/icons/eye.svg" width="30" class="mt-3" />
                              </a>
                             <!-- <a>-->
                             <!--<img src="images/icons/trash.svg" width="30" class="mt-3" />-->
                             <!-- </a>-->
                            </form>
                          </td>
                        </tr>
                      <?php
                      }
                      ?>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>

          </div>
        </div>
      </div>
      <!-- Container-fluid Ends-->
    </div>
    <!-- footer start-->

  </div>
</div>
<!-- latest jquery-->
<?php
include 'inc/Footer.php';
?>

</body>


</html>