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 : Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar Update Picture
Thijs Hendriks
Date : Feb 15th 2001
Grade : 3 of 5 (graded 9 times)
Viewed : 14896
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Thijs Hendriks
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?
class calendar {
var

$daynamefont,$daynamebgcolor,$daynamecolor,$daynamesize,$daynamebold,$daynameitalic
,
$dayfont,$daybgcolor,$daycolor,$dayactivecolor,$daysize,$daybold,$dayitalic,
$showdate,$bordersize,$timestamp;

function calendar(){
if(empty($this->daynamefont)==true)$this->daynamefont="Arial, sans-serif";
if(empty($this->daynamebgcolor)==true)$this->daynamebgcolor="#000060";
if(empty($this->daynamecolor)==true)$this->daynamecolor="#FFFFFF";
if(empty($this->daynamesize)==true)$this->daynamesize="3";
if(empty($this->daynamebold)==true)$this->daynamebold=true;
if(empty($this->daynameitalic)==true)$this->daynameitalic=false;
if(empty($this->dayfont)==true)$this->dayfont="Arial, sans-serif";
if(empty($this->daybgcolor)==true)$this->daybgcolor="#FFCA00";
if(empty($this->daycolor)==true)$this->daycolor="#000000";
if(empty($this->dayactivecolor)==true)$this->dayactivecolor="#FF0000";
if(empty($this->daysize)==true)$this->daysize="3";
if(empty($this->daybold)==true)$this->daybold=true;
if(empty($this->dayitalic)==true)$this->dayitalic=false;
if(empty($this->showdate)==true)$this->showdate=true;
if(empty($this->bordersize)==true)$this->bordersize="2";
if(empty($this->timestamp)==true)$this->timestamp=time();
}

function show(){
$day=date("j",$this->timestamp);
$month=date("n",$this->timestamp);
$year=date("Y",$this->timestamp);
if($this->daynamebold==true){
$daynametextprefix="<b>";
$daynametextsuffix="</b>";
}
if($this->daynameitalic==true){
$daynametextprefix.="<i>";
$daynametextsuffix="</i>".$daynametextsuffix;
}
if($this->daybold==true){
$daytextprefix="<b>";
$daytextsuffix="</b>";
}
if($this->dayitalic==true){
$daytextprefix.="<i>";
$daytextsuffix="</i>".$daytextsuffix;
}
if(checkdate($month,$day,$year)==true){
$maxdays=31;
while(checkdate($month,$maxdays,$year)==false)$maxdays--;
$startday=1-date("w",mktime(0,0,0,$month,1,$year));
print("<table border='".$this->bordersize."' cellspacing='0' cellpadding='0'><tr
bgcolor='".$this->daybgcolor."'><td>\n");
print(" <table border='0' cellspacing='0' cellpadding='2'>\n");
if($this->showdate==true)print(" <tr bgcolor='".$this->daynamebgcolor."'><td
colspan='7'><font face='".$this->daynamefont."' color='".$this->daynamecolor."' size='".$this-
>daynamesize."'><div align='center'>".$daynametextprefix.date("F",mktime
(0,0,0,$month,$day,$year))." $year".$daynametextsuffix."</div></font></td></tr>\n");
print(" <tr bgcolor='".$this->daynamebgcolor."'><td align='center'><font face='".$this-
>daynamefont."' color='".$this->daynamecolor."' size='".$this-
>daynamesize."'>".$daynametextprefix." S ".$daynametextsuffix."</font></td><td
align='center'><font face='".$this->daynamefont."' color='".$this->daynamecolor."'
size='".$this->daynamesize."'>".$daynametextprefix."
M ".$daynametextsuffix."</font></td><td align='center'><font face='".$this->daynamefont."'
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
T ".$daynametextsuffix."</font></td><td align='center'><font face='".$this->daynamefont."'
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
W ".$daynametextsuffix."</font></td><td align='center'><font face='".$this->daynamefont."'
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
T ".$daynametextsuffix."</font></td><td align='center'><font face='".$this->daynamefont."'
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
F ".$daynametextsuffix."</font></td><td align='center'><font face='".$this->daynamefont."'
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
S ".$daynametextsuffix."</font></td>");
$weekdaycount=0;
for($daycount=$startday;$daycount<=$maxdays;$daycount++){
if(($weekdaycount%7)==0)print("</tr>\n <tr bgcolor='".$this->daybgcolor."'>");
if($daycount>0){
print("<td align='right'>");
if($daycount!=$day){
print("<font face='".$this->dayfont."' color='".$this->daycolor."' size='".$this-
>daysize."'>".$daytextprefix." ".$daycount." ".$daytextsuffix."</font>");
} else print("<font face='".$this->dayfont."' color='".$this->dayactivecolor."'
size='".$this->daysize."'>".$daytextprefix." ".$daycount." ".$daytextsuffix."</font>");
} else print("<td>");
print("</td>");
$weekdaycount++;
}
while($weekdaycount%7<>0){
print("<td></td>");
$weekdaycount++;
}
print("</tr>\n </table>\n");
print("</td></tr></table>\n");
} else print("Incorrect date");
}
}
?>



Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, 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 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
Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example.
Categories : PHP, Date Time, PHP Classes, Calendar
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
Calendar using Date function
Categories : HTML and PHP, PHP, Date Time, Calendar
CALENDAR - easy calendar-navigation with PHP
Categories : PHP, Date Time, HTML and PHP, Calendar
Open and Close your website in fixed times .
Categories : PHP, PHP Classes, Cron, Date Time
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
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
Dynamic Calendar in PHP, Javascript and HTML.
Categories : PHP, Java Script, HTML and PHP, Calendar
A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP
How To Create a PDF Using PHP
Categories : PHP, PDF, PHP Classes, HTML and PHP
A time measuring and performance benchmarking class
Categories : PHP, PHP Classes, Testing, Debugging, Date Time
Class to build a select tag in html, useful to build select boxes from a data base
Categories : PHP, HTML and PHP, PHP Classes
 chris sexton wrote :565
Not well commented, I do like it, jus gotta kno how to use it!