<html>
<head>
<title>calendar drop downs for dynamic content</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php /* i made this function for a website where i needed a lot of date entering
All the javascripts i found worked or half or didn' t allow me to 'select' the
drop downs with data from the database or weren't able to accept data from an
external source therefore...
Vandenplas fréderic, belgium, info AT conexxion DOT be
fill the arrays for the different months I still need a way to check if a date entered exists, but that is for later :)
*/
function select_dd ( $jaar , $maand , $dag ){
$arrays [ 1 ][ 1 ]= 1 ; $arrays [ 1 ][ 2 ]= 'jan' ; $arrays [ 1 ][ 3 ]= 31 ;
$arrays [ 2 ][ 1 ]= 2 ; $arrays [ 2 ][ 2 ]= 'feb' ; $arrays [ 2 ][ 3 ]= 28 ;
$arrays [ 3 ][ 1 ]= 3 ; $arrays [ 3 ][ 2 ]= 'mar' ; $arrays [ 3 ][ 3 ]= 31 ;
$arrays [ 4 ][ 1 ]= 4 ; $arrays [ 4 ][ 2 ]= 'apr' ; $arrays [ 4 ][ 3 ]= 30 ;
$arrays [ 5 ][ 1 ]= 5 ; $arrays [ 5 ][ 2 ]= 'mei' ; $arrays [ 5 ][ 3 ]= 31 ;
$arrays [ 6 ][ 1 ]= 6 ; $arrays [ 6 ][ 2 ]= 'jun' ; $arrays [ 6 ][ 3 ]= 30 ;
$arrays [ 7 ][ 1 ]= 7 ; $arrays [ 7 ][ 2 ]= 'jul' ; $arrays [ 7 ][ 3 ]= 31 ;
$arrays [ 8 ][ 1 ]= 8 ; $arrays [ 8 ][ 2 ]= 'aug' ; $arrays [ 8 ][ 3 ]= 31 ;
$arrays [ 9 ][ 1 ]= 9 ; $arrays [ 9 ][ 2 ]= 'sep' ; $arrays [ 9 ][ 3 ]= 30 ;
$arrays [ 10 ][ 1 ]= 10 ; $arrays [ 10 ][ 2 ]= 'okt' ; $arras [ 10 ][ 3 ]= 31 ;
$arrays [ 11 ][ 1 ]= 11 ; $arrays [ 11 ][ 2 ]= 'nov' ; $arrays [ 11 ][ 3 ]= 30 ;
$arrays [ 12 ][ 1 ]= 12 ; $arrays [ 12 ][ 2 ]= 'dec' ; $arrays [ 12 ][ 3 ]= 31 ;
$year [ 1 ]= 2005 ; $year [ 2 ]= 2006 ; $year [ 3 ]= 2007 ;
/* make the select boxes*/
echo '<select name="menu1" >' ;
for ( $x = 1 ; $x <= 12 ; $x = $x + 1 ){
echo '<option value="' . $arrays [ $x ][ 1 ]. '"' . ( $arrays [ $x ][ 1 ]== $maand ? "selected" : "" );
echo '>' . $arrays [ $x ][ 2 ]. '</option>' ;
}
echo '</select>' ;
echo '<select name="menu2" >' ;
for ( $x = 1 ; $x <= 31 ; $x = $x + 1 ){
echo '<option value="' . $x . '"' . ( $arrays [ $x ][ 1 ]== $dag ? "selected" : "" );
echo '>' . $x . '</option>' ;
}
echo '</select>' ;
echo '<select name="menu3" >' ;
for ( $x = 1 ; $x <= 3 ; $x = $x + 1 ){
echo '<option value="' . $year [ $x ]. '"' . ( $year [ $x ]== $jaar ? "selected" : "" );
echo '>' . $year [ $x ]. '</option>' ;
}
echo '</select>' ;
}
/* call the function with a date
or with 3 variables ( $year, $month, $day)
wich shoul come from elsewhere*/
echo select_dd ( 2006 , 3 , 7 );
?>
</body>
</html>
Open and Close your website in fixed times . Categories : PHP , PHP Classes , Cron , Date Time Website colour changer Categories : PHP , HTML and PHP , Date Time Bs_StopWatch is a class to measure time intervals in microseconds.
Categories : PHP , Date Time , PHP Classes mysql date/time converters Categories : PHP , MySQL , Databases , Date Time Local Time clock and Server time usign PHP and JavaScript Categories : PHP , Java Script , Date Time , Beginner Guides A PHP Script that shows how to use FTP to run a shell script, read two local files and update data in a database. Categories : PHP , Filesystem , FTP , Date Time , Databases A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed. Categories : Date Time , PHP , Complete Programs , Calendar Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays. Categories : Calendar , Date Time , PHP , Databases , MySQL This code consists of two parts, the first part is a .html file that uses a form to pass 3 date variables into day_of_week.php3 You input the mm/dd/yyyy of the day then
it prints what day of the week that day falls on. Categories : Date Time , PHP , Complete Programs Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP , Date Time , PHP Classes , Calendar Query Timer Categories : PHP , Databases , Date Time Simple PHP control CSS Calendar Categories : PHP , HTML and PHP , Calendar , Date Time , CSS Date Validation using JavaScript. Intended to use it as checkdate() from PHP. Categories : Java Script , Date Time , PHP Function to convert Arabic numbers into Roman Numerals Categories : Algorithms , PHP , Date Time Local-to-user date and time display regardless of time zone or where the website's server is located Categories : PHP , Date Time , HTML and PHP , Java Script