Commit 368cb3c0ff22a5aef5f6261701758a5a1e4f8aad

Authored by Jean Wasilewski
1 parent 1143761c

Added school list

Showing 3 changed files with 56 additions and 1 deletions   Show diff stats
.gitignore 0 → 100644
... ... @@ -0,0 +1 @@
  1 +*.swp
... ...
menu.php
... ... @@ -24,7 +24,10 @@
24 24 <li>
25 25 <a href="#profil" onClick="loadNewDoc('???????.php);">Profil</a>
26 26 </li>
27   - <?php
  27 + <li>
  28 + <a href="#school" onClick="loadNewDoc('school.php');">Ecoles</a>
  29 + </li>
  30 +<?php
28 31 }
29 32 ?>
30 33 </ul>
... ...
school.php 0 → 100644
... ... @@ -0,0 +1,51 @@
  1 +<h2>Liste écoles participantes</h2>
  2 +
  3 +<center>
  4 + <table class="table table-striped table-responsive table-bordered">
  5 + <div class="panel_heading">
  6 + <thead>
  7 + <tr>
  8 + <th>Nom de l'école</th>
  9 + <th>Circonscription</th>
  10 + <th>Contact</th>
  11 + <th>Enseignant</th>
  12 + </tr>
  13 + </thead>
  14 + </div >
  15 + <tbody>
  16 +<?php
  17 +$link = mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__)
  18 + or die("Impossible de se connecter : " . mysql_error());
  19 +
  20 +if(!mysql_select_db('crep', $link))
  21 +{
  22 + echo 'Selection de la base de donnees impossible';
  23 + exit;
  24 +}
  25 +
  26 +$requete = "SELECT DISTINCT `nom`, `circonscription`, `adresse`, `enseignant` FROM `school` ORDER BY nom ASC";
  27 +$resultat = mysql_query($requete);
  28 +
  29 +while ($row = mysql_fetch_assoc($resultat))
  30 +{
  31 + echo '<tr>';
  32 + echo '<td>';
  33 + echo '<p>'.$row['nom'].'</p>';
  34 + echo '</td>';
  35 + echo '<td>';
  36 + echo '<p>'.$row['circonscription'].'</p>';
  37 + echo '</td>';
  38 + echo '<td>';
  39 + echo '<p>'.$row['addresse'].'</p>';
  40 + echo '</td>';
  41 + echo '<td>';
  42 + echo '<p>'.$row['enseignant'].'</p>';
  43 + echo '</td>';
  44 + echo '</tr>';
  45 +}
  46 +
  47 +mysql_close($link);
  48 +?>
  49 + </tbody>
  50 + </table>
  51 +</center>
... ...