160 lines
5.3 KiB
PHP
160 lines
5.3 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title> LMS | Forgot Password</title>
|
|
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>assets-lms/fav.png">
|
|
<!--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
|
|
$isForgotPasswordSuccess = 'No';
|
|
if($this->session->userdata('isForgotPasswordSuccess')){
|
|
$isForgotPasswordSuccess = 'Yes';
|
|
$this->session->unset_userdata('isForgotPasswordSuccess');
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
$eid = '';
|
|
if(count($_POST) > 0)
|
|
{
|
|
$eid = $_POST['email'];
|
|
}
|
|
?>
|
|
<div class="login-box-cover">
|
|
<div class="login-box">
|
|
<h3>Forgot Password?</h3>
|
|
<form action='<?php base_url().'forgot-password';?>' id="forgotPasswordForm" method="post">
|
|
<div class="login-row">
|
|
<p>Please enter your registered email address to get a link to reset your password.</p>
|
|
</div>
|
|
<div class="login-row">
|
|
<label class="login-lbl">
|
|
Email Address*
|
|
</label>
|
|
<input type="text" name="email" id="email" value='<?php echo $eid;?>' placeholder="Enter your email address">
|
|
<p class="login_err" id='email_error'></p>
|
|
<span style="color:red;"><?php echo form_error('email'); ?><span>
|
|
</div>
|
|
<div class="login-row">
|
|
<button class="common-btn" type='button' onclick='validate_fp_form()' >Submit</button>
|
|
</div>
|
|
</form>
|
|
<div class="backto-login">
|
|
<a href="<?php echo base_url().'admin';?>"> < 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">×</button>
|
|
<i class="fas fa-check-circle"></i>
|
|
<h4 class="modal-title">Success</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
An email has been sent to your registered email address which has a link to reset your password.
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="dashboard-btn-wrap" style='justify-content:center;'>
|
|
<button class="common-btn" onclick='go_to_admin_login()'>Close</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 isForgotPasswordSuccess = '<?php echo $isForgotPasswordSuccess;?>';
|
|
if(isForgotPasswordSuccess == '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_fp_form();
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
function hide_all_fp_errors()
|
|
{
|
|
$('#email_error').hide();
|
|
$('#password_error').hide();
|
|
}
|
|
|
|
|
|
function validate_fp_form()
|
|
{
|
|
hide_all_fp_errors();
|
|
|
|
var errArr = new Array();
|
|
|
|
var lemail = $('#email').val().trim();
|
|
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
if(lemail==''){
|
|
errArr.push('email_Sep@Str_Please enter your email address.');
|
|
}else if(!regex.test(lemail)){
|
|
errArr.push('email_Sep@Str_Please enter a valid email address.');
|
|
}
|
|
|
|
|
|
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{
|
|
$('#forgotPasswordForm').submit();
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|