153 lines
4.0 KiB
PHP
153 lines
4.0 KiB
PHP
|
|
<!-- Body page content -->
|
|
<head>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
|
</head>
|
|
<style>
|
|
.field-icon {
|
|
float: right;
|
|
margin-left: -25px;
|
|
margin-top: -25px;
|
|
margin-right: 10px;
|
|
position: relative;
|
|
z-index: 3;
|
|
}
|
|
</style>
|
|
|
|
|
|
<div class="">
|
|
<div class="page-title">
|
|
|
|
<div class="title_left">
|
|
<h3>Add User</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="text" 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" name="password" value="" required="required" class="form-control " title="password must have alphabets 
password requires 6 characters minimum">
|
|
<span 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>
|
|
<!-- --------------------------- -->
|
|
|
|
<script>
|
|
$(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) {
|
|
if (response === "success") {
|
|
// location.href = "<?php echo base_url();?>auth";
|
|
}
|
|
else {
|
|
$('#message1').html('Worng password').css('color', 'red');
|
|
alert(response);
|
|
}
|
|
},
|
|
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
|
});
|
|
});
|
|
|
|
|
|
// match the password and confirm password equal or not
|
|
$('#password, #confirm_password').on('keyup', function () {
|
|
$(':input[type="submit"]').prop('disabled', true);
|
|
if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val().length > 0 ) {
|
|
$('#message').html('Matching').css('color', 'green');
|
|
$('button[type="submit"]').attr("disabled", false);
|
|
}
|
|
else if($('#password').val().length == 0 || $('#confirm_password').val().length == 0){
|
|
$('#message').html('');
|
|
}
|
|
else
|
|
$('#message').html('Not Matching').css('color', 'red');
|
|
});
|
|
|
|
// password eye icon
|
|
$(".toggle-password").click(function() {
|
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
|
var input = $($(this).attr("toggle"));
|
|
if (input.attr("type") == "password") {
|
|
input.attr("type", "text");
|
|
}
|
|
else {
|
|
input.attr("type", "password");
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<div class="ln_solid"></div>
|
|
<div class="item form-group">
|
|
<div class="col-md-3 col-sm-3 offset-md-9">
|
|
<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>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- /Body page content -->
|