<?php  
$user = $this->db->select('*')->where('admin_id', $this->session->userdata('admin_id'))->get('admin')->result_array();
?>
            <!-- TOP Nav Bar END -->
            <div class="container-fluid">
               <div class="row">
                  <div class="col-sm-2 col-lg-2"></div>
                  <div class="col-sm-8 col-lg-8">
                     <div class="iq-card">
                        <div class="iq-card-header d-flex justify-content-between">
                           <div class="iq-header-title">
                              <h4 class="card-title">Edit Personal Details</h4>
                           </div>
                        </div>
                        <div class="iq-card-body">
                           <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>Failed 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="InputText1">Name </label>
                                    <input type="text" class="form-control" name="fullname" value="<?php echo $user[0]['fullname']; ?>" id="InputText1"  placeholder="Full Name" required>
                                 </div>
                              </div>
                              <div class="col-sm-12 col-lg-12">
                                 <div class="form-group">
                                    <label for="InputEmail3">Email ID</label>
                                    <input type="email" class="form-control" name="email" id="InputEmail3" value="<?php echo $user[0]['email']; ?>" placeholder="Enter Email ID" 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="mobile_no" id="Inputphone" value="<?php echo $user[0]['mobile_no']; ?>" required>
                                 </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: {
fullname: {
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(); ?>profile/update_details',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('.addbtn').hide();
$('.addload').show();
},
success: function(msg) {
if(msg=='success')
{
$(".Add").show();
$('.Add').delay(3000).hide(200);
$('.addbtn').show();
$('.addload').hide();
setInterval(function() {
location.reload();
}, 3000);
}
else
{
$(".Adderror").show();
$('.Adderror').delay(3000).hide(200);
$('.addbtn').show();
$('.addload').hide();

}
}
});
}
});
});
</script>