Date Time Php

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("bgcolor='".$this->daybgcolor."'>
\n");
print(" \n");
if($this->showdate==true)print(" \n");
print(" ");
$weekdaycount=0;
for($daycount=$startday;$daycount<=$maxdays;$daycount++){
if(($weekdaycount%7)==0)print("\n ");
if($daycount>0){
print("");
$weekdaycount++;
}
while($weekdaycount%7<>0){
print("");
$weekdaycount++;
}
print("\n
colspan='7'>
".$daynametextprefix.date("F",mktime
(0,0,0,$month,$day,$year))." $year".$daynametextsuffix."
".$daynametextprefix." S ".$daynametextsuffix."align='center'>size='".$this->daynamesize."'>".$daynametextprefix."
M ".$daynametextsuffix."
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
T ".$daynametextsuffix."
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
W ".$daynametextsuffix."
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
T ".$daynametextsuffix."
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
F ".$daynametextsuffix."
color='".$this->daynamecolor."' size='".$this->daynamesize."'>".$daynametextprefix."
S ".$daynametextsuffix."
");
if($daycount!=$day){
print("".$daytextprefix." ".$daycount." ".$daytextsuffix."");
} else print("size='".$this->daysize."'>".$daytextprefix." ".$daycount." ".$daytextsuffix."");
} else print("
");
print("
\n");
print("
\n");
} else print("Incorrect date");
}
}
?>