?? calendar.asp
字號:
<%@ LANGUAGE="VBScript" %>
<%
Option Explicit
dim user
user=request("user")
Dim dtToday
dtToday = Date()
Dim dtCurViewMonth ' First day of the currently viewed month
Dim dtCurViewDay ' Current day of the currently viewed month
%>
<% REM This section defines functions to be used later on. %>
<% REM This sets the Previous Sunday and the Current Month %>
<%
'--------------------------------------------------
Function DtPrevSunday(ByVal dt)
Do While WeekDay(dt) > vbSunday
dt = DateAdd("d", -1, dt)
Loop
DtPrevSunday = dt
End Function
'--------------------------------------------------
%>
<%REM Set current view month from posted CURDATE, or
' the current date as appropriate.
' if posted from the form
' if prev button was hit on the form
If InStr(1, Request.Form, "subPrev", 1) > 0 Then
dtCurViewMonth = DateAdd("m", -1, Request.Form("CURDATE"))
' if next button was hit on the form
ElseIf InStr(1, Request.Form, "subNext", 1) > 0 Then
dtCurViewMonth = DateAdd("m", 1, Request.Form("CURDATE"))
' anyother time
Else
dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1)
End If
%>
<% REM --------BEGINNING OF DRAW CALENDAR SECTION-------- %>
<% REM This section executes the event query and draws a matching calendar. %>
<%
Dim iDay, iWeek, sFontColor
%>
<HTML>
<HEAD>
<title>·<%=user%>的日歷·</title>
<style>
BODY {scrollbar-track-color:#ffffff; SCROLLBAR-FACE-COLOR: #ffffff; FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #eeeeee; SCROLLBAR-3DLIGHT-COLOR: #eeeeee; SCROLLBAR-ARROW-COLOR: #dddddd; FONT-FAMILY: "Verdana"; SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
select{font-size:8pt;font-family:verdana;background-color:#ffffff;border:1px dotted #cccccc; color:#333333;}
input{font-size:8pt;font-family:verdana;background-color:#ffffff;border-bottom:1px solid #51bfe0;border-left:1px solid #51bfe0; border-top:0px solid #cccccc;border-right:0px dotted #cccccc;color:#333333;}
textarea{font-size:8pt; font-family:verdana;background-color:#ffffff;border:1px dotted #cccccc;color:#333333;letter-spacing : 1pt ;line-height : 150%}
A {
COLOR: #333333; TEXT-DECORATION: none ;border-bottom:1px dotted
}
A:hover {
COLOR: #333333; background-color:#C0FFFF;
}
td {FONT-SIZE: 9pt; FONT-FAMILY: "Verdana"; color:#3333333;letter-spacing : 1pt ;line-height : 150%}
.td{border:1px dotted #999999}
</style>
</HEAD>
<BODY leftmargin=10 topmargin=10 bgcolor="#FFFFFF">
<BR>
<CENTER>
<font face="Verdana" size="2">· <%=user%> 的 日 歷 ·</font>
<FORM NAME="fmNextPrev" ACTION="calendar.asp?user=<%=user%>" METHOD=POST>
<TABLE CELLPADDING=3 CELLSPACING=0 WIDTH="550" BORDER=2 BGCOLOR="#51bfe0" BORDERCOLORDARK="#51bfe0" BORDERCOLORLIGHT="#FFFFFF">
<TR VALIGN=MIDDLE ALIGN=CENTER>
<TD COLSPAN=7>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%" BORDER=0>
<TR VALIGN=MIDDLE ALIGN=CENTER>
<TD WIDTH="30%" ALIGN=RIGHT>
<INPUT TYPE=submit NAME="subPrev" value=" 上 月 ">
</TD>
<TD WIDTH="40%">
<FONT FACE="verdana" COLOR="#333333" size=2>
<B><%= Year(dtCurViewMonth)& "年" & MonthName(Month(dtCurViewMonth))%></B>
</FONT>
</TD>
<TD WIDTH="26%" ALIGN=LEFT>
<INPUT TYPE=submit NAME="subNext" value=" 下 月 ">
</TD>
<TD WIDTH="4%" ALIGN=LEFT> <a href="index.asp?user=<%=user%>"><img border="0" src="images/home.gif" alt="返回日記首頁" width="18" height="18"></a></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR VALIGN=TOP ALIGN=CENTER BGCOLOR="#003366">
<% For iDay = vbSunday To vbSaturday %>
<TH WIDTH="14%" bgcolor="#FFFFFF"><FONT FACE="Arial" SIZE="-2" COLOR="#333333"><%=WeekDayName(iDay)%></FONT></TH>
<%Next %>
</TR>
<%
dtCurViewDay = DtPrevSunday(dtCurViewMonth)
For iWeek = 0 To 5
Response.Write "<TR VALIGN=TOP>" & vbCrLf
For iDay = 0 To 6
Response.Write "<TD HEIGHT=25>"
If Month(dtCurViewDay) = Month(dtCurViewMonth) Then
If dtCurViewDay = dtToday Then
sFontColor = "#FF3300"
Else
sFontColor = "#000000"
End If
'---- Write day of month
Response.Write "<FONT FACE=""verdana"" SIZE=""2"" COLOR=""" & sFontColor & """><B>"
Response.Write Day(dtCurViewDay) & "</a></B></FONT>"
If dtCurViewDay <= dtToday Then
Response.Write " <a href='benri.asp?user="&user&"&n="
Response.Write Year(dtCurViewMonth)
Response.Write "&y="
Response.Write Month(dtCurViewMonth)
Response.Write "&r="
Response.Write Day(dtCurViewDay)
Response.Write "' title='查看本日的日記'>"
Response.Write "<img src=images/mess.gif border=0></a><BR>"
end if
'---Else
'---Response.Write "?
End If
Response.Write "</TD>" & vbCrLf
dtCurViewDay = DateAdd("d", 1, dtCurViewDay)
Next
Response.Write "</TR>" & vbCrLf
Next
%>
<%REM --------END OF DRAW CALENDAR SECTION-------- %>
</TABLE>
<INPUT TYPE=HIDDEN NAME="CURDATE" VALUE="<%=dtCurViewMonth%>">
</FORM>
</CENTER>
<NOSCRIPT><IFRAME SRC=calendar.asp></IFRAME></NOSCRIPT>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -