{
$nums
=
$this
->_dayofweek+1;
for
(
$i
=1;
$i
<=
$this
->_dayofweek;
$i
++){
//输出 1
号之前的空白日期
$this
->_table.="<td> </td>";
}
for
(
$i
=1;
$i
<=
$this
->_days;
$i
++){
//
输出天数信息
if
(
$nums
%7==0){
//换行处理:7
个一行
$this
->_table.="<td>$i</td></tr><tr>";
}
else
{
$this
->_table.="<td>$i</td>";
}
$nums
++;
}
$this
->_table.="</tbody></table>";
$this
->_table.="<h3><a href='?y=".(
$this
->_year)."&m=".(
$this
->_month-1)."'>上一月</a> ";
$this
->_table.="<a href='?y=".(
$this
->_year)."&m=".(
$this
->_month+1)."'>下一月</a></h3>";
}
/**
*
输出日历
*/
public
function
showCalendar()
{
$this
->_showTitle();
$this
->_showDate();
echo
$this
->_table;
}
}
$calc
=
new
Calendar();
$calc
->showCalendar();