calendar.asp

来自「一个VB的p2p聊天系统」· ASP 代码 · 共 68 行

ASP
68
字号
<html>
<head>
<style>
td { font-family: "??"; font-size:9pt}
</style>
</head>
<body bgcolor="eeeeee" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
<table width="180" cellpadding="0" cellspacing="1" bgcolor="dddddd" align=center>
<%
If Trim(Request("ReqDate"))="" or ( not IsDate(Trim(Request("ReqDate"))) ) then
 CurrentDate=Date
else
 CurrentDate=Trim(Request("ReqDate"))
end if
PreviousMonthDate=DateAdd("m",-1,CurrentDate)
NextMonthDate=DateAdd("m",1,CurrentDate)
%>
  <tr align="LEFT" bgcolor="#dddddd"> 
    <td width="14%" height="19" align="center"><input type="button" value="<<" onclick="window.navigate('Calendar.asp?ReqDate=<%=PreviousMonthDate%>')"></td>
    <td colspan="5" align="center"><%=year(CurrentDate)&"年"&month(CurrentDate)&"月"%></td>
    <td width="14%" align="center"><input type="button" value=">>" onclick="window.navigate('Calendar.asp?ReqDate=<%=NextMonthDate%>');"></td>
  </tr>
  <tr align="LEFT" bgcolor="#CCCCCC"> 
    <td width="14%" height="19"> 日</td>
    <td width="14%"> 一</td>
    <td width="14%"> 二</td>
    <td width="14%"> 三</td>
    <td width="14%"> 四</td>
    <td width="14%"> 五</td>
    <td width="14%"> 六</td>
  </tr>
  <%
ym=year(CurrentDate)&"-"&month(CurrentDate)&"-"
i=1
do while i<33
 j=1
 response.write("<tr bgcolor=ffffff height=19>")
 do while j<8
  If IsDate(ym&i) then
   CurrentWeekDay=weekday(ym&i)
   if j=CurrentWeekDay then
    If Datediff("d",ym&i,now)>-1 then
     LinkText="<a href=http://www.happydu.com target=_blank>"&i&"</a>"
    else
     LinkText=i
    end if
    if i<>Day(now) then
     response.write("<td>&nbsp;"&LinkText&"</td>")
    else
     response.write("<td bgcolor=ffaaaa>&nbsp;"&LinkText&"</td>")    
    end if
    i=i+1
   else
    response.write("<td></td>")
   end if
  else
   response.write("<td></td>")
   i=i+1
   'exit do
  end if
  j=j+1
 loop
 response.write("</tr>") 
loop
%>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?