BBnepal-Accounts/library/application/views/lms-admin/reset-password.php

192 lines
6.6 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> LMS | Reset Password</title>
<!--styles links-->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/jquery-ui.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/font-family.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/all.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/owl-carousel/css/owl.carousel.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/fontawesome.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/style-admin.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-lms/css/style-admin-responsive.css">
</head>
<body>
<div class="login-wrap">
<div class="logo-wrap">
<img src="<?php echo base_url(); ?>assets-lms/images/erisn-blue.png">
</div>
<img src="<?php echo base_url(); ?>assets-lms/images/library-login.gif" class="login-img">
<?php
$isResetPasswordSuccess = 'No';
if($this->session->userdata('isResetPasswordSuccess')){
$isResetPasswordSuccess = 'Yes';
$this->session->unset_userdata('isResetPasswordSuccess');
}
?>
<?php
$pwd = ''; $conf_pwd = '';
if(count($_POST) > 0)
{
$pwd = $_POST['password'];
$conf_pwd = $_POST['conf_password'];
}
?>
<div class="login-box-cover">
<div class="login-box">
<h3>Reset Your Password</h3>
<?php if($this->session->flashdata('danger')){?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<p><?php echo $this->session->flashdata('danger') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<form action="<?php echo base_url().'reset-password/'.$encodedEmailId;?>" id="resetPasswordForm" method="post">
<div class="login-row">
<p>Your email address is verified successfully. You can now reset your password here.</p>
</div>
<div class="login-row paswd_reset">
<label class="login-lbl">
New Password*
</label>
<input type="password" name="password" id="password" placeholder="Enter new passwod" class="password_hide">
<span class="passwrd-icon icon-y"><i class="far fa-eye"></i></span>
<p class="login_err" id='password_error'></p>
<span class="login_err"><?php echo form_error('password'); ?><span>
</div>
<div class="login-row paswd_reset">
<label class="login-lbl">
Retype New Password*
</label>
<input type="password" name="conf_password" id="conf_password" placeholder="Retype new password" class="paswd1">
<span class="passwrd-con icon-con-y"><i class="far fa-eye"></i></span>
<p class="login_err" id='conf_password_error'></p>
<span class="login_err"><?php echo form_error('conf_password'); ?><span>
</div>
<div class="login-row">
<button class="common-btn" type='button' onclick='validate_rp_form()'>Reset Password</button>
</div>
</form>
<div class="backto-login">
<a href="<?php echo base_url().'admin';?>"> &lt Back to login </a>
</div>
</div>
</div>
</div>
<div class="passwdChange_modal">
<div class="modal fade" id="passwordChangeModal" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<i class="fas fa-check-circle"></i>
<h4 class="modal-title">Success</h4>
</div>
<div class="modal-body">
Your password has been reset successfully. You can now login with new password.
</div>
<div class="modal-footer">
<div class="dashboard-btn-wrap" style='justify-content:center;'>
<button class="common-btn" onclick='go_to_admin_login()'>Go to login page</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="<?php echo base_url(); ?>assets-lms/js/jquery-3.4.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets-lms/js/jquery-ui.min.js"></script>
<script src="<?php echo base_url(); ?>assets-lms/js/popper.min.js"></script>
<script src="<?php echo base_url(); ?>assets-lms/js/bootstrap.min.js"></script>
<script defer src="<?php echo base_url(); ?>assets-lms/js/all.js"></script>
<script defer src="<?php echo base_url(); ?>assets-lms/js/main.js"></script>
<script src="<?php echo base_url(); ?>assets-lms/owl-carousel/js/owl.carousel.min.js"></script>
<script type="text/javascript">
var isResetPasswordSuccess = '<?php echo $isResetPasswordSuccess;?>';
if(isResetPasswordSuccess == 'Yes'){
$('#passwordChangeModal').modal('show');
}
function go_to_admin_login()
{
window.location = '<?php echo base_url()."admin";?>';
}
$(document).ready(function(){
$(document).on('keypress', function(e){
if(e.which==13)
{
//if(js_status != 'Not Verified')
validate_rp_form();
}
});
});
function hide_all_rp_errors()
{
$('#password_error').hide();
$('#conf_password_error').hide();
}
function validate_rp_form()
{
hide_all_rp_errors();
var errArr = new Array();
var pwd = $('#password').val().trim();
var conf_password = $('#conf_password').val().trim();
if(pwd==''){
errArr.push('password_Sep@Str_Please enter your new password.');
}
else{
var regPwdReg = /(?=.*[a-zA-Z0-9])(?=.*?\W).{6,}/;
if(!regPwdReg.test($('#password').val()))
errArr.push('password_Sep@Str_Password should be minimum 6 characters and should have atleast one special character.');
}
if(conf_password==''){
errArr.push('conf_password_Sep@Str_Please re-enter your new password.');
}
if($('#password').val()!='' && $('#conf_password').val()!='' && ($('#password').val() != $('#conf_password').val()) )
errArr.push('conf_password_Sep@Str_Password & Retype Password does not match.');
if(errArr.length>0)
{
for(i=0; i<errArr.length; i++)
{
var resArr = errArr[i].split("_Sep@Str_");
$("#"+resArr[0]+"_error").html(resArr[1]);;
$("#"+resArr[0]+"_error").show();
}
var xxxVal = errArr[0].split('_Sep@Str_');
$('#'+xxxVal[0]).focus();
return false;
}
else{
$('#resetPasswordForm').submit();
}
}
</script>
</body>
</html>