Cosmetic iand spell fixes.
[Project_webapp.git] / includes / home.php
index cc378a2836c3dfdd0c389e4e20ea29e7407c54ef..db4fe90778d07b0c0b4c6af1b15971617a22ecd2 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=register\">Cre&#769;er un compte</a></td>\n";
+    echo "    <td><a href=\"$root_url/index.php?page=login\">S'identifier</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>