Professional Documents
Culture Documents
A Calendar Class For Classic ASP
A Calendar Class For Classic ASP
uk/show/3293/
<html>
<head>
<title>Calendar Control</title>
</head>
<body>
<div align="right">
<%
%>
</div>
</body>
</html>
<%
Class Calendar
Private cShowDate
Private cValue
Private cBorder
Private cMonth
Private cYear
Private arrMonths(12)
Private cFonts
Private cFontSize
Private cShowNav
Private cShowForm
cValue = Now
cMonth = Month(Now)
cYear = Year(Now)
cFonts = "Verdana"
cFontSize = 2
cShowNav = False
cShowForm = False
cShowDate = False
End Sub
End Sub
Case "back"
cYear = request("currYear")
If request("currMonth") < 1 Then
cMonth = 12
cYear = request("currYear") - 1
Else
cMonth = request("currMonth")
End If
Case "forward"
cYear = request("currYear")
If request("currMonth") > 12 Then
cMonth = 1
cYear = request("currYear") + 1
Else
cMonth = request("currMonth")
End If
Case "goto"
cMonth = request("currMonth")
If request("currYear") <> "" Then
cYear = Int(request("currYear"))
End IF
End Select
End If
Days = DaysInMonth()
If cBorder Then%>
<table border="0" cellpadding=0 bgcolor="#000000">
<tr><td bgcolor="#FFFFFF">
<%End If%>
<table border="0" cellspacing=1 cellpadding=1>
<tr>
<%Else%>
<td colspan="7"align="center" bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b><%=arrMonths(cMonth) & " " & cYear%></b></font></td>
<%End If%>
</tr>
<tr>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>S</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>M</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>T</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>W</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>Th</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>F</b></font></td>
<td align="center" width=25 bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%
=cFonts%>"><b>S</b></font></td>
</tr>
<tr>
<%i = 1
For j = 1 to cDay - 1%>
<td align="center" bgcolor="#999999"></td>
<%If i > 6 Then
response.write("</tr><tr>")
i = 0
End If
i = i + 1
Next
For j = 1 to Days%>
<td align="center" bgcolor="#999999"><font color="#000000" size=<%=cFontSize%> face="<%=cFonts%
>"><b><%=j%></b></font></td>
<%If i > 6 And j <= Days - 1 Then
response.write("</tr><tr>")
i = 0
End If
i = i + 1
Next
If i > 1 Then
For m = i to 7%>
<td align="center" bgcolor="#999999"></td>
<%Next
End IF%>
</tr>
</table>
<%If cBorder Then%>
</td></tr>
</table>
<%End If
If cShowForm Then BottomForm
End Sub
End Class
%>
e
DaysInMonth = 29
End If
Case Else
Exit Function
End Select
End Function
End Class
%>
PDF Generated by ABCpdf 5.0