-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php~
executable file
·748 lines (352 loc) · 11.8 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>$(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><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><style> .login{padding-top: 100px; }.panel-login { border-color: #ccc; -webkit-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2); -moz-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2); box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.2); padding-right: 15px; padding-left: 15px; padding-top: 15px;}.panel-login>.panel-heading { color: #00415d; background-color: #fff; border-color: #fff; text-align:center;}.panel-login>.panel-heading a{ text-decoration: none; color: #666; font-weight: bold; font-size: 15px; -webkit-transition: all 0.1s linear; -moz-transition: all 0.1s linear; transition: all 0.1s linear;}.panel-login>.panel-heading a.active{ color: #029f5b; font-size: 18px;}.panel-login>.panel-heading hr{ margin-top: 10px; margin-bottom: 0px; clear: both; border: 0; height: 1px; background-image: -webkit-linear-gradient(left,rgba(0, 0, 0, 0),rgba(0, 0, 0, 0.15),rgba(0, 0, 0, 0)); background-image: -moz-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.15),rgba(0,0,0,0)); background-image: -ms-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.15),rgba(0,0,0,0)); background-image: -o-linear-gradient(left,rgba(0,0,0,0),rgba(0,0,0,0.15),rgba(0,0,0,0));}.panel-login input[type="text"],.panel-login input[type="email"],.panel-login input[type="password"] { height: 45px; border: 1px solid #ddd; font-size: 16px; -webkit-transition: all 0.1s linear; -moz-transition: all 0.1s linear; transition: all 0.1s linear;}.panel-login input:hover,.panel-login input:focus { outline:none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border-color: #ccc;}.btn-login { background-color: #59B2E0; outline: none; color: #fff; font-size: 14px; height: auto; font-weight: normal; padding: 14px 0; text-transform: uppercase; border-color: #59B2E6;}.btn-login:hover,.btn-login:focus { color: #fff; background-color: #53A3CD; border-color: #53A3CD;}.forgot-password { text-decoration: underline; color: #888;}.forgot-password:hover,.forgot-password:focus { text-decoration: underline; color: #666;}.btn-register { background-color: #1CB94E; outline: none; color: #fff; font-size: 14px; height: auto; font-weight: normal; padding: 14px 0; text-transform: uppercase; border-color: #1CB94A;}.btn-register:hover,.btn-register:focus { color: #fff; background-color: #1CA347; border-color: #1CA347;}<!------------------css for modal---------------------->.center { margin-top:50px; }.modal-header { padding-bottom: 5px;}.modal-footer { padding: 0; } .modal-footer .btn-group button { height:40px; border-top-left-radius : 0; border-top-right-radius : 0; border: none; border-right: 1px solid #ddd;} .modal-footer .btn-group:last-child > button { border-right: 0;}<!------------------css for modal----------------------> </style><body><center><? phpif(isset($_SESSION["error"])) { echo $message;} ?><!doctype html><html><head><meta charset="utf-8"><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/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"></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><div class="col-4"> <img src="davv.png" width="100" height="100" class="d-inline-block align-center" alt="iet-davv"> <a class="navbar-brand" href="#"><h2 style="color:aliceblue" >OnlineIET</h2></a> <br><p style="color: aliceblue"></p> </div> <div class="col-4"></div> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <div class="col-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-2"> <a class="nav-link" href="about.php" style="color: aliceblue">About</a></div> </li> <li class="nav-item"> <div class="col-2"> <a class="nav-link" href="logout.php" style="color: aliceblue">Logout</a></div> </li> </ul> </div> </nav><div class="login"> <div class="col-4" > <div class="panel panel-login"> <?php echo $message; ?> <div class="panel-heading"> <div class="row"> <div class="col-6"> <a href="#" class="active" id="login-form-link">Faculty</a> </div> <div class="col-6"> <a href="#" id="register-form-link">Student</a> </div> </div> <hr> </div> <div class="panel-body"> <div class="row"> <div class="col-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-6 mx-auto"> <button type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In">Log In</button> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-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="https://phpoll.com/register/process" method="post" role="form" style="display: none;"> <div class="form-group"> <input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username" value=""> </div> <div class="form-group"> <input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Enrollment no" value=""> </div> <div class="form-group"> <input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password"> </div> <div class="form-group"> <input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="Sem"> </div> <div class="form-group"> <div class="row"> <div class="col-6"> <input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" 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"); ?></body></html>