⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calendar2.asp

📁 一个极好的学生日记管理程序
💻 ASP
字号:
<%@ LANGUAGE="VBScript" %>
<%
Option Explicit

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>日记本本的日历</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 #cccccc;border-left:1px solid #cccccc; 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">
<div align="center"><img src="images/title.gif" width="197" height="58"><BR>
</div>
<CENTER>
       <FORM NAME="fmNextPrev" ACTION="calendar.asp" METHOD=POST>
       
    <TABLE CELLPADDING=2 CELLSPACING=0 WIDTH="550" BORDER=1 BORDERCOLORDARK="#CCFF00" 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="#003366" 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"><img border="0" src="images/home.gif" alt="返回日记首页" width="25" height="20"></a> 
              </TD>
                </TR>
             </TABLE>
             </TD>
          </TR>

          <TR VALIGN=TOP ALIGN=CENTER >

          <% 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><a href style='cursor:hand;' onClick=""window.open('riji.asp?n="
            Response.Write Year(dtCurViewMonth)
            Response.Write "&y="
            Response.Write Month(dtCurViewMonth)
            Response.Write "&r="
            Response.Write Day(dtCurViewDay)
            Response.Write "','riji','scrollbars=no,resizable=yes,width=400,height=300')"" title='查看本日的日记'> "
            Response.Write Day(dtCurViewDay) & "</a></B></FONT>"

	If dtCurViewDay <= dtToday Then
            Response.Write " <FONT FACE=""verdana"" SIZE=""2"" COLOR=""" & sFontColor & """><B><a href='benri.asp?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></B></FONT><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=calendar2.asp></IFRAME></NOSCRIPT>
</BODY>
</HTML>

⌨️ 快捷键说明

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