Browse Source

link

master
AmarOk1412 11 years ago
parent
commit
52cfc4662f
3 changed files with 0 additions and 72 deletions
  1. +0
    -39
      calendar.php~
  2. +0
    -23
      getEvents.php~
  3. +0
    -10
      kiwi.ics~

+ 0
- 39
calendar.php~ View File

@ -1,39 +0,0 @@
<?php
# if(!isset($_POST["y"]))
# {
# header("Location:.");
# exit;
# }
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=kiwicalendar.ics');
include("./getEvents.php");
$icalheader = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:KiWiCalendar v1.0//EN
";
$icalfooter = "END:VCALENDAR";
#"BEGIN:VEVENT
#UID:" . md5(uniqid(mt_rand(), true)) . "@yourhost.test
#DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z
#DTSTART:19970714T170000Z
#DTEND:19970715T035959Z
#SUMMARY:Bastille Day Party"
$events = getEvents();
echo $icalheader;
foreach($events as $event)
{
echo "BEGIN:VEVENT
SUMMARY:".$event["titre"]."
DTSTART:".date("Ymd\THis",strtotime($event["dtstart"]))."
DTEND:".date("Ymd\THis",strtotime($event["dtend"]))."
LOCATION:".$event["localisation"]."
CATEGORIES:"."<TODO : categorie>"."
DESCRIPTION:".$event["description"]."
END:VEVENT\n";
}
echo $icalfooter;
?>

+ 0
- 23
getEvents.php~ View File

@ -1,23 +0,0 @@
<?php
# if(!isset($_POST["y"]))
# {
# header("Location:.");
# exit;
# }
function getEvents()
{
try
{
$pdo = new PDO("sqlite:testdb.db");
}
catch(Exception $e)
{
echo("Impossible d'acceder à la base de donnée");
die();
}
$stmt = $pdo->prepare("SELECT * FROM events");
$stmt->execute();
$result = $stmt->fetchAll();
return result;
}
?>

+ 0
- 10
kiwi.ics~ View File

@ -1,10 +0,0 @@
<?php
# if(!isset($_POST["y"]))
# {
# header("Location:.");
# exit;
# }
include("./getEvents.php");
$events = getEvents();
?>

Loading…
Cancel
Save