-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from sk-upadhyay/main
Feat: Filter genuine email #21
- Loading branch information
Showing
4 changed files
with
287 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,160 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<?php | ||
<?php | ||
session_start(); | ||
include('./db_connect.php'); | ||
ob_start(); | ||
// if(!isset($_SESSION['system'])){ | ||
include ('./db_connect.php'); | ||
ob_start(); | ||
// if(!isset($_SESSION['system'])){ | ||
|
||
$system = $conn->query("SELECT * FROM system_settings")->fetch_array(); | ||
foreach($system as $k => $v){ | ||
$_SESSION['system'][$k] = $v; | ||
} | ||
// } | ||
ob_end_flush(); | ||
$system = $conn->query("SELECT * FROM system_settings")->fetch_array(); | ||
foreach ($system as $k => $v) { | ||
$_SESSION['system'][$k] = $v; | ||
} | ||
// } | ||
ob_end_flush(); | ||
?> | ||
<?php | ||
if(isset($_SESSION['login_id'])) | ||
header("location:index.php?page=home"); | ||
<?php | ||
if (isset($_SESSION['login_id'])) | ||
header("location:index.php?page=home"); | ||
|
||
?> | ||
<?php include 'header.php' ?> | ||
|
||
<style> | ||
.login-logo { | ||
text-align: center; | ||
margin-bottom: 20px; /* Adjust as needed */ | ||
margin-bottom: 20px; | ||
/* Adjust as needed */ | ||
} | ||
|
||
.login-logo img { | ||
width: 200px; /* Set the width as per your requirements */ | ||
height: auto; /* This maintains the image's aspect ratio */ | ||
width: 200px; | ||
/* Set the width as per your requirements */ | ||
height: auto; | ||
/* This maintains the image's aspect ratio */ | ||
} | ||
</style> | ||
|
||
<body class="hold-transition login-page bg-white"> | ||
|
||
<h2><b>COER AQMS</b></h2> | ||
<div class="login-box"> | ||
<div class="login-logo"> | ||
<a href="#" class="text-white"></a> | ||
</div> | ||
<!-- /.login-logo --> | ||
<div class="login-box"> | ||
<div class="login-logo"> | ||
<a href="#" class="text-white"></a> | ||
</div> | ||
<!-- /.login-logo --> | ||
|
||
|
||
<div class="card"> | ||
<div class="card-body login-card-body"> | ||
<div class="card"> | ||
<div class="card-body login-card-body"> | ||
<div class="login-logo"> | ||
<img src="profpraisal.png" alt="Your Image Alt Text"> | ||
<img src="profpraisal.png" alt="Your Image Alt Text"> | ||
</div> | ||
<form action="" id="login-form"> | ||
<!-- <div class="card"> | ||
<!-- <div class="card"> | ||
<div class="card-body login-card-body"> | ||
<form action="" id="login-form"> --> | ||
<div class="input-group mb-3"> | ||
<input type="email" class="form-control" name="email" required placeholder="Email"> | ||
<div class="input-group-append"> | ||
<div class="input-group-text"> | ||
<span class="fas fa-envelope"></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="input-group mb-3"> | ||
<input type="password" class="form-control" name="password" required placeholder="Password"> | ||
<div class="input-group-append"> | ||
<div class="input-group-text"> | ||
<span class="fas fa-lock"></span> | ||
<div class="input-group mb-3"> | ||
<input type="email" class="form-control" name="email" required placeholder="Email"> | ||
<div class="input-group-append"> | ||
<div class="input-group-text"> | ||
<span class="fas fa-envelope"></span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group mb-3"> | ||
<label for="">Login As</label> | ||
<select name="login" id="" class="custom-select custom-select-sm"> | ||
<option value="3">Student</option> | ||
<option value="2">Faculty</option> | ||
<option value="1">Admin</option> | ||
</select> | ||
</div> | ||
<div class="row"> | ||
<div class="col-8"> | ||
<div class="icheck-primary"> | ||
<input type="checkbox" id="remember"> | ||
<label for="remember"> | ||
Remember Me | ||
</label> | ||
<div class="input-group mb-3"> | ||
<input type="password" class="form-control" name="password" required placeholder="Password"> | ||
<div class="input-group-append"> | ||
<div class="input-group-text"> | ||
<span class="fas fa-lock" onclick="togglePasswordVisibility()"></span> | ||
<span class="fas fa-eye" style="display:none;" onclick="togglePasswordVisibility()"></span> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /.col --> | ||
<div class="col-4"> | ||
<button type="submit" class="btn btn-primary btn-block">Sign In</button> | ||
<div class="form-group mb-3"> | ||
<label for="">Login As</label> | ||
<select name="login" id="" class="custom-select custom-select-sm"> | ||
<option value="3">Student</option> | ||
<option value="2">Faculty</option> | ||
<option value="1">Admin</option> | ||
</select> | ||
</div> | ||
<p class="mb-1"> | ||
Don't have an account? <a href="signup.php" class="text-center">Sign up</a> | ||
</p> | ||
<div class="row"> | ||
<div class="col-8"> | ||
<div class="icheck-primary"> | ||
<input type="checkbox" id="remember"> | ||
<label for="remember"> | ||
Remember Me | ||
</label> | ||
</div> | ||
</div> | ||
<!-- /.col --> | ||
<div class="col-4"> | ||
<button type="submit" class="btn btn-primary btn-block">Sign In</button> | ||
</div> | ||
<p class="mb-1"> | ||
Don't have an account? <a href="signup.php" class="text-center">Sign up</a> | ||
</p> | ||
|
||
<!-- /.col --> | ||
</div> | ||
</form> | ||
<!-- /.col --> | ||
</div> | ||
</form> | ||
</div> | ||
<!-- /.login-card-body --> | ||
</div> | ||
<!-- /.login-card-body --> | ||
</div> | ||
</div> | ||
<!-- /.login-box --> | ||
<script> | ||
$(document).ready(function(){ | ||
$('#login-form').submit(function(e){ | ||
e.preventDefault() | ||
start_load() | ||
if($(this).find('.alert-danger').length > 0 ) | ||
$(this).find('.alert-danger').remove(); | ||
$.ajax({ | ||
url:'ajax.php?action=login', | ||
method:'POST', | ||
data:$(this).serialize(), | ||
error:err=>{ | ||
console.log(err) | ||
end_load(); | ||
<!-- /.login-box --> | ||
<script> | ||
$(document).ready(function () { | ||
$('#login-form').submit(function (e) { | ||
e.preventDefault() | ||
start_load() | ||
if ($(this).find('.alert-danger').length > 0) | ||
$(this).find('.alert-danger').remove(); | ||
$.ajax({ | ||
url: 'ajax.php?action=login', | ||
method: 'POST', | ||
data: $(this).serialize(), | ||
error: err => { | ||
console.log(err) | ||
end_load(); | ||
|
||
}, | ||
success:function(resp){ | ||
if(resp == 1){ | ||
location.href ='index.php?page=home'; | ||
}else{ | ||
$('#login-form').prepend('<div class="alert alert-danger">Username or password is incorrect.</div>') | ||
end_load(); | ||
} | ||
} | ||
}, | ||
success: function (resp) { | ||
if (resp == 1) { | ||
location.href = 'index.php?page=home'; | ||
} else { | ||
$('#login-form').prepend('<div class="alert alert-danger">Username or password is incorrect.</div>') | ||
end_load(); | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
</script> | ||
<?php include 'footer.php' ?> | ||
</script> | ||
<script> | ||
function togglePasswordVisibility() { | ||
var passwordInput = document.querySelector('[name="password"]'); | ||
var lockIcon = document.querySelector('.fa-lock'); | ||
var eyeIcon = document.querySelector('.fa-eye'); | ||
|
||
// Check if the password is currently visible | ||
if (passwordInput.type === 'password') { | ||
// If hidden, change to 'text' to show it and toggle icons | ||
passwordInput.type = 'text'; | ||
lockIcon.style.display = 'none'; | ||
eyeIcon.style.display = 'block'; | ||
} else { | ||
// If visible, change to 'password' to hide it and toggle icons | ||
passwordInput.type = 'password'; | ||
lockIcon.style.display = 'block'; | ||
eyeIcon.style.display = 'none'; | ||
} | ||
} | ||
|
||
</script> | ||
<?php include 'footer.php' ?> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.