-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathical.php
More file actions
28 lines (18 loc) · 682 Bytes
/
Copy pathical.php
File metadata and controls
28 lines (18 loc) · 682 Bytes
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
<?php
header('Content-Type: text/calendar');
try {
require 'classes/twente_milieu.php';
require 'classes/ical.php';
$afvalkalender = new TwenteMilieu($_GET['postcode'], $_GET['huisnummer']);
$ical_generator = new iCal('TwenteMilieu', 'Afvalkalender');
// Find first of this month
$request_date = new DateTime();
$request_date->setDate($request_date->format('Y'), $request_date->format('m'), 1);
$request_date->setTime(0,0,0);
$request_date->setTimezone(new DateTimeZone('Europe/Amsterdam'));
$events = $afvalkalender->getEvents($request_date);
echo $ical_generator->render($events);
} catch ( Exception $e ) {
echo "ERROR: {$e->getMessage()}";
}
?>