BBnepal-Accounts/hr/application/views/bustracking-admin/login.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

162 lines
5.7 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Human Resource Login</title>
<!--styles links-->
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/jquery-ui.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/font-family.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/all.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/owl-carousel/css/owl.carousel.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/fontawesome.min.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/style-admin.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets-bustracking/css/style-admin-responsive.css">
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>assets-bustracking/fav.png">
</head>
<body>
<div class="login-wrap p-2">
<div class="logo-wrap">
<a href='<?php echo base_url() . 'admin'; ?>'>
<img src="<?php echo base_url(); ?>assets-bustracking/images/erisn-blue.png">
</a>
</div>
<!-- <img src="<?php echo base_url(); ?>assets-bustracking/images/login.png" 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="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-8"><img src="<?php echo base_url(); ?>assets-bustracking/images/login.png" class="w-100" alt="">
</div>
<div class="col-md-4 col-lg-4 login-right">
<div class="login-box w-100">
<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="form_err" id='email_error'></p>
<span class="form_err"><?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="paswd">
<span class="passwrd-icon icon-y"><i class="far fa-eye"></i></span>
<p class="form_err" id='paswd_error'></p>
<span class="form_err"><?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>
</div>
</div>
</div>
<script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.4.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-ui.min.js"></script>
<script src="<?php echo base_url(); ?>assets-bustracking/js/popper.min.js"></script>
<script src="<?php echo base_url(); ?>assets-bustracking/js/bootstrap.min.js"></script>
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/all.js"></script>
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/main.js"></script>
<script src="<?php echo base_url(); ?>assets-bustracking/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();
$('#paswd_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>