|
|
|
This is a raw and simple example with only two clicks on the calendars (beginning and end)
You will get
$beg : start date.
$end : end date
$c1 unix time in second (start)
$c2 unix time in second (end)
So it's very simple to use those variables to select a range of records between a starting date and an ending date from a database.
This code has to be adapted for US date (if you are from the USA) and use some style sheet to improve the look 'n feel.
I'm planning to rewrite the code so that a single calendar will be used.
The use of this example is to quickly choose a range of dates to browse between events. For example, someone may what to get documents edited between a date and another in archives or someone may what to browse rapidly to choose a range to reserve a travel ticket.
Usage Example (test.php):
| <?
if( ! defined ("BZ_calendar") ) include "lib/BZ_calendar.inc";
if ( $time=='' ) $time = time();
if ( !isset ($c1 )) $c1 = $time ;
if ( !isset ($c2 )) $c2 = $time ;
if (!isset ( $beg ) ) $beg = date("Y-m-d", $time);
if (!isset ( $end ) ) $end = date("Y-m-d", $time);
if ( $cal == 1 && $c2 < $c1 ) $c2 = $c1 ;
if ( $cal == 2 && $c2 < $c1 ) $c1 = $c2 ;
$cal1= new BZ_calendar( 1 , $beg , $end ) ;
$cal2 = new BZ_calendar( 2 , $beg , $end ) ;
$cal1->draw("test.php" , $c1 ,$c2 );
$cal2->draw("test.php" , $c1 ,$c2 );
?> | |
sample
http://patricia.benedetto.free.fr/test.php?beg=2007-01-08&end=2007-01-19&cal=2&c2=1168260569&c1=1168260569
|
|
| enhanced date picker with jcript checking for a dynamic date input Categories : PHP, Java Script, Date Time, Calendar, Arrays | | | PHP Calendar Categories : PHP, Calendar, Date Time, Java Script, CSS | | | pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP, Date Time, Calendar, PHP Classes | | | 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 | | | Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP, Date Time, PHP Classes, Calendar | | | Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June). Categories : Calendar, Date Time, PHP | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | | | CALENDAR - easy calendar-navigation with PHP Categories : PHP, Date Time, HTML and PHP, Calendar | | | A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function. Categories : PHP, PHP Classes, Calendar, Date Time | | | This script contains 2 functions: 1 to create html select object based on your own customer date format entry- "M d Y h:i.... etc". The second function processes the select object on submit back to unix time. Categories : PHP, Calendar, Date Time, HTML and PHP | | | Javascript Date Picker Categories : Java Script, Date Time, Calendar | | | Shows the current time as a PNG-image. This script does not use the GD
library. You can use it as a benchmark (because it's slow), or as a quick
reference for implementing a simple PNG-file generator. Categories : Graphics, Zlib, Calendar, PHP, Date Time | | | Local Time clock and Server time usign PHP and JavaScript Categories : PHP, Java Script, Date Time, Beginner Guides | | | Calendar, Kalender, date, time, day, month, year Categories : PHP, Date Time, Calendar | | | Calendar class on the same page , suitable for reservation
Categories : PHP, Calendar, Date Time | |
| | | | Walter Torres wrote :1675
OK, nice idea, but I don`t think I want to use code off his web site each time I want to use this.
I full demo package would be nice
| |
|
|
|