PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ivan Melgrati   iam_calendar   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Test file - Used to show some of the class' features
Class: iam_calendar
Display month calendars highlighting special days
Author: By
Last change:
Date: 18 years ago
Size: 2,736 bytes
 

Contents

Class file image Download
<?PHP
   
/**
    * This is the the test-file for IAM_Calendar class. It shows how to create and use the IAM_Calendar class
    * @package IAM_Classes
    * @subpackage IAM_Calendar
    * @author Iván Melgrati <imelgrat@gmail.com>
    * @version 1.0
    */
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="iam_styles.css" />
<TITLE>IAM_Calendar - A HTML Calendar Generator
</HEAD>
<BODY>
<form name="theForm" action="proccess.php" method="post" enctype="multipart/form-data" target="_new">
<table align="center">
<tr>
<td align="center">
<P class="monthHeaderStyle">This is the Calendar with Default Options</P>
<CODE>
    require_once('iam_calendar.php');<BR />
    $calendar = new IAM_Calendar();<BR />
    $this->SetMonth(9);<BR />
    echo $calendar->drawMonth();<BR />
</CODE><BR />
<?php
   
/**
    * Include the IAM_Calendar Class definition
    */
   
require_once('iam_calendar.php');
   
$calendar = new IAM_Calendar();
   
$calendar->SetMonth(9);
    echo
$calendar->drawMonth().'<BR />';
?>
<P class="monthHeaderStyle">Here we add a couple of holidays, show the month header and disable selecting multiple dates.<br>
The holiday description pops up when the mouse hovers that day (without JavaScript)</P>
<CODE>
    $calendar->addHoliday(2006, 9, 4, 'The Fourth of September');<BR />
    $calendar->addHoliday(2006, 9, 8, 'My B-Day');<BR />
    echo $calendar->drawMonth(false, true, true, true, true, 'cal2');
</CODE><BR /> <BR />
<?php
    $calendar
->addHoliday(2006, 9, 4, 'The Fourth of September');
   
$calendar->addHoliday(2006, 9, 8, 'My B-Day');
    echo
$calendar->drawMonth(false, true, true, true, true, 'cal2').'<BR />';
?>
<P class="monthHeaderStyle">And here we change the CSS class for holidays</P>
<CODE>
    $calendar->setStyle('holidayStyle','holidayStyleb');<BR />
    echo $calendar->drawMonth(false, true, true, true, false, 'cal');
</CODE><BR /> <BR />
<?php
    $calendar
->setStyle('holidayStyle','holidayStyleb');
    echo
$calendar->drawMonth(false, true, true, true, false).'<BR />';
?>
<P class="monthHeaderStyle">Day names in Spanish!!!</P>
<CODE>
    $calendar->setDayNames('Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado');<BR />
    echo $calendar->drawMonth(true, true, true, true, false);
</CODE><BR /> <BR />
<?php
    $calendar
->setDayNames(Array('Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado'));
    echo
$calendar->drawMonth(true, true, true, true, false);
?>
</form>
</td>
<tr>
<td align="center">
<input type="submit" name="Submit" value="Send Data">
</tr>
</table>
</BODY>
</HTML>