<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
 
sec_session_start();
 
if (login_check($mysqli) == true) {
    $logged = 'in';
	if (!headers_sent()){
		 
		header('HTTP/1.1 301 Moved Permanently');
		header('Location: ' . "index_secure.php");
		 
		// Optional workaround for an IE bug (thanks Olav)
		header("Connection: close");
	}	
} else {
    $logged = 'out';
}
?>
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<head>
	<meta charset="utf-8" />
	<!-- Set the viewport width to device width for mobile -->
	<meta name="viewport" content="width=device-width" />
  
    <title>C92 Authentication Control</title>
	<link rel="stylesheet" href="css/template.css">
	
	<!-- Included CSS Files -->
	<link rel="stylesheet" href="css/foundation.css">
	<link rel="stylesheet" href="css/app.css">

	<!--[if lt IE 9]>
		<link rel="stylesheet" href="stylesheets/ie.css">
	<![endif]-->

	<script src="js/modernizr.foundation.js"></script>

	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->	
</head>
<body>
		<div class="row column align-center medium-6 large-4 container-padded">
			<div class="form-signin-branding">
							<h4 class ="text-center"><!-- Log in with your account --></h4>
							<form id="form-login-page" action="includes/process_login.php" method="POST" name="login_form">
								<div id="form-page-fields">
								<label><!-- Email -->
								<input type="text" name="email" id="username_entry" value=""  class="form-field-text" placeholder="sombody@example.com" autocomplete="off" autofocus>
								</label>
								<label><!-- Password -->
								<input type="password" name="password" id="password_entry" value="" class="form-field-password" placeholder="Password" autocomplete="off">
								</label>
								<input type="hidden" name="f_method" id="method_entry" value="LOGIN" class="form-field-text" placeholder="Method" autocomplete="off">
								<input id="Submit" class="form-field-submit" type="submit" value="Log in" name="Submit" >
								</div>
							</form>

			</div>
		</div>
<!--
	<div class="row" style="background: #FFFFFF">
		<div class="small-12 medium-6 large-6 large-centered medium-centered columns">
							<p>If you are done, please <a href="includes/logout.php">log out</a>.</p>
							<p>You are currently logged <?php echo $logged ?>.</p>	
		
		</div>
	</div>		
-->	

</body>
