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
| <?php
if (isset($_GET['annee'])){
$an=$_GET['annee'];
echo "<center> ANNEE ".$an."</center><br><br>";
$req = mysql_query("SELECT DISTINCT id_jo, num_jo, date_jo, type_jo FROM jo where DATE_FORMAT(date_jo,'%Y')='$an' ORDER BY date_jo ASC;");
$res = mysql_num_rows($req);
$i=0; $mois = ""; $j=0; $lien = "";
$nb_col = 4;
$k=0;
echo '<table width="75%" border="1">';
WHILE ($i < $res){
$id = mysql_result($req,$i,"id_jo");
$num = mysql_result($req,$i,"num_jo");
$type = mysql_result($req,$i,"type_jo");
$dat = mysql_result($req,$i,"date_jo");
list($year, $month, $day) = explode("-", $dat);
$months = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin",
"Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
$aux = $months[$month-1];
if ($k == $nb_col) {
echo "</tr>";
$k=0;
}
if ($k==0) {
echo "<tr>";
}
if ($aux != $mois) { if ($mois != '')
echo "<td valign='top' align='center' width=15% height=1 ><font color='blue'>".$mois."<br><br>".$lien."</font></td>";
$mois = $aux; $lien = ""; $k++;
}
$lien .= "\r\n <a href=rechercheannee3essai.php?n=$id>$type n° $num</a> <br> \r\n";
$i++;}
echo "<td valign='top' align='center' width=50% height=1><font color='blue'>".$mois. "<br><br>".$lien."</td></font>";
echo '</table>'; }
mysql_close();
?> |
Partager