Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Nigel Johnson  >  Date Chooser  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: example 1 main page
Class: Date Chooser
Outputs a calendar to let the user choose a date
Author: By
Last change: Renamed the description
Date: 2004-07-13 11:31
Size: 879 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
include_once('DateChooser.php');

function 
monthName($mon)
{
    static 
$month_name = array(
        
'--UNDEFINED--'
        
,'January'
        
,'February'
        
,'March'
        
,'April'
        
,'May'
        
,'June'
        
,'July'
        
,'August'
        
,'September'
        
,'October'
        
,'November'
        
,'December'
    
);
    return 
$month_name[$mon];
}

?>
<html>
<head><title>Calandar Chooser</title>
<link rel="stylesheet" href="chooser.css" type="text/css">
</head>
<body><center>

<?php
    $gc
=new DateChooser();
    
$gc->weekStartsOn("Monday");
    echo 
$gc->generateCalendar($yr$mon$day);
?>

<?php
    
if($day>0)
    {
        echo 
"<br><hr width=\"50%\"><br>";
        echo 
"Date Selected: <b>".monthName($mon).$day$yr</b><br>\n";
        echo 
"<br><hr width=\"50%\"><br>";
    }
?>
</center></body>
</html>