

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
               
              </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">

        <div class="col-md-4 col-md-offset-3">
        <?php if ($this->session->flashdata('msg')): ?>
        <div class="alert alert-success">
        <?php echo $this->session->flashdata('msg'); ?>
        </div>
        <?php endif ?>
        
        <?php if ($this->session->flashdata('err-msg')): ?>
        <div class="alert alert-danger">
        <?php echo $this->session->flashdata('err-msg'); ?>
        </div>
        <?php endif ?>
        </div>

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Change Password</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
 <form class="form-horizontal form-label-left" action="<?php echo base_url();?>User/update_password" method="post">
                        
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Old Password <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="old_pass" class="form-control" data-toggle="password" onblur="myFunction()" name="old_pass" placeholder="Old Password" required="required" type="password">
                        </div>
                      </div>
                     
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">New Password <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="new_pass" class="form-control" data-toggle="password" name="new_pass" placeholder="New Password" required="required" type="password">
                        </div>
                      </div>
                 
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Confirm Password <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="con_pass" class="form-control" name="con_pass" data-toggle="password" placeholder="Re-enter Password" required="required" type="password">
                        </div>
                        <p id="status"></p>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right">Update</button>
                        </div>
                      </div>
                    </form>
                  </div>
                
                </div>
              </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
<script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-show-password/1.0.3/bootstrap-show-password.min.js"></script>
    <script type="text/javascript">
  $("#password").password('toggle');
  </script>
 <script>
 $(document).ready(function() {

    $('form').submit(function () {
        if ($('#old_pass').val() === "") {
            return false;
        }
    });

$("#con_pass").keyup(function(){
    var newPassword = $("#new_pass").val();
   // alert(newPassword);
    var confirmPassword = $("#con_pass").val();

    if(newPassword !== confirmPassword) {
     $("#status").text("Password do not match");
    $("#send").attr("disabled", "disabled");
    }else{
     $("#status").text("");
     $("#send").removeAttr("disabled");;
    } 

}); 

window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
    $(this).remove(); 
});
}, 3000);



});

</script>
 
<script>
function myFunction() {
     $val=$('#old_pass').val();
     $.ajax({
         url: '<?php echo base_url(); ?>User/check_pass/'+ $val,
        data: {},
        success: function (res) {
                            if(res == 0)
                            {
                            
                            document.getElementById("send").disabled = true;
                           
                            }
                             else{
                             //alert("You can add class");
                            // $("#msg").css("display", "none");
                             document.getElementById("send").disabled = false;
                             }
                    },
                     error: function(){
                                        alert("failure");
                                    }
                });
    
     
     //alert($val);
    
}
</script> 
 
