Code : Tout sélectionner
<div id="contenu">
<?php
################################################
#Variables définissant l'année a partir de laquelle les rapports noaaAAAA.txt sont disponibles
################################################
$anneedebut = '2006';
################################################
$yearstr=$_GET['annee'];
$today = getdate();
if ($yearstr=='') {
$yearstr = str_pad($today[year], 4, "0", STR_PAD_LEFT);
}
$nextyear = $yearstr+1;
$disablenext = '';
$disableprev = '';
if ($nextyear==$today['year']+1) {
$nextyear = $today['year'];
$disablenext="disabled='disabled'";
}
$prevyear = $yearstr-1;
if ($prevyear==$anneedebut-1) {
$prevyear = $anneedebut;
$disableprev="disabled='disabled'";
}
$fichier="noaa".$yearstr.".txt";
$title="Relevés de l'année en cours";
$fp = fopen ("$fichier",'r');
$content = fread ($fp,filesize("$fichier"));
$separ_1 = explode("----------
",$content);
$separ_2 = explode("
----------",$separ_1[1]);
$table1 =$separ_2[0];
$total1 = $separ_1[2];
$separ_3 = explode("
----------",$separ_1[3]);
$table2 = $separ_3[0];
$total2 = $separ_1[4];
$separ_4 = explode("
----------",$separ_1[5]);
$table3 = $separ_4[0];
$total3 = $separ_1[6];
$separ_5 = explode("
----------",$separ_1[7]);
$table4 = $separ_5[0];
$total4 = $separ_1[8];
$linetitle= explode("
",$separ_1[0]);
$char = array (" ","W");
$newchar = array ("","O");
########################################
#Récupération des moyennes annuelles de temperature ##
########################################
$title1=trim($linetitle[0]);
$title2=trim($linetitle[2]);
$item_m = explode(",",$total1);
$meantemp_m = $item_m[1];
$lowtempmean_m = $item_m[2];
$lowtemp_m = $item_m[3];
$hourlowtemp_m = $item_m[4];
$monthlowtemp_m = $item_m[5];
$highttempmean_m = $item_m[6];
$highttemp_m = $item_m[7];
$hourhighttemp_m = $item_m[8];
$monthhighttemp_m = $item_m[9];
$icedays_m = $item_m[10];
$colddays_m = $item_m[11];
$cooldays_m = $item_m[12];
$summerdays_m = $item_m[13];
$heatdays_m = $item_m[14];
########################################
#Récupération des données journalieres##
########################################
$nb = substr_count ($table1, "
");
$ligne ="";
$color = array('#ffffff','#ffff00','#ff00ff','#ffffff');
$gel=0;
$fortgel=0;
$sansdegel=0;
$chaleur=0;
$canicule=0;
$pluie=0;
$pluie_1=0;
$pluie_5=0;
$pluie_10=0;
$maxrain=0;
$replow=array(' ',' ');
$rephight=array(' ',' ');
$repmean=array(' ',' ');
$line = explode("
",$table1);
for ($i=0; $i<$nb+1; $i++)
{
#selection ligne
$item = explode(",",$line[$i]);
#séparation et classement des valeurs
$mois = $item[0];
$meantemp = $item[1];
$lowtempmean = $item[2];
$lowtemp = $item[3];
$hourlowtemp = $item[4];
$daylowtemp = $item[5];
$highttempmean = $item[6];
$highttemp = $item[7];
$hourhighttemp = $item[8];
$dayhighttemp = $item[9];
$icedays = $item[10];
$colddays = $item[11];
$cooldays = $item[12];
$summerdays = $item[13];
$heatdays = $item[14];
$tempe = array($meantemp,$lowtempmean,$lowtemp,$highttempmean,$highttemp);
$color = array('#ff0000','#ffff00','#ff00ff','#ff00ff','#ffff00');
$white = array (0,0,0,0,0);
for ($c=0; $c<count($tempe); $c++)
{
#colorisation température
if($tempe[$c] <= '-25') {$color[$c]='#cc99ff';}
elseif($tempe[$c] > '-25' && $tempe[$c] <= '-20') {$color[$c]='#ccccff'; $white[$c]=0;}
elseif($tempe[$c] > '-20' && $tempe[$c] <= '-15') {$color[$c]='#ccffff'; $white[$c]=0;}
elseif($tempe[$c] > '-15' && $tempe[$c] <= '-10') {$color[$c]='#00ccff'; $white[$c]=0;}
elseif($tempe[$c] > '-10' && $tempe[$c] <= '-5') {$color[$c]='#33ccff'; $white[$c]=0;}
elseif($tempe[$c] > '-5' && $tempe[$c] <= '0') {$color[$c]='#66ccff'; $white[$c]=0; }
elseif($tempe[$c] > '0' && $tempe[$c] <= '5') {$color[$c]='#99ccff'; $white[$c]=0; }
elseif($tempe[$c] > '5' && $tempe[$c] <= '10') {$color[$c]='#ccccff'; $white[$c]=0;}
elseif($tempe[$c] > '10' && $tempe[$c] <= '15') {$color[$c]='#ffcccc'; $white[$c]=0; }
elseif($tempe[$c] > '15' && $tempe[$c] <= '20') {$color[$c]='#ff9999'; $white[$c]=0; }
elseif($tempe[$c] > '20' && $tempe[$c] <= '25') {$color[$c]='#ff6699'; $white[$c]=0; }
elseif($tempe[$c] > '25' && $tempe[$c] <= '30') {$color[$c]='#ff6666'; $white[$c]=0; }
elseif($tempe[$c] > '30' && $tempe[$c] <= '35') {$color[$c]='#ff3366'; $white[$c]=0; }
elseif($tempe[$c] > '35' && $tempe[$c] <= '40') {$color[$c]='#ff3333'; $white[$c]=0;}
elseif($tempe[$c] > '40') {$color[$c]='#ff3300'; $white[$c]=0;}
else {$color[$c]='#ff0000';}
}
#repére des extremes
$replow=array('','');
$rephight=array('','');
$repmean=array('','');
$colortext=array('','','','','','');
for ($c=0; $c<5; $c++)
{
if ($white[$c]==1) {$colortext[$c]='color="white"';}
else {$colortext[$c]='';}
}
if ($lowtemp == $lowtemp_m) {$replow = array("<b>","</b></font>");}
if ($highttemp == $highttemp_m) {$rephight = array("<b>","</b></font>");}
switch($mois)
{
case "janvier":
$monthnum="01";
break;
case "février":
$monthnum="02";
break;
case "mars":
$monthnum="03";
break;
case "avril":
$monthnum="04";
break;
case "mai":
$monthnum="05";
break;
case "juin":
$monthnum="06";
break;
case "juillet":
$monthnum="07";
break;
case "août":
$monthnum="08";
break;
case "septembre":
$monthnum="09";
break;
case "octobre":
$monthnum="10";
break;
case "novembre":
$monthnum="11";
break;
case "décembre":
$monthnum="12";
break;
}
#incrémentation du tableau
if ($meantemp != ""){
#erreur premier mois 2005
#if ($monthnum =""){ };
}
$ligne .= "<tr >
<td bgcolor='#d4d4d4' align='center'><a href='../mois/noaam.php?annee=$yearstr&mois=$monthnum' target='_self'>$mois</a></td>
<td bgcolor='$color[0]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[0]> $meantemp °C </td>
<td bgcolor='$color[1]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[1]> $lowtempmean °C </td>
<td bgcolor='$color[2]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[2]>$replow[0] $lowtemp °C $replow[1]</td>
<td width='65' align='center'><font> $daylowtemp </td>
<td width='65' align='center'><font> $hourlowtemp</td>
<td bgcolor='$color[3]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();' ><font $colortext[3]> $highttempmean °C </td>
<td bgcolor='$color[4]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[4]>$rephight[0] $highttemp °C $rephight[1]</td>
<td width='65' align='center'><font> $dayhighttemp </td>
<td width='65' align='center'><font> $hourhighttemp</td>
<td width='65' align='center'><font> $icedays</td>
<td width='65' align='center'><font> $colddays</td>
<td width='65' align='center'><font> $heatdays</td>
</tr>
";}
$ligne2="";
########################################
#Récupération des normales temp ##
########################################
$item_m = explode(",",$total2);
$temp_m = $item_m[1];
$normtemp_m = $item_m[2];
$tempdev_m = $item_m[3];
$sun_m = $item_m[8];
$nb = substr_count ($table2, "
");
$line2 = explode("
",$table2);
for ($i=0; $i<$nb+1; $i++)
{
#selection ligne
$item = explode(",",$line2[$i]);
#séparation et classement des valeurs
$mois = $item[0];
$temp = $item[1];
$normtemp = $item[2];
$tempdev = $item[3];
$sun = $item[8];
$sun_cent = $item[9];
$sun_norm = $item[10];
$sunpour = $item[10];
$sunpou =0;
$sunpourc = $sunpour - $sunpou;
$sunpource = $item[9] / $sunpourc;
$sunpourcen = $sunpource * 100;
$sunpourcent = round ($sunpourcen);
$tempe = array($temp,$normtemp);
$color = array('#ff0000','#ffff00','#ff00ff','#ff00ff','#ffff00');
$white = array (0,0,0,0,0);
for ($c=0; $c<count($tempe); $c++)
{
#colorisation température
if($tempe[$c] <= '-25') {$color[$c]='#cc99ff';}
elseif($tempe[$c] > '-25' && $tempe[$c] <= '-20') {$color[$c]='#ccccff'; $white[$c]=0;}
elseif($tempe[$c] > '-20' && $tempe[$c] <= '-15') {$color[$c]='#ccffff'; $white[$c]=0;}
elseif($tempe[$c] > '-15' && $tempe[$c] <= '-10') {$color[$c]='#00ccff'; $white[$c]=0;}
elseif($tempe[$c] > '-10' && $tempe[$c] <= '-5') {$color[$c]='#33ccff'; $white[$c]=0;}
elseif($tempe[$c] > '-5' && $tempe[$c] <= '0') {$color[$c]='#66ccff'; $white[$c]=0; }
elseif($tempe[$c] > '0' && $tempe[$c] <= '5') {$color[$c]='#99ccff'; $white[$c]=0; }
elseif($tempe[$c] > '5' && $tempe[$c] <= '10') {$color[$c]='#ccccff'; $white[$c]=0;}
elseif($tempe[$c] > '10' && $tempe[$c] <= '15') {$color[$c]='#ffcccc'; $white[$c]=0; }
elseif($tempe[$c] > '15' && $tempe[$c] <= '20') {$color[$c]='#ff9999'; $white[$c]=0; }
elseif($tempe[$c] > '20' && $tempe[$c] <= '25') {$color[$c]='#ff6699'; $white[$c]=0; }
elseif($tempe[$c] > '25' && $tempe[$c] <= '30') {$color[$c]='#ff6666'; $white[$c]=0; }
elseif($tempe[$c] > '30' && $tempe[$c] <= '35') {$color[$c]='#ff3366'; $white[$c]=0; }
elseif($tempe[$c] > '35' && $tempe[$c] <= '40') {$color[$c]='#ff3333'; $white[$c]=0;}
elseif($tempe[$c] > '40') {$color[$c]='#ff3300'; $white[$c]=0;}
else {$color[$c]='#ff0000';}
}
#repére des extremes
$replow=array('','');
$rephight=array('','');
$repmean=array('','');
$colortext=array('','','','','','');
for ($c=0; $c<2; $c++)
{
if ($white[$c]==1) {$colortext[$c]='color="white"';}
else {$colortext[$c]='';}
}
if ($tempdev == 0) {$devcolor='';};
if($tempdev < 0) {$devcolor="bgcolor='#ccffff'";}
else {$devcolor="bgcolor='#ffcccc'";};
switch($mois)
{
case "janvier":
$monthnum="01";
$lastday="31";
break;
case "février":
$monthnum="02";
$lastday="28";
break;
case "mars":
$monthnum="03";
$lastday="31";
break;
case "avril":
$monthnum="04";
$lastday="30";
break;
case "mai":
$monthnum="05";
$lastday="31";
break;
case "juin":
$monthnum="06";
$lastday="30";
break;
case "juillet":
$monthnum="07";
$lastday="31";
break;
case "août":
$monthnum="08";
$lastday="31";
break;
case "septembre":
$monthnum="09";
$lastday="30";
break;
case "octobre":
$monthnum="10";
$lastday="31";
break;
case "novembre":
$monthnum="11";
$lastday="30";
break;
case "décembre":
$monthnum="12";
$lastday="31";
break;
}
#colorisation ensoleillement
if($sun_cent <= '30') {$color[6]='#ffffcc'; $white[6]=0; }
elseif($sun_cent > '30' && $sun_cent <= '60') {$color[6]='#ffff99'; $white[6]=0; }
elseif($sun_cent > '60' && $sun_cent <= '120') {$color[6]='#ffff66'; $white[6]=0; }
elseif($sun_cent > '120' && $sun_cent <= '180') {$color[6]='#ffff33'; $white[6]=0; }
elseif($sun > '180' && $sun <= '240') {$color[6]='#ffff00'; $white[6]=0;}
elseif($sun > '240' && $sun <= '300') {$color[6]='#ffcc00'; $white[6]=0; }
elseif($sun > '300' && $sun <= '360') {$color[6]='#ff9900'; $white[6]=0; }
elseif($sun > '360') {$color[6]='#ff6600'; $white[6]=1; }
else {$color[6]='#ff6600';}
#incrémentation du tableau
if ($temp != ""){
$ligne2 .= "<tr >
<td bgcolor='#d4d4d4' align='center'><a href='climato.php?annee=$yearstr&mois=$monthnum' target='_self'>$mois</a></td>
<td bgcolor='$color[0]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne2 .= "t.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[0]> $temp °C </td>
<td bgcolor='$color[1]' width='65' align='center'><font $colortext[1]> $normtemp °C </td>
<td $devcolor width='65' align='right'><font> $tempdev °C</td>
<td bgcolor='$color[6]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne2 .= "st.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[0]> $sun h </td>
<td bgcolor='$color[6]' width='65' align='center'><font>$sunpourcent%</td>
</tr>
";}
}
$ligne3="";
########################################
#Récupération des moyennes annuelles de pluie ##
########################################
$item_m = explode(",",$total3);
$rain_m = $item_m[3];
$normrain_m = $item_m[1];
$raindev_m = $item_m[2];
$dayrain_m = $item_m[4];
$dayrain20_m = $item_m[6];
$nb = substr_count ($table3, "
");
$line3 = explode("
",$table3);
for ($i=0; $i<$nb+1; $i++)
{
#selection ligne
$item = explode(",",$line3[$i]);
#séparation et classement des valeurs
$mois = $item[0];
$normrain = $item[1];
$raindev = $item[2];
$rain = $item[3];
$dayrain = $item[4];
$dayrain2 = $item[5];
$dayrain20 = $item[6];
#colorisation pluie
if($rain >= '0.2' && $rain <= '1') {$color[3]='#ccffff'; $white[3]=0;}
elseif($rain > '1' && $rain <= '2.5') {$color[3]='#99ffff'; $white[3]=0;}
elseif($rain > '2.5' && $rain <= '5') {$color[3]='#66ffff'; $white[3]=0;}
elseif($rain > '5' && $rain <= '7.5') {$color[3]='#33ffff'; $white[3]=0; }
elseif($rain > '7.5' && $rain <= '10') {$color[3]='#00ffff'; $white[3]=0; }
elseif($rain > '10' && $rain <= '15') {$color[3]='#00ccff'; $white[3]=0; }
elseif($rain > '15' && $rain <= '30') {$color[3]='#0099ff'; $white[3]=0;}
elseif($rain > '30' && $rain <= '60') {$color[3]='#0066ff'; $white[3]=0; }
elseif($rain > '60' && $rain <= '100') {$color[3]='#0033ff'; $white[3]=0; }
elseif($rain > '100') {$color[]='#0000ff'; $white[3]=0;}
else {$color[3]='#ffffff';}
#repére des extremes
$replow=array('','');
$rephight=array('','');
$repmean=array('','');
$colortext=array('','','','','','');
if ($white[3]==1) {$colortext[3]='color="white"';}
else {$colortext[3]='';}
if ($raindev == 0) {$devcolor='';};
if($raindev > 0) {$devcolor="bgcolor='#ccffff'";}
else {$devcolor="bgcolor='#ffffcc'";}
switch(trim($mois))
{
case "janvier":
$monthnum="01";
break;
case "février":
$monthnum="02";
break;
case "mars":
$monthnum="03";
break;
case "avril":
$monthnum="04";
break;
case "mai":
$monthnum="05";
break;
case "juin":
$monthnum="06";
break;
case "juillet":
$monthnum="07";
break;
case "août":
$monthnum="08";
break;
case "septembre":
$monthnum="09";
break;
case "octobre":
$monthnum="10";
break;
case "novembre":
$monthnum="11";
break;
case "décembre":
$monthnum="12";
break;
}
#incrémentation du tableau
if ($rain != ""){
$ligne3 .= "<tr >
<td bgcolor='#d4d4d4' align='center'><a href='climato.php?annee=$yearstr&mois=$monthnum' target='_self'>$mois</a></td>
<td bgcolor='$color[3]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne3 .= "p.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[3]> $rain mm </td>
<td width='65' align='center'><font> $dayrain</td>
<td width='65' align='center'><font>$dayrain20</td>
<td width='65' align='center'><font> $normrain mm</td>
<td $devcolor width='65' align='right'><font> $raindev mm</td>
</tr>
";}
}
$ligne4="";
########################################
#Récupération des moyennes annuelles de vent ##
########################################
$item_m = explode(",",$total4);
$vent_m = $item_m[1];
$ventmax_m = $item_m[2];
$ventmaxday_m = $item_m[4];
$secteur_m = $item_m[8];
$secteur_m=trim($secteur_m);
$gustmax_m = $item_m[5];
$gustmaxday_m = $item_m[7];
$nb = substr_count ($table4, "
");
$line4 = explode("
",$table4);
for ($i=0; $i<$nb+1; $i++)
{
#selection ligne
$item = explode(",",$line4[$i]);
#séparation et classement des valeurs
$mois = $item[0];
$vent = $item[1];
$ventmax = $item[2];
$ventmaxday = $item[4];
$ventmaxhour = $item[3];
$secteur = $item[8];
$secteur = trim($secteur);
$gustmax = $item[5];
$gustmaxday = $item[7];
$gustmaxhour = $item[6];
#colorisation vent
if($vent < '10' ) {$color[0]='#ffffff';}
elseif($vent >= '10' && $vent < '20') {$color[0]='#ebebeb'; $white[0]=0;}
elseif($vent >= '20' && $vent < '30') {$color[0]='#d7d7d7'; $white[0]=0;}
elseif($vent >= '30' && $vent < '40') {$color[0]='#c4c4c4'; $white[0]=0; }
elseif($vent >= '40' && $vent < '50') {$color[0]='#afafaf'; $white[0]=0; }
elseif($vent >= '50' && $vent < '60') {$color[0]='#AB8787'; $white[0]=0; }
elseif($vent >= '60' && $vent < '70') {$color[0]='#D07676'; $white[0]=0;}
elseif($vent >= '70' ) {$color[0]='#ff0000'; $white[0]=0; }
else {$color[0]='#222222';}
if($ventmax < '10' ) {$color[1]='#ffffff';}
elseif($ventmax >= '10' && $ventmax < '20') {$color[1]='#ebebeb'; $white[1]=0;}
elseif($ventmax >= '20' && $ventmax < '30') {$color[1]='#d7d7d7'; $white[1]=0;}
elseif($ventmax >= '30' && $ventmax < '40') {$color[1]='#c4c4c4'; $white[1]=0; }
elseif($ventmax >= '40' && $ventmax < '50') {$color[1]='#afafaf'; $white[1]=0; }
elseif($ventmax >= '50' && $ventmax < '60') {$color[1]='#AB8787'; $white[1]=0; }
elseif($ventmax >= '60' && $ventmax < '70') {$color[1]='#D07676'; $white[1]=0;}
elseif($ventmax >= '70' ) {$color[1]='#ff0000'; $white[1]=0; }
else {$color[1]='#222222';}
if($gustmax < '10' ) {$color[2]='#ffffff';}
elseif($gustmax >= '10' && $gustmax < '20') {$color[2]='#ebebeb'; $white[2]=0;}
elseif($gustmax >= '20' && $gustmax < '30') {$color[2]='#d7d7d7'; $white[2]=0;}
elseif($gustmax >= '30' && $gustmax < '40') {$color[2]='#c4c4c4'; $white[2]=0; }
elseif($gustmax >= '40' && $gustmax < '50') {$color[2]='#afafaf'; $white[2]=0; }
elseif($gustmax >= '50' && $gustmax < '60') {$color[2]='#AB8787'; $white[2]=0; }
elseif($gustmax >= '60' && $gustmax < '70') {$color[2]='#D07676'; $white[2]=0;}
elseif($gustmax >= '70' ) {$color[2]='#ff0000'; $white[2]=0; }
else {$color[2]='#222222';}
#repére des extremes
$replow=array('','');
$rephight=array('','');
$repmean=array('','');
$colortext=array('','','','','','');
for ($c=0; $c<3; $c++)
{
if ($white[$c]==1) {$colortext[$c]='color="white"';}
else {$colortext[$c]='';}
}
if ($ventmax == $ventmax_m) {$replow = array("<b>","</b></font>");}
if ($gustmax == $gustmax_m) {$rephight = array("<b>","</b></font>");}
switch(trim($mois))
{
case "janvier":
$monthnum="01";
break;
case "février":
$monthnum="02";
break;
case "mars":
$monthnum="03";
break;
case "avril":
$monthnum="04";
break;
case "mai":
$monthnum="05";
break;
case "juin":
$monthnum="06";
break;
case "juillet":
$monthnum="07";
break;
case "août":
$monthnum="08";
break;
case "septembre":
$monthnum="09";
break;
case "octobre":
$monthnum="10";
break;
case "novembre":
$monthnum="11";
break;
case "décembre":
$monthnum="12";
break;
}
#incrémentation du tableau
if ($vent != ""){
$ligne4 .= "<tr >
<td bgcolor='#d4d4d4' align='center'><a href='climato.php?annee=$yearstr&mois=$monthnum' target='_self'>$mois</a></td>
<td bgcolor='$color[0]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne4 .= "v.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[0]> $vent km/h </td>
<td bgcolor='$color[1]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne4 .= "v.gif','','',1,0,0);\" onmouseout='hidetrail();'><font $colortext[1]>$replow[0] $ventmax km/h $replow[1]</td>
<td width='65' align='center'><font> $ventmaxday</td>
<td width='65' align='center'><font>$ventmaxhour</td>
<td bgcolor='#ffffff' width='60' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/ddis_m$yearstr$monthnum.gif','','',1,0,0);\" onmouseout='hidetrail();'><font>$secteur</td>
<td bgcolor='$color[2]' width='65' align='center' onmouseover=\"showtrail('../../../mesures/$yearstr/mini_m$yearstr$monthnum";
$ligne4 .= "gu.gif','','',1,0,0);\" onmouseout='hidetrail();' ><font $colortext[2]>$rephight[0] $gustmax km/h $rephight[1]</td>
<td width='65' align='center'><font> $gustmaxday</td>
<td width='65' align='center'><font>$gustmaxhour</td>
</tr>
";}
}
#################
#affichage final#
#################
echo "
<body>
<font face='Arial' size='3'><center><b>$title1</b></center></font><br>
<table align='left'>
<tr>
<td>
<input onclick='donoaaprevyear();' type='button' $disableprev name='nooaprev'id='nooaprev' value='Précédente' >
<input onclick='donoaanextyear();' type='button' $disablenext name='nooanext'id='nooanext' value='Suivante' >
<input onclick='moisnoaa();' type='button' value='Mois' >
<form name='date' method='GET' action='redirclimatoa.php'>
</td>
<td>
<font face='Arial' size='2'> Recherche :</font>
<select name='annee' size='1'>";
$today = getdate();
$year = $today['year'];
echo "<option value='vide'>Année</option>" ;
for ($i=$anneedebut;$i <= $year; $i=$i+1){echo "<option value='$i'>$i</option>";
}
echo"
</select>
</td>
<td>
<input type='submit' class='bouton_php' name='AFFICHER' value='Afficher'>
</form>
</td
</tr>
</table>
<table class='tableau_php'>
<tr>
<td class='cellule_couleur_php' rowspan='2'><b>Mois</b></td>
<td class='cellule_couleur_php' colspan='9'><b>Température</b></td>
<td class='cellule_couleur_php'>Jours</td>
<td class='cellule_couleur_php'>Jours</td>
<td class='cellule_couleur_php'>Jours</td>
</tr>
<tr>
<td class='cellule_couleur_php'>moy</td>
<td class='cellule_couleur_php'>moy min</td>
<td class='cellule_couleur_php'>min</td>
<td class='cellule_couleur_php'>date min</td>
<td class='cellule_couleur_php'>heure min</td>
<td class='cellule_couleur_php'>moy max</td>
<td class='cellule_couleur_php'>max</td>
<td class='cellule_couleur_php'>date max</td>
<td class='cellule_couleur_php'>heure max</td>
<td class='cellule_couleur_php'>sans dégel</td>
<td class='cellule_couleur_php'>de gel</td>
<td class='cellule_couleur_php'>(Tmax > °C)</td>
</tr>
$ligne
<tr>
<td></td>
<td>$meantemp_m °C</td>
<td>$lowtempmean_m °C</td>
<td>$lowtemp_m °C</td>
<td></td>
<td></td>
<td>$highttempmean_m °C</td>
<td>$highttemp_m °C</td>
<td></td>
<td></td>
<td>$icedays_m</td>
<td>$colddays_m</td>
<td>$heatdays_m</td>
</tr>
</table>
<table class='tableau_bas_php'>
<tr>
<td class='cellule_couleur_php' width='20%' rowspan='2'><b>Mois</b></td>
<td class='cellule_couleur_php' colspan='3'><b>Température</b></td>
<td class='cellule_couleur_php' colspan='2'><b>Ensoleillement</b></td>
</tr>
<tr>
<td class='cellule_couleur_php'>moyenne</td>
<td class='cellule_couleur_php'>Moy. Météo France</td>
<td class='cellule_couleur_php'>Ecart de la normale</td>
<td class='cellule_couleur_php'>Mesuré</td>
<td class='cellule_couleur_php'>Ecart</td>
</tr>
$ligne2
<tr>
<td></td>
<td>$temp_m °C</td>
<td>$normtemp_m °C</td>
<td>$tempdev_m °C</td>
<td colspan='2'>$sun_m h</td>
</tr>
</table>
<table class='tableau_bas_php'>
<tr>
<td class='cellule_couleur_php' rowspan='2' width='20%'><b>Mois</b></td>
<td class='cellule_couleur_php' colspan='5'><b>Pluie</b></td>
</tr>
<tr>
<td class='cellule_couleur_php'>pluie totale</td>
<td class='cellule_couleur_php'>jours pluie</td>
<td class='cellule_couleur_php'>jours > 20mm </td>
<td class='cellule_couleur_php'>normale 1990-2005</td>
<td class='cellule_couleur_php'>écart de la normale</td>
</tr>
$ligne3
<tr>
<td></td>
<td>$rain_m mm</td>
<td>$dayrain_m</td>
<td>$dayrain20_m</td>
<td>$normrain_m mm</td>
<td>$raindev_m mm</td>
</tr>
</table>
<table class='tableau_bas_php'>
<tr>
<td class='cellule_couleur_php' width='20%' rowspan='2'><b>Mois</b></td>
<td class='cellule_couleur_php' colspan='8'><b>Vent</b></td>
</tr>
<tr>
<td class='cellule_couleur_php'>vent moyen</td>
<td class='cellule_couleur_php'>vent 10min max</font></td>
<td class='cellule_couleur_php'>jour</td>
<td class='cellule_couleur_php'>heure</td>
<td class='cellule_couleur_php'>secteur</td>
<td class='cellule_couleur_php'>rafale maximum</td>
<td class='cellule_couleur_php'>jour</td>
<td class='cellule_couleur_php'>heure</td>
</tr>
$ligne4
<tr>
<td></td>
<td>$vent_m km/h</td>
<td>$ventmax_m km/h</td>
<td>$ventmaxday_m</td>
<td></td>
<td><img src='climato/$secteur_m.gif'/></td>
<td>$gustmax_m km/h</td>
<td>$gustmaxday_m</td>
<td></td>
</tr>
</table>
</body>";
?>
</div>
Il y aura un problème de division part zéro, mais peu importe pour le test.