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="";
$daynametextsuffix="";
}
if($this->daynameitalic==true){
$daynametextprefix.="";
$daynametextsuffix="".$daynametextsuffix;
}
if($this->daybold==true){
$daytextprefix="";
$daytextsuffix="";
}
if($this->dayitalic==true){
$daytextprefix.="";
$daytextsuffix="".$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("
\n");
print(" \n");
if($this->showdate==true)print(" ".$daynametextprefix.date("F",mktime
(0,0,0,$month,$day,$year))." $year".$daynametextsuffix." | \n");
print(" ".$daynametextprefix." S ".$daynametextsuffix." | ".$daynametextprefix."
M ".$daynametextsuffix." | ".$daynametextprefix."
T ".$daynametextsuffix." | ".$daynametextprefix."
W ".$daynametextsuffix." | ".$daynametextprefix."
T ".$daynametextsuffix." | ".$daynametextprefix."
F ".$daynametextsuffix." | ".$daynametextprefix."
S ".$daynametextsuffix." | ");
$weekdaycount=0;
for($daycount=$startday;$daycount<=$maxdays;$daycount++){
if(($weekdaycount%7)==0)print(" \n ");
if($daycount>0){
print("");
if($daycount!=$day){
print("".$daytextprefix." ".$daycount." ".$daytextsuffix."");
} else print("".$daytextprefix." ".$daycount." ".$daytextsuffix."");
} else print(" | ");
print(" | ");
$weekdaycount++;
}
while($weekdaycount%7<>0){
print(" | ");
$weekdaycount++;
}
print(" \n \n");
print(" |
\n");
} else print("Incorrect date");
}
}
?>