Skip to content
Extraits de code Groupes Projets
Valider 9bd9309c rédigé par Animation des soirees's avatar Animation des soirees
Parcourir les fichiers

Print only futur events

parent 2fa8059c
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -15,15 +15,7 @@ $output = "BEGIN:VCALENDAR ...@@ -15,15 +15,7 @@ $output = "BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
METHOD:PUBLISH METHOD:PUBLISH
PRODID:-//Sam events//NONSGML//EN PRODID:-//Sam events//NONSGML//EN
X-WR-CALNAME:Sam events X-WR-CALNAME:Sam events\n\n";
BEGIN:VTIMEZONE
TZID:UTC
BEGIN:STANDARD
TZOFFSETFROM:+0000
TZOFFSETTO:+0000
DTSTART:".gmdate(DATE_ICAL)."
END:STANDARD
END:VTIMEZONE\n\n";
// get events // get events
$events = $bdd->prepare('SELECT id, title, date, place, description $events = $bdd->prepare('SELECT id, title, date, place, description
...@@ -34,19 +26,11 @@ $events->execute(); ...@@ -34,19 +26,11 @@ $events->execute();
// loop over events // loop over events
while ($event = $events->fetch()) { while ($event = $events->fetch()) {
$output .= $output .=
"BEGIN:VTIMEZONE "BEGIN:VEVENT
TZID:Europe/Paris
BEGIN:STANDARD
TZOFFSETFROM:+0100
TZOFFSETTO:+0100
DTSTART;TZID=UTC:".gmdate(DATE_ICAL)."
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:".$event[0]." UID:".$event[0]."
DTSTAMP;TZID=Europe/Paris:".gmdate(DATE_ICAL)." DTSTAMP:".gmdate(DATE_ICAL)."
DTSTART;TZID=UTC;TZID=Europe/Paris:" . date(DATE_ICAL, $event[2]) . " DTSTART:" . gmdate(DATE_ICAL, $event[2]) . "
DTEND;TZID=UTC;TZID=Europe/Paris:" . date(DATE_ICAL, $event[2] + 5*3600) . " DTEND:" . gmdate(DATE_ICAL, $event[2] + 5*3600) . "
SUMMARY:".str_replace(',', '\\,', $event[1])." SUMMARY:".str_replace(',', '\\,', $event[1])."
DESCRIPTION:".str_replace(',', '\\,', $event[4])." DESCRIPTION:".str_replace(',', '\\,', $event[4])."
LOCATION:".$event[3]." LOCATION:".$event[3]."
......
...@@ -17,6 +17,7 @@ $app->get( ...@@ -17,6 +17,7 @@ $app->get(
$events = $bdd->prepare('SELECT id, title, date, place, description $events = $bdd->prepare('SELECT id, title, date, place, description
FROM sam FROM sam
WHERE date > '.time().'
ORDER BY date'); ORDER BY date');
$events->execute(); $events->execute();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter