naviHref = htmlentities($_SERVER['PHP_SELF']); } /** * print out the calendar */ public function show() { $year = null; $month = null; if(null==$year&&isset($_GET['years'])){ $year = intval( $_GET['years'] ); }else if(null==$year){ $year = date("Y",time()); } if(null==$month&&isset($_GET['month'])){ $month = intval( $_GET['month'] ); }else if(null==$month){ $month = date("m",time()); } $this->currentYear=$year; $this->currentMonth=$month; $this->daysInMonth=$this->_daysInMonth($month,$year); $this->holidays = AppointmentSw::getHolidays( $month, $year ); $content = '
'; return $content; } /********************* PRIVATE **********************/ /** * create the li element for ul */ private function _showDay($cellNumber){ if($this->currentDay==0){ $firstDayOfTheWeek = date('N',strtotime($this->currentYear.'-'.$this->currentMonth.'-01')); if(intval($cellNumber) == intval($firstDayOfTheWeek)){ $this->currentDay=1; } } if( ($this->currentDay!=0)&&($this->currentDay<=$this->daysInMonth) ){ $this->currentDate = date('Y-m-d',strtotime($this->currentYear.'-'.$this->currentMonth.'-'.($this->currentDay))); $cellContent = $this->currentDay; $this->currentDay++; }else{ $this->currentDate =null; $cellContent=null; } $output = ""; $output .= '