PHP Classes
Icontem

File: DateDDLGenerator_Example.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ellery Leung  >  Date Drop Down List Generator  >  DateDDLGenerator_Example.php  
File: DateDDLGenerator_Example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Date Drop Down List Generator
Generate HTML form select inputs to pick dates
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Untitled Document</title>
</head>

<body>
<?php
include("DateDDLGenerator.class.php");
$ddl = new DateDDLGenerator;

#Normal use
print "Normal use:<br/><br/>";
print 
"The function of genYearDDL(): ";     $ddl->genYearDDL();
print 
"<br/>";
print 
"The function of genMonthDDL(): ";     $ddl->genMonthDDL();
print 
"<br/>";
print 
"The function of genDayDDL(): ";         $ddl->genDayDDL();
print 
"<br/>";

print 
"<p>---------------------------------------------------------------------------------</p>";

#Set the drop down list to current date:
$ddl_now = new DateDDLGenerator;
$ddl_now->setToCurrentDay();
print 
"Set the drop down list to current date - using setToCurrentDay()<br/><br/>";
print 
"The function of genYearDDL() - with current date: ";     $ddl_now->genYearDDL();
print 
"<br/>";
print 
"The function of genMonthDDL() - with current date: ";     $ddl_now->genMonthDDL();
print 
"<br/>";
print 
"The function of genDayDDL() - with current date: ";         $ddl_now->genDayDDL();
print 
"<br/>";

print 
"<p>---------------------------------------------------------------------------------</p>";

#Set the name of drop down list - you need to view the source of this file to see the effect:
$ddl_name_Change = new DateDDLGenerator;
$ddl_name_Change->setToCurrentDay();
print 
"Set the drop down list to another name - using setToCurrentDay()<br/><br/>";
print 
"The function of genYearDDL(\"NewYear\") - with current date: ";         $ddl_name_Change->genYearDDL("NewYear");
print 
"<br/>";
print 
"The function of genMonthDDL(\"NewMonth\") - with current date: ";     $ddl_name_Change->genMonthDDL("NewMonth");
print 
"<br/>";
print 
"The function of genDayDDL(\"NewDay\") - with current date: ";         $ddl_name_Change->genDayDDL("NewDay");
print 
"<br/>";

?>
</body>
</html>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products