<div class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <div class="img-profile ml-4">
          <img src="<?= base_url() ?>assets/uploads/newlogo1.png" class="img-circle img-fluid" style="height: 100px;width: 100px;">
        </div>
        <h1 class="m-0 text-dark"><?php echo (isset($customerdetails)) ? 'Edit Customer' : 'Add Customer' ?>
        </h1>
      </div><!-- /.col -->
      <div class="col-sm-6">
        <ol class="breadcrumb float-sm-right">
          <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard">Customer</a></li>
          <li class="breadcrumb-item active"><?php echo (isset($customerdetails)) ? 'Edit Customer' : 'Add Customer' ?></li>
        </ol>
      </div><!-- /.col -->
    </div><!-- /.row -->
  </div><!-- /.container-fluid -->
</div>
<!-- Main content -->
<section class="content">
  <div class="container-fluid">
    <form method="post" id="customer_add" class="card" action="<?php echo base_url() . "customer/insertcustomer"; ?>">
      <div class="card-body">

        <div class="row">
          <input type="hidden" name="id" id="c_id" value="<?php echo (isset($customerdetails)) ? $customerdetails[0]['id'] : '' ?>">

          <div class="col-sm-6 col-md-3">
            <div class="form-group">
              <label class="form-label">First Name<span class="form-required">*</span></label>
              <input type="text" required="true" class="form-control" value="<?php echo (isset($customerdetails)) ? $customerdetails[0]['name'] : '' ?>" id="c_name" name="firstName" placeholder="Customer Name">
            </div>
          </div>
          <div class="col-sm-6 col-md-3">
            <div class="form-group">
              <label class="form-label">Last Name<span class="form-required">*</span></label>
              <input type="text" required="true" class="form-control" name="lastName" placeholder="Customer Name">
            </div>
          </div>
          <div class="col-sm-6 col-md-3">
            <div class="form-group">
              <label class="form-label">Mobile<span class="form-required">*</span></label>
              <input type="text" required="true" class="form-control" value="<?php echo (isset($customerdetails)) ? $customerdetails[0]['mobile'] : '' ?>" id="c_mobile" name="phoneNumber" placeholder="Customer Mobile">
            </div>
          </div>
          <div class="col-sm-6 col-md-4">
            <div class="form-group">
              <label class="form-label">Email</label>
              <input type="text" required="true" class="form-control" value="<?php echo (isset($customerdetails)) ? $customerdetails[0]['email'] : '' ?>" id="c_email" name="email" placeholder="Customer Email">

            </div>
          </div>
          <?php if (isset($customerdetails[0]['isActive'])) { ?>
            <div class="col-sm-6 col-md-2">
              <div class="form-group">
                <label for="c_isactive" class="form-label">Customer Status</label>
                <select id="c_isactive" name="isActive" class="form-control " required="">
                  <option value="">Select Driver Status</option>
                  <option <?php echo (isset($customerdetails) && $customerdetails[0]['isActive'] == 1) ? 'selected' : '' ?> value="1">Active</option>
                  <option <?php echo (isset($customerdetails) && $customerdetails[0]['isActive'] == 0) ? 'selected' : '' ?> value="0">Inactive</option>
                </select>
              </div>
            </div>
            <?php } ?>

            <div class="col-sm-6 col-md-6">
              <div class="form-group">
                <label class="form-label">Password<span class="form-required">*</span></label>
                <input class="form-control" required="true" id="c_password" autocomplete="off" type="password" placeholder="Password" name="password">
              </div>
            </div>





        </div>
        <input type="hidden" id="c_created_date" name="createdDate" value="<?php echo date('Y-m-d h:i:s'); ?>">

        <div class="modal-footer">

          <button type="submit" class="btn btn-primary"> <?php echo (isset($customerdetails)) ? 'Update Customer' : 'Add Customer' ?></button>
        </div>
      </div>
    </form>
  </div>
</section>
<!-- /.content -->