PHP Classes

File: example3.php

Recommend this page to a friend!
  Classes of Nigel Johnson   Date Chooser   example3.php   Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: example (same as 1) without stylesheets
Class: Date Chooser
Outputs a calendar to let the user choose a date
Author: By
Last change:
Date: 20 years ago
Size: 819 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>
</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>