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 Tomas Pavlatka  >  PTX PHP Calendar  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Index file - body of example
Class: PTX PHP Calendar
Display month calendar in HTML tables
Author: By
Last change:
Date: 3 years ago
Size: 594 bytes
 

Contents

Class file image Download
<?php
/**
 * Author: Tomas Pavlatka (tomas.pavlatka@gmail.com)
 * Created: 2010-12-28
 */
 
// Needed classes.
require_once './classes/Calendar.php';

// Object.
$options = array(
    
'date_format' => 'd',
    
'day_names' => array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'),
    
'show_days_from_different_month' => false       
);
$calendarObj = new PTX_Calendar($options);

// Variables.
$month = (isset($_GET['month'])) ? (int)$_GET['month'] : 1;
$year = (isset($_GET['year'])) ? (int)$_GET['year'] : 2010;

// build month.
echo $calendarObj->buildMonth($month,$year);