<?php
/**
 * iCalcreator class v2.6
 * copyright (c) 2007-2008 Kjell-Inge Gustafsson, kigkonsult
 * www.kigkonsult.se/iCalcreator/index.php
 * ical@kigkonsult.se
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once 'iCalcreator.class.php';

$v = new vcalendar();                          // initiate new CALENDAR

$e = new vevent();                             // initiate a new EVENT
$e->setProperty( 'categories'
               , 'LOISIRS' );                   // catagorize
$e->setProperty( 'dtstart'
               ,  2008, 12, 24, 19, 30, 00 );  // 31 dec 2008 19.30
$e->setProperty( 'duration'
               , 0, 0, 3 );                    // 3 hours
$e->setProperty( 'summary'
               , utf8_encode('Noël') );
$e->setProperty( 'description'
               , utf8_encode('Fête de Noël') );    // describe the event
$e->setProperty( 'location'
               , 'Maison' );                     // locate the event

$v->addComponent( $e );                        // add component to calendar

$e = new vevent();                             // initiate a new EVENT
$e->setProperty( 'categories'
               , 'LOISIRS' );                   // catagorize
$e->setProperty( 'dtstart'
               ,  2008, 12, 31, 19, 30, 00 );  // 31 dec 2008 19.30
$e->setProperty( 'duration'
               , 0, 0, 3 );                    // 3 hours
$e->setProperty( 'summary'
               , utf8_encode('Jour de l\'an') );
$e->setProperty( 'description'
               , utf8_encode('Réveillon St sylvestre') );    // describe the event
$e->setProperty( 'location'
               , 'Maison' );                     // locate the event
$e->setProperty( 'transp'
               , 'TRANSPARENT' );


$v->addComponent( $e );                        // add component to calendar

$e = new vevent();                             // initiate a new EVENT
$e->setProperty( 'categories'
               , 'BUREAU' );                   // catagorize
$e->setProperty( 'dtstart'
               ,  2009, 01, 02, 08, 30, 00 );  // 02 jan 2009 08.30
$e->setProperty( 'duration'
               , 0, 0, 8 );                    // 3 hours
$e->setProperty( 'summary'
               , 'Essai' );
$e->setProperty( 'description'
               , 'on bosse' );    // describe the event
$e->setProperty( 'location'
               , 'Bureau' );                     // locate the event


$v->addComponent( $e );                        // add component to calendar

/* alt. production */
// $v->returnCalendar();                       // generate and redirect output to user browser
/* alt. dev. and test */
$str = $v->createCalendar();                   // generate and get output in string, for testing?
echo $str;
echo "<br />\n\n";
?>