119 lines
4.7 KiB
PHP
119 lines
4.7 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_content">
|
|
<br />
|
|
<form id="change-pass" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
|
action="<?php echo base_url();?>User/check_password" 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 <a
|
|
style="color:red;">*</a> </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 <a
|
|
style="color:red;">*</a> </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 <a
|
|
style="color:red;">*</a> </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>
|
|
|
|
<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 type="reset" class="btn btn-primary" >Reset</button>
|
|
<button type="submit" id="submit" class="btn btn-success">Submit</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- --------------------------- -->
|
|
</form>
|
|
</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> |