afficher_horaires):
$horaires = $fiche->HORAIRES->Horaire;
//echo count($horaires);
if(count($horaires) > 0)
{
$jours = array(
"LUNDI"=>1,
"MARDI"=>2,
"MERCREDI"=>3,
"JEUDI"=>4,
"VENDREDI"=>5,
"SAMEDI"=>6,
"DIMANCHE"=>7
);
$dates = '';
$ladatedu = (string)$fiche->PERIODE_DU;
$ladateau = (string)$fiche->PERIODE_AU;
if($ladatedu == $ladateau) {
$originalDateDu = str_replace('/','-',$ladatedu);
$newDateDuJourSemaine =getJoursSemaine(date("N", strtotime($originalDateDu)));
$newDateDuNumJourSemaine = date("d", strtotime($originalDateDu));
$newDateDuNomDuMois = getMoisDiminutif(date("m", strtotime($originalDateDu)));
$newDateDuNumAnnee = date("Y", strtotime($originalDateDu));
$dates .= '
';
$dates .= ''.$newDateDuJourSemaine.'
';
$dates .= ''.$newDateDuNumJourSemaine.'
';
$dates .= ''.$newDateDuNomDuMois.' '.$newDateDuNumAnnee.'';
$dates .= '
';
} else {
$originalDateDu = str_replace('/','-',$ladatedu);
$newDateDuJourSemaine =getJoursSemaine(date("N", strtotime($originalDateDu)));
$newDateDuNumJourSemaine = date("d", strtotime($originalDateDu));
$newDateDuNomDuMois = getMoisDiminutif(date("m", strtotime($originalDateDu)));
$newDateDuNumAnnee = date("Y", strtotime($originalDateDu));
$dates .= '
';
$dates .= '
';
$dates .= ''.$newDateDuJourSemaine.'
';
$dates .= ''.$newDateDuNumJourSemaine.'
';
$dates .= ''.$newDateDuNomDuMois.'
'.$newDateDuNumAnnee.'';
$dates .= '
';
}
if(isset($ladateau) && (string)$ladateau != (string)$ladatedu){
$originalDateAu = str_replace('/','-',$ladateau);
$newDateAuJourSemaine = getJoursSemaine(date("N", strtotime($originalDateAu)));
$newDateAuNumJourSemaine = date("d", strtotime($originalDateAu));
$newDateAuNomDuMois = getMoisDiminutif(date("m", strtotime($originalDateAu)));
$newDateAuNumAnnee = date("Y", strtotime($originalDateAu));
$dates .= '
-
';
$dates .= '
';
$dates .= ''.$newDateAuJourSemaine.'
';
$dates .= ''.$newDateAuNumJourSemaine.'
';
$dates .= ''.$newDateAuNomDuMois.'
'.$newDateAuNumAnnee.'';
$dates .= '
';
$dates .= '
';
}
$horaires = $fiche->xpath("HORAIRES/Horaire[DATE_DEBUT='".$ladatedu."' and DATE_FIN='".$ladateau."']");
$hh = 0;
$heur = '';
foreach ($horaires as $key => $horaire):
// Nouvelles dates
foreach($horaire->HEURES->Heure as $heure) {
$jourlettre ='';
$comptejour =0;
foreach($jours as $cle => $jour){
if($horaire->HEURES->Heure->$cle && (string)$horaire->HEURES->Heure->$cle == "O"){
$comptejour++;
$jourlettre .= ($jourlettre != '') ? ','.getJoursSemaine($jour) : getJoursSemaine($jour);
}
}
if($comptejour==7){
$heur .= JTEXT::_('Tous les jours');
} else{
$heur .= $jourlettre;
}
//print_r($heure);
$hdeb = str_replace(':','h',(string)$heure->HEURE_DEBUT);
$hfin = str_replace(':','h',(string)$heure->HEURE_FIN);
if($hh > 1 ) {
$heur .= ' / ';
}
if($hdeb!='') {
if($hdeb==$hfin || $hfin < $hdeb)
$heur .= ' '.JTEXT::_('à partir de ').' '.$hdeb;
else
$heur .= ' '.JTEXT::_('de').' '.$hdeb.' '.JTEXT::_('à').' '.$hfin;
}
$hh++;
}
/*}*/
/*if($heur != ''){
$dates .= "
".$heur;
}
endforeach;
echo $dates;
}*/ ?>