0 ) : ?> GetParameter('agenda'); if (empty($agenda)) { $agenda = 'tout'; } if ($agenda=='futur') { if (!function_exists('date_periode')) { function date_periode($fiche) { $nbjour = 290; $datejour = time(); $datemax = $datejour + ($nbjour*24*60*60); // date max � J+ nb de jours $datefiche = strtotime($fiche['bf_date_debut_evenement']); $datefin = strtotime($fiche['bf_date_fin_evenement']); if (($datefiche >=$datejour && $datefiche <=$datemax ) || ($datefin >=$datejour && $datefin <=$datemax )) { return true; } else { return false; } } } if (!function_exists('date_compare')) { //tri par ordre chronologique function date_compare($a, $b) { $t1 = strtotime($a['bf_date_debut_evenement']); // strtotime = fonction qui transforme une chaine de caractere en date informatque (= un chiffre calcul� depuis 1970) $t2 = strtotime($b['bf_date_debut_evenement']); return $t1 - $t2; } } $fiches = array_filter($fiches, "date_periode"); usort($fiches, 'date_compare'); // http://php.net/manual/fr/function.usort.php (si on veut avoir mal au crane) } ?>
AddCSSFile('tools/bazar/presentation/styles/agenda.css'); ?>