<?php
	require_once("php/accountmanagment.php");
	require_once("php/accountfunc.php");
?>
<!DOCTYPE html>
<html>
<head>
	<title>'t stoffig reserveringspakhuis</title>

	<link href="style/normal.css" rel="stylesheet" type="text/css" />

	<script src="javascript/jquery-1.11.3.min.js" type="text/javascript"></script>
	<script src="javascript/script.js" type="text/javascript"></script>
</head>
<body>
	<div id="container">
		<div id="header">
			<div id="headerimg"></div>
			<h1>Welkom op 't stoffig pakhuis</h1>
		</div>
		<div id="navigation">
			<ul>
				<li><a href="index.php">Home</a></li>
				<li><a href="shopping.php">Alle stoffen</a></li>
				<li><a href="search.php">Zoeken</a></li>
				<li><a href="receptie.php">Account</a></li>
				<li><a href="contact.php">Contact</a></li>
				<?php if(isAdmin()) { ?>
				<li><a href="beheer.php">Beheer</a></li>
				<?php } ?>
			</ul>
		</div>
		<div id="content">
			<?php if(isset($errors) && !empty($errors)) { ?>
				<ul id="errors">
					<?php for($i = 0; $i < count($errors); $i++) { ?>
						<li><?php echo $errors[$i]; ?></li>
					<?php } ?>
				</ul>
				<?php }

				if(isset($_GET['message']))
				{
					?>
						<div id="message"><?php echo $message; ?></div>
					<?php
				}
				
				if(!isset($_SESSION['email'])) {
				?>
					<div id="left">
						
						<form id="loginform" method="post" action="receptie.php?login">
							<h1>Inloggen</h1>
							<div>
								<label for="email">E-mail</label>
								<input type="email" name="email" id="email" />
							</div>
							<div>
								<label for="wachtwoord">Wachtwoord</label>
								<input type="password" name="password" id="password" />
							</div>
							<div>
								<input type="hidden" name="isreceptie" value="1" id="isreceptie" />
								<input type="submit" name="submit" value="Inloggen" id="Login" />
							</div>
						</form>
					
					</div>
					<div id="middle"></div>
					<div id="right">
						
						<form id="registerform" method="post" action="receptie.php?register">
							<h1>Account aanmaken</h1>
							<div>
								<label for="email">E-mail</label>
								<input type="email" name="email" id="email" />
							</div>
							<div>
								<label for="wachtwoord">Wachtwoord</label>
								<input type="password" name="password" id="password" />
							</div>
							<div>
								<input type="hidden" name="isreceptie" value="1" id="isreceptie" />
								<input type="submit" name="submit" value="Aanmaken" id="Login" />
							</div>
						</form>

					</div>
				<?php
				}else{
					echo profile();
				}
			?>
		</div>
		<div id="footer">

		</div>
	</div>
</body>
</html>