| 1 | <?php |
| 2 | include('header.html'); |
| 3 | include('lib/utils.php'); |
| 4 | /** |
| 5 | * Let's use an array as the list of tunables. |
| 6 | * Put in a variable the inclusion of this file: |
| 7 | * $config_var = include('config.php'); |
| 8 | */ |
| 9 | $configs = include('config.php'); |
| 10 | |
| 11 | /** |
| 12 | * [session_start start a unique session for the current browser client] |
| 13 | */ |
| 14 | session_start(); |
| 15 | $is_logged_in = chk_logged_in(); |
| 16 | ?> |
| 17 | <div id="header"> |
| 18 | <!-- Put headers stuff here --> |
| 19 | <a href="<?php echo $configs['root_url'] ?>/index.php?page=home">Bienvenue sur Air Polytech !</a> |
| 20 | </div> |
| 21 | <div id="account"> |
| 22 | <a href="<?php echo $configs['root_url'] ?>/index.php?page=account">Mon espace client</a> |
| 23 | <br> |
| 24 | <?php |
| 25 | $root_url = $configs['root_url']; |
| 26 | if ($is_logged_in) { |
| 27 | echo htmlentities($_SESSION['email']) . " <br>"; |
| 28 | echo "<a href=\"$root_url/index.php?page=logout\">Se déconnecter</a>"; |
| 29 | } else { |
| 30 | echo "<a href=\"$root_url/index.php?page=login\">S'identifier</a>"; |
| 31 | } |
| 32 | ?> |
| 33 | </div> |
| 34 | <div id="menu"> |
| 35 | | <a href="<?php echo $configs['root_url'] ?>/index.php?page=home">Accueil</a> |
| 36 | | <a href="<?php echo $configs['root_url'] ?>/index.php?page=search">Rechercher un vol</a> |
| 37 | | |
| 38 | <?php |
| 39 | if ($is_logged_in) { |
| 40 | echo "<a href=\"" . $configs['root_url'] . "/index.php?page=reservations\">Mes réservations</a> |\n"; |
| 41 | } |
| 42 | ?> |
| 43 | </div> |
| 44 | |
| 45 | <?php |
| 46 | |
| 47 | |
| 48 | |
| 49 | ?> |