WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
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 Resources
Web Development Content
Internet Security Software
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
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

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 10 times)
Viewed : 19034
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  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");
}
}
?>



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
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
Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
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
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
Football News Aggregator
Categories : PHP, Object Oriented, PHP Classes, Rich Site Summary (RSS), HTML and PHP
Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used.
Categories : HTML and PHP, PHP, Date Time
enhanced date picker with jcript checking for a dynamic date input
Categories : PHP, Java Script, Date Time, Calendar, Arrays
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
Simple class to build tables with style sheets
Categories : HTML and PHP, PHP Classes, PHP
 chris sexton wrote :565
Not well commented, I do like it, jus gotta kno how to use it!