yeswiki-custom-mutualisatio.../templates/bazar/trajets-demandes.tpl.html
2023-11-09 13:59:05 +03:00

56 lines
2.5 KiB
HTML

<?php
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr_FR','fr','fr','fra','fr_FR@euro');
setlocale(LC_TIME, "fr_FR");
if (count($fiches) > 0) : ?>
<?php echo '<h4>Des demandes de trajets sont en cours !</h4>'; ?>
<?php
echo '<div class="panel-group" id="accordion-demandes" role="tablist" aria-multiselectable="true">';
foreach ($fiches as $fiche): ?>
<?php
$dateOuverture = date(DATE_W3C, strtotime($fiche['date_souhaitee']));
$dateFin = date(DATE_W3C, strtotime($fiche['date_souhaitee_fin']));
$dateJour = date(DATE_W3C);
if ($dateJour<$dateFin) {
$statut = 'Ouvert';
}
if ($statut== 'Ouvert' ) {
// récuperer la fiche producteur
$producteur = baz_valeurs_fiche($fiche['listefiche8producteur']);
$dateTimeObj = new DateTime($fiche['date_souhaitee'], new DateTimeZone('Europe/Paris'));
$date_souhaitee =
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
$dateTimeObj,
'eeee d MMMM y à HH:mm',
'fr'
));
$dateTimeObj = new DateTime($fiche['date_souhaitee_fin'], new DateTimeZone('Europe/Paris'));
$date_souhaitee_fin =
str_replace(' à 0:00', '', IntlDateFormatter::formatObject(
$dateTimeObj,
'eeee d MMMM y à HH:mm',
'fr'
));
echo '<div class="bazar-entry panel panel-default collapsed" '.$fiche['html_data'].'>
<div class="panel-heading collapsed"
data-target="#collapse'.$fiche['id_fiche'].'"
data-toggle="collapse">
<h4 class="panel-title">
Trajet demandé pour '.$producteur['bf_titre'].'<br /><span style="color:#222">du '.$date_souhaitee.' au '.$date_souhaitee_fin.'</span>
</h4>
</div>
<div id="collapse'.$fiche['id_fiche'].'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading'.$fiche['id_fiche'].'">
<div class="panel-body">
'.baz_voir_fiche(true, $fiche).'
</div>
</div>
</div>';
?>
<?php }
endforeach; ?>
</div>
<?php echo $pager_links; ?>
<?php else: ?>
<?php echo '<h4>Pour info, aucun habitant n\'a demandé un trajet particulier actuellement.</h4>'; ?>
<?php endif; ?>