-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·549 lines (288 loc) · 10.9 KB
/
index.php
1
<?php session_start();if(isset($_SESSION['username'])){header('location:teachers.php');}$message="";if(isset($_SESSION["error"])) { $message= $_SESSION["error"]; $_SESSION_["error"]="";} ?><!doctype html><html><head><meta charset="utf-8"><title>HOME</title><script type="text/javascript"> function checkForm(form) { if(form.username.value == "") { alert("Error: Username cannot be blank!"); form.username.focus(); return false; } re = /^\w+$/; if(!re.test(form.username.value)) { alert("Error: Username must contain only letters, numbers and underscores!"); form.username.focus(); return false; } if(form.password.value != "" && form.password.value ) { if(form.password.value.length < 6) { alert("Error: Password must contain at least six characters!"); form.password.focus(); return false; } if(form.password.value == form.username.value) { alert("Error: Password must be different from Username!"); form.password.focus(); return false; } /*re = /[0-9]/; if(!re.test(form.password.value)) { alert("Error: password must contain at least one number (0-9)!"); form.password.focus(); return false; }*/ re = /[a-z]/; if(!re.test(form.password.value)) { alert("Error: password must contain at least one lowercase letter (a-z)!"); form.password.focus(); return false; } /*re = /[A-Z]/; if(!re.test(form.password.value)) { alert("Error: password must contain at least one uppercase letter (A-Z)!"); form.password.focus(); return false; }*/ } else { alert("Error: Please check that you've entered and confirmed your password!"); form.password.focus(); return false; } return true; }</script><body><center><? phpif(isset($_SESSION["error"])) { echo $message;} ?><!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><link href="css/maincss.css" rel="stylesheet" type="text/css"><!--link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"--> <link href="admin/css/bootstrap.min.css" rel="stylesheet" type="text/css"><link href="admin/css/index.css" rel="stylesheet" type="text/css"><link href="admin/css/bootstrap.css" rel="stylesheet" type="text/css"><link href="admin/css/bootstrap-grid.css" rel="stylesheet" type="text/css"><link href="admin/css/bootstrap-grid.min.css" rel="stylesheet" type="text/css"><link href="admin/css/bootstrap-reboot.css" rel="stylesheet" type="text/css"><link href="admin/css/bootstrap-reboot.min.css" rel="stylesheet" type="text/css"><link href="admin/css/footer.css" rel="stylesheet" type="text/css"><link href="admin/css/font-awesome.css" rel="stylesheet" type="text/css"><script src="admin/js/jquery-3.3.1.min.js"></script><script src="admin/js/bootstrap.min.js"></script><style type="text/css"> @media screen and (min-width: 768px){ .rwd-break { display: none; }}</style></head><center><nav class="navbar navbar-toggleable-md navbar-light bg-faded"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <img class="col-xs-12" src="davv.png" width="100" height="100" class="d-inline-block align-center" alt="iet-davv"> <a class="navbar-brand col-md-5 col-xs-12 " href="#"><h2 style="color:aliceblue" ><b>Institute of <br class="rwd-break">Engineering & <br class="rwd-break"> Technology <h6 class="col-md-12" style="color:aliceblue;margin-top: auto; " >Attendance System</h6></b></h2></a> <br><p style="color: aliceblue"></p> <br> <div class="collapse navbar-collapse " id="navbarSupportedContent"><br><br> <div class="col-md-5"></div> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <div class="col-md-2"> <a class="nav-link" href="index.php" style="color: aliceblue">Home<span class="sr-only">(current)</span></a></div> </li> <li class="nav-item"> <div class="col-md-2"> <a class="nav-link" href="about.php" style="color: aliceblue">About</a></div> </li> <li class="nav-item"> <div class="col-md-2"> <a class="nav-link" href="admin/admin.php" style="color: aliceblue">Admin</a></div> </li> </ul> </div> </nav><div class="login" style="vertical-align: middle;padding: 70px 0;"> <div class="col-md-4" > <div class="panel panel-login"> <?php echo $message; ?> <div class="panel-heading"> <div class="row"> <div class="col-md-6 rounded"> <a href="#" class="active" id="login-form-link">Faculty</a> </div> <div class="col-md-6 rounded"> <a href="#" id="register-form-link">Student</a> </div> </div> <hr> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <form id="login-form" action="verify.php" method="post" role="form" style="display: block;" onsubmit="return checkForm(this);"> <div class="form-group"> <input type="text" class="form-control" id="username" name="username" placeholder="Username"> </div> <div class="form-group"> <input type="password" class="form-control" id="password" name="password" placeholder="Password"> </div> <div class="form-group"> <div class="row"> <div class="col-md-6 mx-auto"> <button type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login btn-primary" value="Log In">Log In</button> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-12"> <div class="text-center"> <div class="container"> <a href="forget_password.html" class="forgot-password">Forgot Password?</a> </div> </div> </div> </div> </div> </form> <form id="register-form" action="student/student_verify.php" method="post" role="form" style="display: none;"><!-- <div class="form-group row"> <div class="col-md-6"> <label for="inputdefault">Course</label> </div> <div class="col-md-6"> <select class="form-control input-lg" name="course" id="course"> <option>Select Course</option> <option>BE</option> <option>ME</option> <option>MSC</option> </select> </div> </div> <div class="form-group row"> <div class="col-md-6"> <label for="inputdefault">Branch</label> </div> <div class="col-md-6"> <select class="form-control input-lg" name="branch" id="branch"> <option>Select Branch</option> <option>Computer Engineering</option> <option>Information Technology</option> <option>Electronics & Telecommunication</option> <option>Electronics & Instrumentation</option> <option>Mechanical Engineering</option> <option>Civil Engineering</option> <option>Applied Science</option> </select> </div> </div> <div class="form-group row"> <div class="col-md-6"> <label for="inputdefault">Year</label> </div> <div class="col-md-6"> <select class="form-control input-lg" name="year" id="year"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </div> </div> <div class="form-group row"> <div class="col-md-6"> <label for="inputdefault">Section</label> </div> <div class="col-md-6"> <select class="form-control input-lg" name="section" id="section"> <option>A</option> <option>B</option> </select> </div> </div> --> <div class="form-group row"> <div class="col-md-6"> <label for="inputdefault"><b>Enroll no.</b></label> </div> <div class="col-md-6"> <input type="text" name="enroll" id="enroll" tabindex="1" class="form-control" value="" placeholder="Enrollment No."> </div> </div> <div class="form-group"> <div class="row"> <div class="col-md-6"> <input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register btn-primary" value="Log In"></div> </div> </div> </form> </div> </div> </div> </div> </div> </div> </center><!--"----------------------------------------forgot passowrd---------------------------------------------------------------------"--><div class="bs-example"> <!-- Large modal <button class="btn btn-primary" data-toggle="modal" data-target="#largeModal">Large modal</button> --> <div id="largeModal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Large Modal</h4> </div> <div class="modal-body"> <p>Add the <code>.modal-lg</code> class on <code>.modal-dialog</code> to create this large modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-primary">OK</button> </div> </div> </div> </div><!--"----------------------------------------forgot passowrd---------------------------------------------------------------------"--><?php include("footer.php"); ?><script>$(function() { $('#login-form-link').click(function(e) { $("#login-form").delay(100).fadeIn(100); $("#register-form").fadeOut(100); $('#register-form-link').removeClass('active'); $(this).addClass('active'); e.preventDefault(); }); $('#register-form-link').click(function(e) { $("#register-form").delay(100).fadeIn(100); $("#login-form").fadeOut(100); $('#login-form-link').removeClass('active'); $(this).addClass('active'); e.preventDefault(); });});</script></body></html>