|
The following examples do not handle with the calendar layout. The layout (colors, fonts, cell width etc.) should be set in your CSS (see documentation). Please keep also in mind, that the following code does not produce a valid XHTML page. The generated calendar table is XHTML conform though.
Current month static calendar
<?php
require_once("activecalendar.php");
$cal = new activeCalendar();
echo $cal->showMonth();
?>
|
 |
| July 2010 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 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 | |
|
Current month calendar with date picker (year range: 2000-2010), month navigation and day links
<?php
require_once("activecalendar.php");
$myurl=$_SERVER['PHP_SELF']; // the links url is this page
$yearID=false; // init false to display current year
$monthID=false; // init false to display current month
$dayID=false; // init false to display current day
extract($_GET); // get the new values (if any) of $yearID,$monthID,$dayID
$cal = new activeCalendar($yearID,$monthID,$dayID);
$cal->enableMonthNav($myurl);
$cal->enableDatePicker(2000,2010,$myurl);
$cal->enableDayLinks($myurl);
echo $cal->showMonth();
?>
|
 |
|
Month calendar (November 2007) with multiple 'event days' and 'event content'
<?php
require_once("activecalendar.php");
$cal = new activeCalendar("2007","11");
$cal->setEvent("2007","11","17","event"); // it will create a class="event"
$cal->setEvent("2007","11","7"); // it will also create a class="event" (default)
//The following will create a class="event" and an <a href="index.php">
$cal->setEvent("2007","11","20","event","index.php");
//The following will create an event content 'test1'
$cal->setEventContent("2007","11","12","test1");
//The following will create an event content 'test2' with an an <a href="index.php">
$cal->setEventContent("2007","11","13","test2","index.php");
//The following will create an event content 'test3' //with an an <a href="index.php"> and class="event"
$cal->setEventContent("2007","11","14","test3","index.php","event");
//The following will create a block of events (26th to 30th)
for ($i=26;$i<=30;$i++) {
$cal->setEvent("2007","11",$i);
}
echo $cal->showMonth();
?>
|
 |
| November 2007 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 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 | | |
|
|
|