122 lines
3.4 KiB
PHP
122 lines
3.4 KiB
PHP
|
|
<!-- Body page content -->
|
|
|
|
|
|
<div class="">
|
|
<div class="page-title">
|
|
|
|
<div class="title_left">
|
|
<h3>Change Password</h3>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12 ">
|
|
<div class="x_panel">
|
|
<!-- <div class="x_title"> -->
|
|
|
|
<!-- <ul class="nav navbar-right panel_toolbox">
|
|
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
|
</li>
|
|
</ul> -->
|
|
<!-- <h6>General Information</h6> -->
|
|
<!-- <div class="clearfix"></div> -->
|
|
<!-- </div> -->
|
|
<div class="x_content">
|
|
<br />
|
|
<form id="change-pass" data-parsley-validate class="form-horizontal form-label-left" method="post" action="" enctype="multipart/form-data">
|
|
|
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
|
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Old Password </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="password" id="old_password" name="old_password" value="" required="required" class="form-control ">
|
|
<span id='message1'></span>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name"> New Password </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets 
password requires 6 characters minimum">
|
|
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="password" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
|
|
<span id='message'></span>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
</form>
|
|
|
|
|
|
|
|
<div class="ln_solid"></div>
|
|
<div class="item form-group">
|
|
<div class="offset-md-8">
|
|
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
|
<button class="btn btn-primary" type="reset">Reset</button>
|
|
<button type="" id="submit" class="btn btn-success">Submit</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- /Body page content -->
|
|
|
|
<script>
|
|
console.log($("#change-pass").serialize());
|
|
$(document).on('click','#submit',function(){
|
|
var data = $("#change-pass").serialize();
|
|
$.ajax({
|
|
type: "post",
|
|
url: "<?php echo base_url();?>user/check_password",
|
|
data: data,
|
|
json: true,
|
|
success: function(response) {
|
|
response = jQuery.parseJSON(response);
|
|
if (response.status == "success") {
|
|
console.log("ssssssssss");
|
|
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
|
location.href = "<?php echo base_url();?>auth/logout";
|
|
}
|
|
else {
|
|
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
|
$('#message1').html('Worng password').css('color', 'red');
|
|
$('#password').val('');
|
|
$('#confirm_password').val('');
|
|
$('#message').html('');
|
|
}
|
|
},
|
|
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
|
});
|
|
});
|
|
</script>
|