Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Egorov Stanislav  >  Ministry_Calendar  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: testing main class
Class: Ministry_Calendar
Output month calendars in HTML
Author: By
Last change: Added new function test.
Date: 2004-06-24 08:43
Size: 1,179 bytes
 

Contents

Class file image Download
<!--at first we include CSS to know how our calendar looks-->
<link rel=stylesheet type=text/css href=style.css>
<?php
require_once "calendar.class.php";
require_once 
"timer.class.php";
$timer=new timer(); //start timer (this just for fun)

if(!isset($m) || !isset($y))//if the year or month not defined
{
$today time();//define current time
$m date("n"time());//gotta month;
$y date"Y"time());//gotta year;
}
// Russian month names & daynames
/*
$ru1 = array("&#710; ìåñÿö", "ßíâàðü", "Ôåâðàëü", "Ìàðò", "Àïðåëü", "Ìàé",
             "Èþíü", "Èþëü", "Àâãóñò", "Ñåíòÿáðü", "Îêòÿáðü", "Íîÿáðü", "Äåêàáðü");
$ru2 = array("Ïí", "Âò", "Ñð", "×ò", "Ïò", "Ñá", "Âñ");
*/

$c = new xuev_Calendar;

//$c->setMonthNames($ru1);
//$c->setDayNames($ru2);

//2 variants of jumpMenu (IMHO second much better)
echo "<b>which one better? (any suggestions?)</b><br><br><br>";
echo 
"JumpMenu first variant<br>".$c->jumpMenu1();
echo 
"JumpMenu second variant<br>".$c->jumpMenu2();

echo 
"Calendar<br><br>".$c->getMonthHtml($m$y);//showing calendar for $m month and $m year

//echo $c->getYearHtml(2004);

$timer->elapsed();// showing elapsed time
?>