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
29
30
31
|
<?php
include ('functions.php');
$Filename = "Arrangement".".vcs";
header("Content-Type: text/x-vcalender");
header("Content-Disposition: inline; filename=$Filename");
//prepare and execute query
$query_arr = sprintf("SELECT * from program WHERE id =$id",mysql_real_escape_string($id));
$arr = mysql_query($query_arr, $dns) or die (mysql_error());
$row_arr = mysql_fetch_assoc($arr);
$DescDump = ($row_arr['ingress']. " " . $row_arr['tekst']);
$DescDump = strip_tags($DescDump);
$DescDump = str_replace("\r", "==0D=0A=", $DescDump);
$tid = strftime("%Y%m%dT%H%M00", strtotime($row_arr['tid']));
?>
BEGIN:VCALENDAR
VERSION:1.0
PRODID:Studentersamfundets Kalender
TZ:-01
BEGIN:VEVENT
SUMMARY;ENCODING=QUOTED-PRINTABLE:<?php echo $row_arr['tittel'] . "\n";?>
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: <?php echo $DescDump . "\n"; ?>
LOCATION;ENCODING=QUOTED-PRINTABLE:<?php echo $row_arr['sted'] . "\n";?>
UID: www.studentersamfundet.no/vcal.php?id=<?php echo $id . "\n"; ?>
URL: www.studentersamfundet.no/vis.php?ID=<?php echo $id . "\n"; ?>
DTSTART:<?php echo $tid . "\n"; ?>
DTEND:<?php echo $tid . "\n"; ?>
END:VEVENT
END:VCALENDAR
|