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
| <style type="text/css">
<!--
.titreMois { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: black ; background: #FF7F50 }
.titremois:link { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: white; background: #FF7F50; text-decoration: none }
.titremois:visited { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: white; background: #FF7F50; text-decoration: none }
.titremois:hover { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: #FF0000; background: #FF7F50; text-decoration: underline }
.titrejours { font-family: Helvetica, Arial; font-size: 9px; color: white; background: #FF7F50 }
.titrenum { font-family: Helvetica, Arial; font-size: 11px; color: white; background: #FF7F50 }
.titrenum2 { font-family: Helvetica, Arial; font-size: 11px; color: black; background: #FF7F50}
.titreweek { font-family: Helvetica, Arial; font-size: 9px; color: black; background: #FF7F50}
.titreweek2 { font-family: Helvetica, Arial; font-size: 11px; color: v; background: #FF7F50}
.titrewend { font-family: Helvetica, Arial; font-size: 11px; color: white; background: #B22222 }
.titrewend2 { font-family: Helvetica, Arial; font-size: 11px; color: black; background: #B22222 }
.titrenow { font-family: Helvetica, Arial; font-size: 11px; color: white; background: #8B0000 }
-->
</style>
<?
//Création des variables tableaux
$tableauMois = Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin","Juillet", "Août", "Septembre", "Octobre", "Novembre","Décembre");
$tableauJour = Array("Lun", "Mar", "Mer", "Jeu", "Ven", "Sam","Dim");
//Selection de la date du jour
$annee = date("Y");
$mois = date("m");
$jour = date("d");
$DateDuJour=date("Y/m/d");
//Création de la variable pour l'affichage du titre
$MoisAnnee=$tableauMois[$mois-1]." ".$annee;
?>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class='titreMois' colspan="8" align="center">
<?
$lien=date("Y+m+d", mktime(0,0,0,$mois-1,$jour,$annee));
echo "<a class='titreMois' href=\"?dt=$lien\"><<</a>";
echo "<a class='titreMois'> $MoisAnnee </a>";
$lien=date("Y+m+d", mktime(0,0,0,$mois+1,$jour,$annee));
echo "<a class='titreMois' href=\"?dt=$lien\">>></a>";
?>
</td>
</tr>
<tr>
<?
echo"<td WIDTH=20 class='titreweek' ALIGN='center'>Sem</td>\n";
for ($i=0;$i<7;$i++) {
echo"<td WIDTH=20 class='titrejours' ALIGN='center'>$tableauJour[$i]</td>\n";
}
?>
</tr>
<?
$num_day=date("w", mktime(0,0,0,$mois,01,$annee));
if($num_day==0){$num_day=7;}
$max_day=date("t", mktime(0,0,0,$mois,01,$annee));
$cpt_day=2;
while ($cpt_day<=$max_day+$num_day) {
echo "<tr>";
// calcul le numero de semaine
$nb_day=date("z", mktime(0,0,0,$mois,$cpt_day-$num_day+3,$annee));
$val=intval($nb_day/7)+1;
echo "<td WIDTH=20 class='titreweek2' ALIGN='center'>".(($val < 10) ? "0".$val : $val)."</td>\n";
// affiche les jours du mois
for ($i=0;$i<7;$i++) {
$theday=date("D", mktime(0,0,0,$mois,$cpt_day-$num_day,$annee));
$val=date("d", mktime(0,0,0,$mois,$cpt_day-$num_day,$annee));
$class="titrenum";
if (($theday=="Sun") or ($theday=="Sat")){ $class="titrewend";}
if ($DateDuJour==date("Y/m/d",mktime(0,0,0,$mois,$cpt_day-$num_day,$annee))){ $class="titrenow";}
if ((($cpt_day-$num_day)<1) or (($cpt_day-$num_day)>$max_day)){
$class="titrenum2";
if (($theday=="Sun") or ($theday=="Sat")){ $class="titrewend2";}
}
$cpt_day++;
echo "<td WIDTH=20 class='$class'ALIGN='center'>".$val."</td>\n";
}
echo "</tr>";
}
?>
</table> |
Partager