<?php
include('header.html');
+include('lib/utils.php');
/**
* Let's use an array as the list of tunables.
* Put in a variable the inclusion of this file:
* $config_var = include('config.php');
*/
$configs = include('config.php');
+
+/**
+ * session_start start a unique session for the current browser client
+ */
+session_start();
+$is_logged_in = chk_logged_in();
?>
<div id="header">
<!-- Put headers stuff here -->
<a href="<?php echo $configs['root_url'] ?>/index.php?page=home">Bienvenue sur Air Polytech !</a>
</div>
+<div id="account">
+ <a href="<?php echo $configs['root_url'] ?>/index.php?page=account">Mon espace client</a>
+ <br>
+ <?php
+ $root_url = $configs['root_url'];
+ if ($is_logged_in) {
+ echo htmlentities($_SESSION['email']) . " <br>";
+ echo "<a href=\"$root_url/index.php?page=logout\">Se déconnecter</a>";
+ } else {
+ echo "<a href=\"$root_url/index.php?page=login\">S'identifier</a>";
+ }
+ ?>
+</div>
+<div id="menu">
+ | <a href="<?php echo $configs['root_url'] ?>/index.php?page=home">Accueil</a>
+ | <a href="<?php echo $configs['root_url'] ?>/index.php?page=search">Rechercher un vol</a>
+ |
+ <?php
+ if ($is_logged_in) {
+ echo "<a href=\"" . $configs['root_url'] . "/index.php?page=reservations\">Mes réservations</a> |\n";
+ }
+ ?>
+</div>
+
<?php
-function display_menu() {
- switch ($page) {
- case "home":
- break;
- case "register":
- break;
- }
-}
+
?>