<?php
ob_start();
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
require_once("public/auth.php");
require_once("public/forget_pw.php");
require_once("public/functions.php");
require_once("public/school_config.php");
?>


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Stylesheets -->
<link rel="stylesheet" href="assets/login_css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="assets/login_css/login.css">
<link rel="stylesheet" type="text/css" href="assets/login_css/edumac-brand.css">
<link rel="icon" href="<?php echo $school_favicon; ?>" type="image/png">
<link href="assets/SweetAlerts/sweetalert.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="assets/loader/waitMe.css">
<title><?php echo htmlspecialchars($school_name); ?> - Login</title>
</head>
<body>

<section class="login-content">
    <div class="login-box">

        <!-- Login Form -->
		<form class="login-form app_frm" action="" method="POST" autocomplete="off">
			<center>
				<?php if (!empty($school_logo)) : ?>
				    <img height="140" src="<?php echo $school_logo; ?>">
				<?php endif; ?>
			</center>
			<h4 class="login-head"><?php echo htmlspecialchars($school_name); ?></h4>
			<!--p class="text-center">STUDENTS RESULTS MANAGEMENT SYSTEM</p-->
			
			<div class="mb-3">
				<label class="form-label">USERNAME/REG NO</label>
				<input class="form-control" type="text" placeholder="Username or Registrattion Number" required name="login_id">
			</div>
			
			<div class="mb-3">
				<label class="form-label">PASSWORD</label>
				<input class="form-control" type="password" placeholder="Password" required name="login_password">
			</div>
			
			<div class="mb-3 d-flex justify-content-between">
                <p class="semibold-text mb-2">
                    <a href="cbt/" target="_blank">CBT PORTAL</a>
                </p>
                <p class="semibold-text mb-2">
                    <a href="javascript:void(0);" data-toggle="flip">Forgot Password?</a>
                </p>
            </div>

			
			<div class="mb-3 btn-container d-grid">
				<button type="submit" name="login_btn"class="btn btn-primary btn-block app_btn">
				    <i class="bi bi-box-arrow-in-right me-2 fs-5"></i>SIGN IN
				</button>
			</div>
		</form>


        <!-- Forgot Password Form -->
		<form class="forget-form app_frm" action="" method="POST" autocomplete="off">
			<center>
				<?php if (!empty($school_logo)) : ?>
				    <img height="140" src="<?php echo $school_logo; ?>">
				<?php endif; ?>
			</center>
			<h4 class="login-head"><?php echo htmlspecialchars($school_name); ?></h4>
			<!--p class="text-center">STUDENTS RESULTS MANAGEMENT SYSTEM</p-->
			
			<div class="mb-3">
				<label class="form-label">USERNAME</label>
				<input class="form-control" type="text" placeholder="Email or Registration Number" required name="username">
			</div>
			
			<div class="mb-3 btn-container d-grid">
				<button type="submit" class="btn btn-primary btn-block app_btn">
				    <i class="bi bi-unlock me-2 fs-5"></i>RESET PASSWORD
				</button>
			</div>
			
			<div class="mb-3 mt-3">
				<p class="semibold-text mb-0">
				    <a href="javascript:void(0);" data-toggle="flip">
				        <i class="bi bi-chevron-left me-1"></i> Back to Login
				    </a>
				</p>
			</div>
		</form>		 
    </div>
</div>
   <div class="text-center">
        <p>
            Developed by 
            <a href="https://wa.me/2348099312050">MacAnalyticNG Technologies </a><br>08099312050
        </p>
    </div>
</section>

<!-- Scripts -->
<script src="assets/login_js/jquery-3.7.0.min.js"></script>
<script src="assets/login_js/bootstrap.min.js"></script>
<script src="assets/login_js/login.js"></script>
<script src="assets/loader/waitMe.js"></script>
<script src="assets/login_js/forms.js"></script>
<script src="assets/SweetAlerts/sweetalert.js"></script>
<script type="text/javascript">
    $('.login-content [data-toggle="flip"]').click(function() {
        $('.login-box').toggleClass('flipped');
        return false;
    });
</script>
<!-- SweetAlert2 JS -->
<?php
require_once("public/alert.php");
?>
</body>
</html>

