Blame view

school.php 1.24 KB
56320b01   Jean Wasilewski   Added creds
1
2
3
  <?php
  require_once("creds.php");
  ?>
368cb3c0   Jean Wasilewski   Added school list
4
5
6
7
8
9
10
11
12
13
14
  <h2>Liste écoles participantes</h2>
  
  <center>
  	<table class="table table-striped table-responsive table-bordered">
  		<div class="panel_heading">
  			<thead>
  				<tr> 
  					<th>Nom de l'école</th>
  					<th>Circonscription</th>
  					<th>Contact</th>
  					<th>Enseignant</th>
69eafcb3   Jean Wasilewski   Fixed table
15
  					<th>Contact</th>
368cb3c0   Jean Wasilewski   Added school list
16
17
18
19
20
21
22
23
24
25
26
27
28
  				</tr>
  			</thead>
  		</div >
  		<tbody>
  <?php
  $link = mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__)
  	or die("Impossible de se connecter : " . mysql_error());
  
  if(!mysql_select_db('crep', $link))
  {
  	echo 'Selection de la base de donnees impossible';
  	exit;
  }
462b346c   Jean Wasilewski   UTF8 really fixed
29
  mysql_query("SET NAMES 'utf8'");
10963869   Jean Wasilewski   Added contact and...
30
  $requete = "SELECT DISTINCT `nom`, `circonscription`, `adresse`, `enseignant`, `contact` FROM `school` ORDER BY nom ASC";
368cb3c0   Jean Wasilewski   Added school list
31
32
33
34
35
36
37
38
39
40
41
42
  $resultat = mysql_query($requete);
  
  while ($row = mysql_fetch_assoc($resultat))
  {
  	echo '<tr>';
  	echo '<td>';
  	echo '<p>'.$row['nom'].'</p>';
  	echo '</td>';
  	echo '<td>';
  	echo '<p>'.$row['circonscription'].'</p>';
  	echo '</td>';
  	echo '<td>';
10963869   Jean Wasilewski   Added contact and...
43
  	echo '<p>'.$row['adresse'].'</p>';
368cb3c0   Jean Wasilewski   Added school list
44
45
46
47
  	echo '</td>';
  	echo '<td>';
  	echo '<p>'.$row['enseignant'].'</p>';
  	echo '</td>';
10963869   Jean Wasilewski   Added contact and...
48
49
50
51
  	echo '<td>';
  	echo '<p>'.$row['contact'].'</p>';
  	echo '</td>';
  echo '</tr>';
368cb3c0   Jean Wasilewski   Added school list
52
53
54
55
56
57
58
  }
  
  mysql_close($link);
  ?>
  		</tbody>
  	</table>
  </center>