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
   | function remplisMois($time, $numMois, $curPosJour, $annee) {
			include('connexion.php');
			$req = "SELECT dateProgramme FROM EVENEMENT";
			$rsDate = mysql_query($req, $connexion);
 
				$nomCurMois = nomMois($numMois);
				$curJour = 1;
 
				while ($nomCurMois == nomMois(date("m",$time))) {
					while ($lsDate = mysql_fetch_array($rsDate)) {
						$dateProgramme = $lsDate['dateProgramme'];
							$jourProgramme = substr($dateProgramme, 8,2);
							$moisProgramme = substr($dateProgramme, 5,2);
							$anneeProgramme = substr($dateProgramme, 0,4);
						$dateJour = date("Y-m-j");
 
						$dProgramme = explode("-", $dateProgramme);
						$dJour = explode("-", $dateJour);
						$finab = $dProgramme[2].$dProgramme[1].$dProgramme[0];
						$auj = $dJour[2].$dJour[1].$dJour[0];
						if ($finab >= $auj) {
							echo $dateProgramme; 
							echo evenement(ajouteDateZero("$jourProgramme-$moisProgramme-$anneeProgramme")) . "<a href='?annee=$annee&mois=$numMois&jour=$curJour' class='Date1'>$curJour</a>\n</td>\n";	
						} elseif ($finab < $auj ){
							echo $dateProgramme; 
							echo evenement(ajouteDateZero("$jourProgramme-$moisProgramme-$anneeProgramme")) . "<a href='?annee=$annee&mois=$numMois&jour=$curJour' class='Date2'>$curJour</a>\n</td>\n";
						} else {
							echo evenement(ajouteDateZero("$curJour-$numMois-$annee")) . "<a href='?annee=$annee&mois=$numMois&jour=$curJour' class='Date'>$curJour</a>\n</td>\n";
						}
					}
					$time += 60*60*24;
					$curJour ++;
					$curPosJour ++;
					if ($curPosJour == 7) {
						echo "	</tr>\n	<tr>\n";
						$curPosJour = 0;
					}
					if ($curJour > 31)
						break;
 
				}
				//retourne le nombre de jours restant a remplir
				return 7 - $curPosJour;
		} | 
Partager