<?php
session_start();
require('db.php');
include('inc/logo.php');
$errorMessage = '';
if(isset($_POST["login"]) && !empty($_POST["loginId"])&& !empty($_POST["loginPass"])) {	

$isValidLogin = mysqli_num_rows($resultSet);	
if($isValidLogin){

$userDetails = mysqli_fetch_assoc($resultSet);
$_SESSION["user"] = $userDetails['email'];
$_SESSION["loggedin"] = false;
$uid = mt_rand(100,10000);
if(isset($_SESSION["logg"]) && $_SESSION["log"] === true){
header('location: index.php');
    
exit;
}
		
} else {		
		$errorMessage = "Invalid login!";		 
}
} else if(!empty($_POST["loginId"])){
	$errorMessage = "Enter Both user and password!";	
}	

?>
<!doctype html>
<html lang="en">

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- Required meta tags -->
    
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Login</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.min.css">
    <link href="assets/vendor/fonts/circular-std/style.css" rel="stylesheet">
    <link rel="stylesheet" href="assets/libs/css/style.css">
    <link rel="stylesheet" href="assets/vendor/fonts/fontawesome/css/fontawesome-all.css">
    <link href="sitelogo/favicon.png" rel="icon" />
    <style>
    html,
    body {
        height: 100%;
    }

    body {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: center;
        align-items: center;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    </style>
</head>

<body>
    <!-- ============================================================== -->
    <!-- login page  -->
    <!-- ============================================================== -->
    <div class="splash-container">
        <div class="card ">
            <div class="card-header text-center"><a href="index.php"><?php logo2($sitelogo); ?></a><span class="splash-description">Account Locked.</span> <font color=red size='3pt'>
                You Are Not Allowed to Login!<br> Contact Admin</font>

       
                
                
            </div>
            <div class="card-footer bg-white p-0  ">
                <div class="card-footer-item card-footer-item-bordered">
                    <a href="#" class="footer-link">Create Account</a></div><div class="card-footer-item card-footer-item-bordered">
                    <a href="#" class="footer-link">Forgot Password</a> <br>
                </div><a href="index.php" class="btn btn-primary btn-lg btn-block">Try Login in Again</a> <br>

            </div>
        </div>
    </div>

    <!-- ============================================================== -->
    <!-- end login page  -->
    <!-- ============================================================== -->
    <!-- Optional JavaScript -->
    <script src="assets/vendor/jquery/jquery-3.3.1.min.js"></script>
    <script src="assets/vendor/bootstrap/js/bootstrap.bundle.js"></script>
</body>
 
</html>