File: /home/nyiet8349bzl/public_html/oldwebsite.sbsc.in/faculty/auth/login.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include "../config/database.php";
if (isset($_POST['login'])) {
$email = trim($_POST['email']);
$password = trim($_POST['password']);
$stmt = $conn->prepare("SELECT id, password FROM teachers WHERE email = ?");
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->bind_result($teacher_id, $hash);
$stmt->fetch();
if ($teacher_id && password_verify($password, $hash)) {
$_SESSION['teacher_logged_in'] = true;
$_SESSION['teacher_id'] = $teacher_id;
header("Location: ../dashboard/index.php");
exit;
} else {
$error = "Invalid login credentials";
}
$stmt->close();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Faculty Login</title>
<!-- OPEN SANS -->
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
<style>
*{
box-sizing:border-box;
font-family:'Open Sans', sans-serif;
}
body{
margin:0;
height:100vh;
display:flex;
align-items:center;
justify-content:center;
background:#16a34a;
}
.login-container{
width:900px;
height:420px;
background:#fff;
border-radius:18px;
display:flex;
overflow:hidden;
}
/* LEFT */
.login-left{
width:50%;
padding:50px;
}
.login-left h2{
margin:0 0 20px;
font-weight:700;
}
.login-left input{
width:100%;
padding:12px 14px;
margin-bottom:15px;
border:1px solid #ddd;
border-radius:6px;
font-size:14px;
}
.login-left button{
width:100%;
padding:12px;
border:none;
background:#16a34a;
color:#fff;
border-radius:6px;
font-size:15px;
cursor:pointer;
}
.login-left .error{
color:#dc2626;
margin-bottom:12px;
font-size:13px;
}
/* RIGHT */
.login-right{
width:50%;
background:#f0fdf4;
display:flex;
align-items:center;
justify-content:center;
padding:30px;
}
.login-right img{
width:90%;
max-width:340px;
}
.login-right h3{
margin-top:20px;
font-weight:600;
color:#065f46;
}
</style>
</head>
<body>
<div class="login-container">
<!-- LEFT LOGIN FORM -->
<div class="login-left">
<h2>Faculty Login</h2>
<?php if(isset($error)){ ?>
<div class="error"><?php echo $error; ?></div>
<?php } ?>
<form method="post">
<input type="email" name="email" placeholder="Email Address" required>
<input type="password" name="password" placeholder="Password" required>
<button name="login">Login</button>
</form>
</div>
<!-- RIGHT INFO -->
<div class="login-right">
<div style="text-align:center">
<img src="https://i.imgur.com/8Km9tLL.png">
<h3>Manage Your Faculty Profile</h3>
</div>
</div>
</div>
</body>
</html>