<?php
ob_start();

// session_start();

// Redirect if already logged in
if (isset($_SESSION['user'])) {
    header('location: dashboard.php');
    exit;
}
 // You should add your authentication logic here, which might involve using your User class.

?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

	<title>Login Page </title>
   <!--Made with love by Mutiullah Samim -->
   <link rel="icon" href="assets/images/fav1.png">
	<!--Bootsrap 4 CDN-->
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    
    <!--Fontawesome CDN-->
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

	<!--Custom styles-->
	<link rel="stylesheet" type="text/css" href="assets/css/loginstyle.css">  
</head>
<body>
<div class="container_main">    
	<div class="whole-login">
		<div class="logo text-center py-3">
			<img class="img-fluid" src="assets/image/logo1.png" alt="">
          
		</div>
	
		<div class="d-flex justify-content-center">
			
			<div class="card">
				
				<div class="card-body">
					<h2 class="text-center text-white font-weight-bold">Admin Login</h2>
					
                    <?php
                            if (isset($_SESSION['message'])) {
                                echo '<p>' . $_SESSION['message'] . '</p>';
                                unset($_SESSION['message']);
                            }
                            ?>
                    <form action="login.php" method="post" >
						<div class="input-group form-group">
							<div class="input-group-prepend">
								<span class="input-group-text"><i class="fas fa-user"></i></span>
							</div>
							<input type="text" class="form-control" placeholder="User Name" name="email" required>
							
						</div>
						<div class="input-group form-group">
							<div class="input-group-prepend">
								<span class="input-group-text"><i class="fas fa-key"></i></span>
							</div>
							<input type="password" class="form-control" placeholder="Password" name="password" required>
						</div>
					
						<div class="form-group text-center">
							<input type="submit" value="login" name="login" class="btn  login_btn">
						</div>
					</form>
				</div>
			
			</div>
		</div>
	</div>
</div>
</div><section id="footer"><?php
	include_once("include/footer.php");
	?>
</section>
	<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</body>
</html>
</html>
<?php
ob_end_flush();
?>


