current_year=date("Y"); $this->current_month=date("m"); $this->current_date=date("d"); $this->table_width='400'; $this->table_background='transparent'; $this->table_fontsize="12px"; $this->table_fontcolor='#000000'; } function show_calendar() { $weekdays[0]="Sunday"; $weekdays[1]="Monday"; $weekdays[2]="Tuesday"; $weekdays[3]="Wednesday"; $weekdays[4]="Thursday"; $weekdays[5]="Friday"; $weekdays[6]="Saturday"; echo ""; echo ""; echo ""; echo ""; echo ""; for($i=0;$i".$weekdays[$i].""; } echo ""; echo ""; $set_date=1; $week_day=0; while($set_date<=31) { if($week_day%7==0) { $week_day=0; echo ""; echo ""; } if($set_date==1 && ($week_day!=date("w",mktime(0,0,0,$this->current_month,$set_date,$this->current_year)))) { echo ""; } else { if(checkdate($this->current_month,$set_date,$this->current_year)) { if($set_date==$this->current_date) { echo ""; } else { break; } $set_date++; } $week_day++; } for($i=0;$week_day>0 && $i<=(6-$week_day);$i++) { echo ""; } echo ""; echo "
« ".$this->get_month($this->current_month).", ".$this->current_year." »
 "; echo "
".$set_date."
"; } else { echo "
"; echo "
".$set_date."
"; } echo $this->contents[$set_date]; echo "
 
"; } function set_valid_date($month,$date,$year) { $valid_date=date("Y-m-d",mktime(0,0,0,$month,$date,$year)); $arr_date=explode("-",$valid_date); $this->current_month=$arr_date[1]; $this->current_date=$arr_date[2]; $this->current_year=$arr_date[0]; } function get_month($month_number) { $month_number=intval($month_number); $months[1]="January"; $months[2]="February"; $months[3]="March"; $months[4]="April"; $months[5]="May"; $months[6]="June"; $months[7]="July"; $months[8]="August"; $months[9]="September"; $months[10]="October"; $months[11]="November"; $months[12]="December"; return $months[$month_number]; } } ?