WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Calendars to choose a range of dates , reservation events ...
Categories : PHP, Calendar, Java Script, Date Time Click here to Update Your Picture
patricia benedetto
Date : Jan 08th 2007
Grade : 2 of 5 (graded 3 times)
Viewed : 10350
File : 4562.inc
Images : Image 1
Search : More code by patricia benedetto
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

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
table calendar pretty much does what cal(1) does - prints out a calendar.
Categories : Date Time, PHP, 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
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 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
Higly Customizable Javascript Calendar Script
Categories : Java Script, Calendar, Date Time, HTML, CSS
Date Validation using JavaScript. Intended to use it as checkdate() from PHP.
Categories : Java Script, Date Time, PHP
Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example.
Categories : PHP, Date Time, PHP Classes, Calendar
function to generate calendars on the fly.
Categories : Calendar, PHP, Date Time
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, 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
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
PHP Calendar Web App
Categories : PHP, Databases, MySQL, Date Time, Calendar
 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