BBnepal-Accounts/library/application/views/lms-admin/login.php

157 lines
5.3 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 Login</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
$uname = ''; $pass = ''; $rme = 'Off';
if(isset($_COOKIE["username"]))
$uname = $_COOKIE["username"];
if(isset($_COOKIE["password"]))
$pass = $_COOKIE["password"];
if(isset($_COOKIE["rem_me"]))
$rme = $_COOKIE["rem_me"];
if(count($_POST) > 0)
{
$uname = $_POST['email'];
$pass = $_POST['password'];
if(isset($_POST['remember_me']))
$rme = 'On';
}
?>
<div class="login-box-cover">
<div class="login-box">
<h3><?php echo $title;?></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().'admin';?>' id="loginform" method="post">
<div class="login-row">
<input type="text" name="email" id="email" value='<?php echo $uname;?>' placeholder="Enter Your Email ID">
<p class="login_err" id='email_error'></p>
<span style="color:red;"><?php echo form_error('email'); ?><span>
</div>
<div class="login-row">
<input type="password" name="password" id="paswd" value='<?php echo $pass;?>' placeholder="Password" class="password_hide">
<span class="passwrd-icon icon-y"><i class="far fa-eye"></i></span>
<p class="login_err" id='paswd_error'></p>
<span style="color:red;"><?php echo form_error('password'); ?><span>
</div>
<div class="login-row">
<div class="forget-password">
<a href="<?php echo base_url().'forgot-password';?>">Forgot Password?</a>
</div>
<div class="rem-paswd">
<input type="checkbox" name="remember_me" <?php if($rme=='On'){?>checked<?php } ?> >
<label>Remember Me</label>
</div>
</div>
<div class="login-row">
<button class="common-btn" type='button' onclick="validate_login_form()">Login</button>
</div>
</form>
</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">
$(document).ready(function(){
$(document).on('keypress', function(e){
if(e.which==13)
{
//if(js_status != 'Not Verified')
validate_login_form();
}
});
});
function hide_all_login_errors()
{
$('#email_error').hide();
$('#password_error').hide();
}
function validate_login_form()
{
hide_all_login_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.');
}
var lpwd = $('#paswd').val().trim();
if(lpwd==''){
errArr.push('paswd_Sep@Str_Please enter your password.');
}
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{
$('#loginform').submit();
}
}
</script>
</body>
</html>