Add the following features:
[Project_webapp.git] / includes / home.php
index cc378a2836c3dfdd0c389e4e20ea29e7407c54ef..fa15da86e49477d566811aa6d7440a67fe4afa36 100644 (file)
@@ -1,24 +1,16 @@
+<table id="home">
 <?php
+global $is_logged_in;
 
-function home()
-{
-    global $connection;
-
-    $requete = "SELECT NumCl, NomCl, CodePosteCl, VilleCl FROM CLIENTS";
-    $result = $connection->query($requete);
-    echo "<table border=1>\n";
-    echo "<tr><td>Code_CL</td><td>Nom</td><td>Rue</td><td>Ville</td></tr>\n";
-    while ($ligne = $result->fetch_row()) {
-        $code = htmlentities($ligne[0]);
-        $nom = htmlentities($ligne[1]);
-        $rue = htmlentities($ligne[2]);
-        $ville = htmlentities($ligne[3]);
-        echo "<tr><td>$code</td><td>$nom</td><td>$rue</td><td>$ville</td></tr>\n";
-    }
-    echo "</table>\n";
-    $result->close();
+if (!$is_logged_in) {
+    $root_url = $configs['root_url'];
+    echo "<tr>\n";
+    echo "   <td><a href=\"$root_url/index.php?page=login\">S'identifier</a></td>\n";
+    echo "   <td><a href=\"$root_url/index.php?page=register\">Cre&#769;er un compte</a></td>\n";
+    echo "</tr>\n";
 }
-
-home();
-
 ?>
+  <tr>
+    <td<?php if (!$is_logged_in) { echo " colspan=\"2\""; } ?>><a href="<?php echo $configs['root_url'] ?>/index.php?page=search">Rechercher un vol</a></td>
+  </tr>
+</table>