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
|
<td height="26" bgcolor="#F8BA05" class="normal"><div align="center">
<form method="post">
<span>Sélectionnez une date</span>
<select name="choix">
<?php include("connexion/connexion.php");?>
<?php
$SQL = "SELECT * FROM defile GROUP BY num ORDER BY num ASC";
$res = mysql_query($SQL);
{
while($val=mysql_fetch_array($res)) {
echo "<option>".$val['ladate']."</option>\n"; //defini les valeurs de la liste déroulante
}
if ($choix == $val['ladate']) { //si une date est selectionnee, l'enregistrement apparait
echo '<option value="' . $val['ladate'] . '">' . $val['ladate'] . '</option>';
} else {
echo '<option value="' . $val['ladate'] . '">' . $val['ladate'] . '</option>';
}
}?>
</select>
<input name="submit" type="submit" value="OK" />
</form>
</div></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" bgcolor="#000000">
<tr>
<td height="33" align="center" valign="middle" class="Grand">
<?php
// sélectionne toutes les fiches de la table
if ($choix) {
$query = mysql_query("SELECT * FROM defile WHERE ladate ='$choix';") or die (mysql_error());
$data = mysql_fetch_array($query);
echo '<td align="center" class="Grand"><b>' . $data['ladate'] . '</b></td>' ;
}
else
{
$query = mysql_query("SELECT * FROM defile WHERE ladate =(SELECT MIN(ladate) FROM defile) ;") or die (mysql_error());
$data = mysql_fetch_array($query);
echo '<td align="center" class="Grand"><b>' . $data['ladate'] . '</b></td>' ;
}
?></td>
</tr>
<tr>
<td><div class="normalcentre" align="center">
<?php
// affiche les noms
if ($choix) {
$query = mysql_query("SELECT * FROM defile WHERE ladate ='$choix';") or die (mysql_error());
while($row = mysql_fetch_assoc($query))
echo ' <tr>' . "\n" .
' <td class="normalcentre" align="center">' . $row['titre'] . '</td>' . "\n" .
' <td class="normalcentre" align="center">' . $row['nom'] . '</td>' . "\n" .
' </tr>' . "\n";
}
else
{
$query = mysql_query("SELECT * FROM defile WHERE ladate=(SELECT MAX(ladate) FROM defile) ;") or die (mysql_error());
while($row = mysql_fetch_assoc($query))
echo ' <tr>' . "\n" .
' <td class="normalcentre" align="center">' . $row['titre'] . '</td>' . "\n" .
' <td class="normalcentre" align="center">' . $row['nom'] . '</td>' . "\n" .
' </tr>' . "\n";
}
?>
<?php mysql_close(); ?>
</div></td> |
Partager