diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-10-03 21:37:37 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-10-03 21:37:37 +0200 |
commit | 87607d3b6429bd187827993f5b34da7834686a16 (patch) | |
tree | 8c77c445c56ef54a53302a15d9f56f7ad6dd0f57 /ical.php | |
parent | readme typo fix in omemba dostopa prek spleta (diff) | |
download | gimsisextclient-master.tar gimsisextclient-master.tar.gz gimsisextclient-master.tar.bz2 gimsisextclient-master.tar.lz gimsisextclient-master.tar.xz gimsisextclient-master.tar.zst gimsisextclient-master.zip |
Diffstat (limited to 'ical.php')
-rw-r--r-- | ical.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ical.php b/ical.php new file mode 100644 index 0000000..b21137f --- /dev/null +++ b/ical.php @@ -0,0 +1,16 @@ +<?php + error_reporting(0); + header("Content-Type: text/calendar"); + header("Access-Control-Allow-Origin: *"); + header("X-sijanec-gimsisextclient-webcal-version: 0.0.1"); + require "main.php"; + $g = new gimsisextClient(); + $g->setusername($_REQUEST['u']); + $g->setpassword($_REQUEST['p']); + echo "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Anton Luka Šijanec//NONSGML gimsisextClient iCal fetchocenjevanja//SL\r\n"; + foreach ($g->fetchocenjevanja() as $o) { + $d = explode(".", $o["datum"]); + echo "UID:" . $o["datum"] . $o["kratica"] . $o["predmet"] . "@ical.gimsisextclient.sijanec.eu\r\nDTSTAMP:" . $d[2] . $d[1] . $d[0] . "T080000Z\r\nORGANIZER;CN=" . $o["predmet"] . ":MAILTO:info+" . $o["kratica"] . "@gimb.org\r\nDTSTART:" . $d[2] . $d[1] . $d[0] . "T080000Z\r\nDTEND:" . $d[2] . $d[1] . $d[0] . "T140000Z\r\nSUMMARY:" . $o["kratica"] . ": " . $o["opis"] . "\r\nGEO:46.064167;14.511667\r\nEND:VEVENT\r\n"; + } + echo "END:VCALENDAR\r\n"; +?> |