
            <!-- TOP Nav Bar END -->
            <div class="container-fluid">
               <div class="row">
                  <div class="col-sm-12 col-lg-12">
                     <div class="iq-card">
                        <div class="iq-card-header d-flex justify-content-between">
                           <div class="iq-header-title">
                              <h4 class="card-title">Edit Customer</h4>
                           </div>
                              <span class="table-add float-right mb-3 mr-2">
                              <a href="<?php echo base_url(); ?>customer/" class="btn btn-default" style="float: right;"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</a>&emsp;
                              </span>
                        </div>
                        <div class="iq-card-body">
                           <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vulputate, ex ac venenatis mollis, diam nibh finibus leo</p>
                           <div class="alert alert-success Add" style="display: none;">
                                <strong>Data Successfully Updated!</strong>
                            </div>
                            <div class="alert alert-danger Adderror" style="display: none;">
                                <strong>Duplicate Entry!</strong>
                            </div>
                           <form role="form" method="post" id="addfrm">
                              <div class="row"> 
                              <div class="col-sm-12 col-lg-12">
                              <div class="form-group">
                                 <label for="FormControlSelect1">Category</label>
                                 <select class="form-control" name="c_category" id="FormControlSelect1" required>
                                    <option value="">Select Category</option>
                                    <?php  
                                    foreach ($category as $key_val) {
                                    ?>
                                    <option value="<?php echo $key_val['cat_id']; ?>" <?php if($row->c_category==$key_val['cat_id']){ echo 'selected'; } ?>><?php echo $key_val['cat_name']; ?></option>
                                    <?php } ?>
                                 </select>
                              </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">  
                                 <div class="form-group">
                                    <label for="InputText1">Name </label>
                                    <input type="text" class="form-control" name="c_name" id="InputText1" value="<?php echo $row->c_name; ?>" placeholder="Enter Name" required>
                                 </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">
                                 <div class="form-group">
                                    <label for="Inputphone">Mobile Number</label>
                                    <input type="tel" class="form-control" name="c_mobile" id="Inputphone" value="<?php echo $row->c_mobile; ?>" required>
                                 </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">
                                 <div class="form-group">
                                    <label for="Inputemail">Email ID</label>
                                    <input type="email" class="form-control" name="c_email" id="Inputemail" value="<?php echo $row->c_email; ?>" required>
                                 </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">
                              <div class="form-group">
                                 <label for="FormControlTextarea1">Address</label>
                                 <textarea name="c_address" class="form-control" id="FormControlTextarea1" rows="5" placeholder="Enter Address" required><?php echo $row->c_address; ?></textarea>
                                 <input type="hidden" name="c_id" value="<?php echo $row->c_id; ?>">
                              </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">
                              <button type="submit" class="btn btn-primary addbtn">Submit</button>
                              <button class="btn btn-primary addload buttonload" style="display: none;"><i class="fa fa-spinner fa-spin" style=" margin-left: -12px; margin-right: 8px;"></i>Please Wait</button>
                              <button type="reset" class="btn iq-bg-danger">cancel</button>
                           </div>

                              </div>
                           </form>
                        </div>
                     </div>
                  </div>
               </div>
            </div>
            
           
<script>
// just for the demos, avoids form submit
jQuery.validator.setDefaults({
success: "valid"
});
$("#addfrm").validate({
rules: {
project_name: {
required: true
}
}
});
</script>
<script>
$(document).ready(function(e) {
$("#addfrm").on('submit', function(e) {
e.preventDefault();
var formStatus = $('#addfrm').validate().form();
if (true == formStatus) {
$.ajax({
type: 'POST',
url: '<?php echo base_url(); ?>customer/Edit_data',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('.addbtn').hide();
$('.addload').show();
},
success: function(msg) {
$(".Add").show();
$('.Add').delay(3000).hide(200);
$('.addbtn').show();
$('.addload').hide();
setInterval(function() {
location.reload();
}, 3000);
}
});
}
});
});
</script>