<?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>*Customer 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">
              <?php
              if (isset($_GET['id'])) {
                $data = $lundry->query("select * from tbl_user where id=" . $_GET['id'] . "")->fetch_assoc();
              ?>
                <form method="post" enctype="multipart/form-data">

                  <div class="card-body">

                    <div class="form-group mb-3">
                      <label>Customer Name</label>
                      <input type="text" class="form-control" placeholder="Enter Title" value="<?php echo $data['name']; ?>" name="name" required="">
                      <input type="hidden" name="type" value="edit_user" />
                      <input type="hidden" name="id" value="<?php echo $_GET['id']; ?>" />
                    </div>

                    <div class="form-group mb-3">
                      <label>Customer Email</label>
                      <input type="text" class="form-control" placeholder="Enter Title" value="<?php echo $data['email']; ?>" name="email">
                    </div>
                    <div class="form-group mb-3">
                      <label>Customer country code</label>
                      <input type="text" class="form-control" placeholder="Enter Country code" value="<?php echo $data['ccode']; ?>" name="ccode" required="">
                    </div>
                    <div class="form-group mb-3">
                      <label>Customer Phone</label>
                      <input type="text" class="form-control" placeholder="Enter Title" value="<?php echo $data['mobile']; ?>" name="mobile" required="">
                    </div>

                  </div>
                  <div class="card-footer text-left">
                    <button type="submit" class="btn btn-primary me-5">Update Customer</button>
                    <!--<button onclick="return confirm('Confirm you want to delete customer?')" class="btn btn-danger ms-5">Delete Customer</button>-->
                  </div>
                </form>
              <?php
              } else {
              ?>
                <form method="post" enctype="multipart/form-data">

                  <div class="card-body">
                    <div class="form-group mb-3">
                      <label>Customer Name</label>
                      <input type="text" class="form-control" placeholder="Enter Title" name="name" required="">
                      <input type="hidden" name="type" value="add_user" />
                    </div>

                    <div class="form-group mb-3">
                      <label>Customer Email</label>
                      <input type="email" class="form-control" placeholder="Enter email" name="email">
                    </div>
                    <div class="form-group mb-3">
                      <label>Customer country code</label>
                      <input type="text" class="form-control" placeholder="Enter Country code" name="ccode" required="">
                    </div>
                    <div class="form-group mb-3">
                      <label>Customer Phone</label>
                      <input type="text" class="form-control" placeholder="Enter Mobile" name="mobile">
                    </div>

                  </div>
                  <div class="card-footer text-left">
                    <button class="btn btn-primary">Save Customer</button>
                  </div>
                </form>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
      <!-- Container-fluid Ends-->
    </div>
    <!-- footer start-->

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

</body>


</html>