PHP Classes

File: ecustom_picker.php

Recommend this page to a friend!
  Classes of Evgeny  >  DatePicker  >  ecustom_picker.php  >  Download  
File: ecustom_picker.php
Role: Example script
Content type: text/plain
Description: example
Class: DatePicker
Generation of date chooser form fields
Author: By
Last change:
Date: 18 years ago
Size: 1,639 bytes
 

Contents

Class file image Download
<?php
require('lib/date_picker.php');
function
show_values($a) {
    if(
$a) {
        echo
"<pre>"; print_r($a); echo "</pre>";
    }
   
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Untitled</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <style type="text/css">
    <!--
    select{
        background-color : #FFFFF0;
        font-size : 10px;
    }
    -->
    </style>
</head>

<body>
<h3>Custom picker:</h3>
<form action="" method="get" name="special_name" id="my_form">

<?php
$date
= new DatePicker();
echo
$date->js(); // js function
$date->setFormName('special_name'); // set form name
$date->setFormMethod($_GET); // set form method

/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de = setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
$date->setLang($loc_de); // set lang to germany

$date->setSelectName('date_from');
echo
$date->day(1, 'none', '___'); // select tag with days, and empty tag

$date->setMonthRange(array(1,5,8)); // set month range january, may, august
echo $date->month(); // select tag with mohth

$date->setYearRange(2005, 2000); // set year range from 2000 till 2005
echo $date->year(); // select tag with years

$date->setCustomName('hour');
$date->setCustomRange(array('15:00' => '15:00', '19:00' => '19:00'));
echo
$date->custom(1, 'none', '____'); // select tag with hours, and empty tag


show_values($_GET); // print_r $_GET if any;
?>

<br><br>
<input type="submit">
</form>
<hr size="2" noshade>
</body>
</html>

For more information send a message to info at phpclasses dot org.