<?php
if (session_status() !== PHP_SESSION_ACTIVE) {
    session_start();
}


require_once(__DIR__ . "/../inc/config.inc.php");
require_once(__DIR__ . "/../inc/functions.inc.php");

$user = check_admin_user();
$internUserId = (int)$_SESSION['auth']['id'];
include("templates/header.inc.php");
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";

include("templates/footer.inc.php");
 exit; }
?>
	<meta http-equiv="refresh" content = "0;url=anfragen.php">	
	</header>

<!-- Main -->

    <div class="container main-container">
      
	<?php

		/*
		global $pdo;
	
		$identifier = $_COOKIE['identifier'];
		$securitytoken = $_COOKIE['securitytoken'];
		
		$statement = $pdo->prepare("SELECT * FROM securitytokens WHERE identifier = :identifier");
		$result = $statement->execute(array('identifier' => $identifier));
		$securitytoken_row = $statement->fetch();		
		echo $securitytoken_row['securitytoken'];
		echo "<br>";
		echo sha1($securitytoken);
		*/
		?>
		<h1>Administration</h1>
		
		Hallo <?php echo htmlentities($user['vorname']); ?>,<br>
		Herzlich Willkommen im internen Bereich!<br>

<!--
        <p>Hier finden Sie die weiteren Bearbeitungsschritte:<br><br></p>
		<p><a class="btn btn-primary btn-lg" href="anfragen.php" role="button">Bearbeitung der Anfragen</a>&ensp;&ensp;
		<a class="btn btn-primary btn-lg" role="button" href="anfragen.php">Anfragen</a></p>   
		<br>
		<p><a class="btn btn-primary btn-lg" role="button" href="../zeiterfassung">Zeiterfassung</a></p> 
		<br>
		<p><a class="btn btn-primary btn-lg" href="impfadmin.php" role="button">Impf-Administration</a>	&ensp;&ensp;
		<a class="btn btn-primary btn-lg" role="button" href="impfadmin.php">Impfung</a> &ensp;&ensp;
		<a class="btn btn-primary btn-lg" role="button" href="togoadmin.php">togo-Impfung</a></p> 
		<br>
		<p><a class="btn btn-primary btn-lg" role="button" href="webseitenadmin.php">Webseiteninhalt ändern</a></p>
		<br><br><br>
		<p><a class="btn btn-primary btn-lg" role="button" href="settings.php">Einstellungen</a></p>
		<p><a class="btn btn-primary btn-lg" role="button" href="logout.php">Logout</a></p>
-->



<?php	
	
	echo '<h4>Welche Aktion möchtest du durchführen?</h4>
	<table width=100%><tr><td width=40%>
	
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=1>
	<input type=submit class="btn btn-primary btn-lg" value="Formular-Anfragen bearbeiten">
	</form>
	</td></tr>
	<tr><td><br><br>
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=18>
	<input type=submit class="btn btn-primary" value="Mailvorlagen anlegen">
	</form>	
	</td></tr>
	<tr><td><br><br>
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=12>
	<input type=submit class="btn btn-primary" value="Formular Auswertung">
	</form>
	</td></tr>
	<tr><td><br><br>
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=16>
	<input type=submit class="btn btn-primary" value="Mailvorlagen anpassen">
	</form>	
	</td></tr><br><br><br><br>
	<tr></tr>
	<tr><td><h3>Urlaub / Hinweis planen</h3></td><td></td></tr>
	<tr><td>
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=4>
	<input type=submit class="btn btn-primary btn-lg" value="Urlaub eintragen">
	</form>	
	</td></tr>
	<tr><td><br><br>
	<form action="'. $_SERVER["PHP_SELF"] .'" method=POST>
	<input type=hidden name=aktion value=6>
	<input type=submit class="btn btn-primary" value="Notfallsprechstunde eintragen">
	</form>	
	</tr>
	</table>
	<br><br>
	';
	
	
	
?>
     
    </div>
<?php

include("templates/footer.inc.php")
?>