//
if($HTTP_GET_VARS[year]=="")
{
$HTTP_GET_VARS[year]=date("Y");
}
if($HTTP_GET_VARS[month]=="")
{
$HTTP_GET_VARS[month]=date("n");
}
$month=$HTTP_GET_VARS[month];
$year=$HTTP_GET_VARS[year];
//
if($year{
echo "出错!";
echo "
";
echo "Back";
exit();
}
?>
";
}
else
{
$Font;
}
return $FontStyle;
}
for($i=0;$i{
for($i;$i {
echo "
\n";
}
if($i==$FirstDay)
{
echo "
\n";
if($FirstDay==6)//判断1号是否星期六
{
echo "
// if($month{ $month=12; $year-=1; } if($month>12) { $month=1; $year+=1; } // //*************************************** // echo "年>>"; ?>
|
|
echo "月>>"; // ?> |
日 |
一 |
二 |
三 |
四 |
五 |
六 |
$d=date("d");$FirstDay=date("w",mktime(0,0,0,$month,1,$year));//取得任何一个月的一号是星期几,用于计算一号是由表格的第几格开始$bgtoday=date("d");function font_color($month,$today,$year)//用于计算星期天的字体颜色{$sunday=date("w",mktime(0,0,0,$month,$today,$year));if($sunday=="0"){$FontColor="red";}else{$FontColor="black";}return $FontColor;}function bgcolor($month,$bgtoday,$today_i,$year)//用于计算当日的背景颜色{$show_today=date("d",mktime(0,0,0,$month,$today_i,$year));$sys_today=date("d",mktime(0,0,0,$month,$bgtoday,$year));if($show_today==$sys_today){$bgcolor="bgcolor=#6699FF";}else{$bgcolor="";}return $bgcolor;}function font_style($month,$today,$year)//用于计算星期天的字体风格{$sunday=date("w",mktime(0,0,0,$month,$today,$year));if($sunday=="0"){$FontStyle="
|
".font_style($month,1,$year)."1 |
";}}}$countMonth=date("t",mktime(0,0,0,$month,1,$year));//某月的总天数for($i=2;$i{echo "
".font_style($month,$i,$year)."$i | \n";if(date("w",mktime(0,0,0,$month,$i,$year))==6)//判断该日是否星期六{echo "\n";}}?>
http://www.bkjia.com/PHPjc/317347.html
www.bkjia.com
true
http://www.bkjia.com/PHPjc/317347.html
TechArticle
?php //-------处理通过GET方法提交的变量;开始-------- if($HTTP_GET_VARS[year]=="") { $HTTP_GET_VARS[year]=date("Y"); } if($HTTP_GET_VARS[month]=="") { $HTTP_GET_VARS[mon...