Add the following features:
[Project_webapp.git] / includes / header.php
index ac394bfae0d8429433b195a446774f661996514c..1aa4c02772c619492a6f2fc07f678bedc99ef26d 100644 (file)
@@ -1,25 +1,44 @@
 <?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 de&#769;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>
+</div>
+
+
 <?php
 
-function display_menu() {
-    switch ($page) {
-        case "home":
-        break;
-        case "register":
-        break;
-    }
 
-}
+
 ?>