1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="SHORTCUT ICON" href="http://www.gghf.be/images/favico.gif">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
function toggle_div(bouton, id) { // On déclare la fonction toggle_div qui prend en param le bouton et un id
var div = document.getElementById(id); // On récupère le div ciblé grâce à l'id
if(div.style.display=="none") { // Si le div est masqué...
div.style.display = "block"; // ... on l'affiche...
bouton.innerHTML = "-"; // ... et on change le contenu du bouton.
} else { // S'il est visible...
div.style.display = "none"; // ... on le masque...
bouton.innerHTML = "+"; // ... et on change le contenu du bouton.
}
}
</script>
</head>
<body>
<form method="post" action="eid.php">
<input type="submit" value="Retour" style="background-color: #0CF" />
</form>
<p></p>
<font face="arial">Résultat de la recherche:<font>
<p></p>
<table style="width:50%" border="2" cellspacing="0" cellpadding="0">
<tr>
<td width="80px">
</td>
<td width="80px">
Nom
</td>
<td width="80px">
Prénom
</td>
<td width="200px">
Localité
</td>
<td width="80px">
Nbr rando
</td>
</tr>
<?php
// on se connecte Ã* MySQL
$db = mysql_connect('localhost', 'blabla', 'blabla');
// on sélectionne la base
mysql_select_db('test',$db);
// on crée la requête SQL
$sql = "select rando, id, nom, prenom, postal, sid, count(id) from (select rando, id, nom, prenom, postal, sid from gghf_rando union select rando, id, nom, prenom, postal, sid from gghf_rando2) t group by id ";
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
while($data = mysql_fetch_assoc($req))
{ ?>
<tr>
<td width="30px">
<button type="button" onclick="toggle_div(this,'detail');">+</button>
<div id="detail" style="display:none;">
<?php echo $data['rando']; ?>
</div>
</td>
<td width="80px">
<?php echo $data['nom']; ?>
</td>
<td width="80px">
<?php echo $data['prenom']; ?>
</td>
<td width="200px">
<?php echo $data['postal']; ?>
</td>
<td width="80px">
<?php echo $data['count(id)']; ?>
</td>
</tr>
<?php }
// on ferme la connexion Ã* mysql
mysql_close();
?>
</table>
<p></p>
<form method="post" action="eid.php">
<input type="submit" value="Retour" style="background-color: #0CF" />
</form>
<p></p>
</body>
</html> |
Partager