寧몸PHP휑저넋埼

2018-09-07 14:27

阅读:257

  <?php
//<-------뇹잿繫법GET렘랬瓊슥돨긴좆;역迦-------->
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];
//<-------뇹잿繫법GET렘랬瓊슥돨긴좆;써監-------->
if($year<1971)
{
echo놔댄!;
echo<BR>;
echo<ahref=$HTTP_SERVER_VARS[PHP_SELF]>Back</a>;
exit();
}
?>
<tablewidth=200border=1cellspacing=0cellpadding=0bordercolor=#E7E7E7style=font-size:12px;align=center>
<tralign=center><tdcolspan=2>
<?php
//<-------뎠墩룀낚놔1逞12珂돨뇹잿;역迦------->
if($month<1)
{
$month=12;
$year-=1;
}
if($month>12)
{
$month=1;
$year+=1;
}
//<-------뎠墩룀낚놔1逞12珂돨뇹잿;써監------->
//***************************************
//<---------?菊뼛?苟寧쾨,?鞫?苟墩돨젯쌈뇹잿섟渴놔;역迦--------->
echo<ahref=$HTTP_SERVER_VARS[PHP_SELF]?year=.($year-1).&month=.$month.><<</a>쾨<ahref=$HTTP_SERVER_VARS[PHP_SELF]?year=.($year+1).&month=.$month.>>></a>;
?>
</td><tdcolspan=3><?phpecho$year.쾨.$month.墩;?>
</td><tdcolspan=2>
<?php
echo<ahref=$HTTP_SERVER_VARS[PHP_SELF]?month=.($month-1).&year=.$year.><<</a>墩<ahref=$HTTP_SERVER_VARS[PHP_SELF]?month=.($month+1).&year=.$year.>>></a>;
//<--------?菊뼛?苟寧쾨,?鞫?苟墩돨젯쌈뇹잿섟渴놔;써監--------->
?></td></tr>
<tralign=center><td><fontcolor=red>휑</font></td><td>寧</td><td>랗</td><td>힛</td><td>愷</td><td>巧</td><td>짇</td></tr><tr>
<?php
$d=date(d);
$FirstDay=date(w,mktime(0,0,0,$month,1,$year));//혤돤훨부寧몸墩돨寧뵀角槿퍅섯,痰黨셕炬寧뵀角譚깊목돨뒤섯목역迦
$bgtoday=date(d);
functionfont_color($month,$today,$year)//痰黨셕炬槿퍅莖돨俚竟奈??nbsp;
{
$sunday=date(w,mktime(0,0,0,$month,$today,$year));
if($sunday==0)
{
$FontColor=red;
}
else
{
$FontColor=black;
}
return$FontColor;
}
functionbgcolor($month,$bgtoday,$today_i,$year)//痰黨셕炬뎠휑돨교쒼奈??nbsp;
{
$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;
}
functionfont_style($month,$today,$year)//痰黨셕炬槿퍅莖돨俚竟루목
{
$sunday=date(w,mktime(0,0,0,$month,$today,$year));
if($sunday==0)
{
$FontStyle=<strong>;
}
else
{
$FontStyle=;
}
return$FontStyle;
}
for($i=0;$i<=$FirstDay;$i++)//늪for痰黨渴놔캐몸墩돨寧뵀貫零
{
for($i;$i<$FirstDay;$i++)
{
echo<tdalign=center></td>\n;
}
if($i==$FirstDay)
{
echo<tdalign=center.bgcolor($month,$bgtoday,1,$year).><fontcolor=.font_color($month,1,$year).>.font_style($month,1,$year).1</font></td>\n;
if($FirstDay==6)//털뙤1뵀角뤠槿퍅짇
{
echo</tr>;
}
}
}
$countMonth=date(t,mktime(0,0,0,$month,1,$year));//캐墩돨悧莖鑒
for($i=2;$i<=$countMonth;$i++)//渴놔譚1뵀땍貫,踞빈2뵀殮逞墩棺돨杰唐뵀鑒
{
echo<tdalign=center.bgcolor($month,$bgtoday,$i,$year).><fontcolor=.font_color($month,$i,$year).>.font_style($month,$i,$year).$i</font></td>\n;
if(date(w,mktime(0,0,0,$month,$i,$year))==6)//털뙤맡휑角뤠槿퍅짇
{
echo</tr>\n;
}
}
?>
</table>


评论


亲,登录后才可以留言!