Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Riccardo Brambilla  >  RCalendar  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Examples file
Class: RCalendar
Display XHTML calendars of a given month
Author: By
Last change:
Date: 7 years ago
Size: 1,663 bytes
 

Contents

Class file image Download
<?php 
/**
 * Inclusions
 * [1] Language file
 * Option is detected from a simple config. file
 */
$conf parse_ini_file("conf.ini.php");
$lang $conf['lang'];

if(
file_exists("$lang.php")){
    include_once(
"$lang.php");
}
else {
    die(
"NO LANGUAGE FILE FOUND!");
}

/**
 * Inclusions
 * [2] Month-day names arrays
 * IMPORTANT: This File MUST be included before RCalendar.class.php
 * Note: You could directly include the file before the class definition in the class file
 */
include_once("names_arrays.php");

/**
 * Inclusions
 * [3] Class
 */
include_once("RCalendar.class.php");

/**
 * Objects
 */
$cal       = new RCalendar(12007true,  true,  "onclick='alert(\"Hello!\");'""yellow"); 
$cal_two   = new RCalendar(41980falsetrue,  "onclick='alert(\"I was born on 23th :)!\");'"); 
$cal_three = new RCalendar(12007true,  false"onmouseover='alert(\" My ID: \" +  this.id);'""#ff0000"); 

?>

<html>
    <head>
        <title>RCalendar Example Page</title>
        <?php $cal->printStyleSheet("style.css"); ?>
    </head>
    
    <body>
    
        <h2>RCALENDAR CLASS</h2>
        <h3 style='text-align:center;'>Example page</h3>
        
        <?php
            
echo "Example [1] :: Current day hilighted (Yellow) || WeekEnds Hilighted || onclick=\"alert('Hello');\"<br /><br />";
            
$cal->displayCal();
            echo 
"<br /><br /><br />";
            echo 
"Example [2] :: WeekEnds Hilighted || onclick=\"alert('I was born on 23th :)');\"<br /><br />";
            
$cal_two->displayCal();
            echo 
"<br /><br /><br />";
            echo 
"Example [3] :: Current day hilighted (Red) || onmouseover='alert(\" My ID: \" +  this.id);'<br /><br />";
            
$cal_three->displayCal();
            echo 
"<br /><br /><br />";
        
        
?>
    
    </body>
</html>