Salut,
J'ai réaliser un petit calendrier pour mon site, j'ai cependant un petit problème. Je ne vois pas comment faire pour avancer d'un mois ou reculer d'un mois en cliquer sur le lien.
Si quelqu'un aurait une idée, c'est très volontier.
<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&eacute;vrier", "Mars", "Avril", "Mai", "Juin","Juillet", "Ao&ucirc;t", "Septembre", "Octobre", "Novembre","D&eacute;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;
?>
----
<?
$lien=date("Y+m+d", mktime(0,0,0,$mois-1,$jour,$annee));
echo "<<";
echo "&nbsp;$MoisAnnee&nbsp;";
$lien=date("Y+m+d", mktime(0,0,0,$mois+1,$jour,$annee));
echo ">>";
?>
,
----
<?
echo\"Sem, \n\";
for ($i=0;$i<7;$i++) {
echo\"$tableauJour[$i], \n\";
}
?>
<?
$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 \"----
\";
// 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 \"".(($val < 10) ? "0".$val : $val).", \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 \"".$val.", \n\";
}
echo \"\";
}
?>
Afficher la suite