📄 monthlycal.asp
字号:
<!--#include file="displaysmallworkrec.asp"-->
<%
sub monthlycal(suid,superior)
oabusysuid=request.cookies("oabusysuid")
'取得当前年月的1日日期
thismonthfirday=myyear & "-" & mymonth & "-1"
'取得下个月1日的日期
nextmonthfirday=dateadd("m",1,thismonthfirday)
'取得当前月的天数
totaldays=DateDiff("d",thismonthfirday,nextmonthfirday)
'取得取得本月1日的星期数
firdayweek=weekday(thismonthfirday)
%>
<center>
<table border=1 width=95%>
<tr bgcolor="#cecece">
<td align=center>星期日</td>
<td align=center>星期一</td>
<td align=center>星期二</td>
<td align=center>星期三</td>
<td align=center>星期四</td>
<td align=center>星期五</td>
<td align=center>星期六</td>
</tr>
<%
'本月第一天处理
for i=1 to 7
if firdayweek=i then
string1="<tr>"
'日历月初的空位处理
j=1
do while j<i
string1=string1 & "<td> </td>"
j=j+1
loop
'周六周日背景为深色
if firdayweek=1 or firdayweek=7 then
string1=string1 & "<td align=center bgcolor='#cccccc'>" & displaysmallworkrec(thismonthfirday,suid,superior) & "</td>"
else
string1=string1 & "<td align=center>" & displaysmallworkrec(thismonthfirday,suid,superior) & "</td>"
end if
end if
next
'本月第一天是周六的话
if firdayweek=7 then string1=string1 & "</tr>"
'显示本月第一天
response.write string1
'本月第二天到本月倒数第二天
for i=2 to totaldays-1
if weekday(myyear & "-" & mymonth & "-" & i)=1 then response.write "<tr><td align=center bgcolor='#cccccc'>" & displaysmallworkrec(myyear & "-" & mymonth & "-" & i,suid,superior) & "</td>"
if weekday(myyear & "-" & mymonth & "-" & i)=7 then response.write "<td align=center bgcolor='#cccccc'>" & displaysmallworkrec(myyear & "-" & mymonth & "-" & i,suid,superior) & "</td></tr>"
if weekday(myyear & "-" & mymonth & "-" & i)<>7 and weekday(myyear & "-" & mymonth & "-" & i)<>1 then response.write "<td align=center>" & displaysmallworkrec(myyear & "-" & mymonth & "-" & i,suid,superior) & "</td>"
next
'本月最后一天处理
for i=1 to 7
if weekday(myyear & "-" & mymonth & "-" & totaldays)=i then
if weekday(myyear & "-" & mymonth & "-" & totaldays)=1 or weekday(myyear & "-" & mymonth & "-" & totaldays)=7 then
string2="<td align=center bgcolor='#cccccc'>" & displaysmallworkrec(myyear & "-" & mymonth & "-" & totaldays,suid,superior) & "</td>"
else
string2="<td align=center>" & displaysmallworkrec(myyear & "-" & mymonth & "-" & totaldays,suid,superior) & "</td>"
end if
'日历月未的空位处理
j=7
do while j>i
string2=string2 & "<td> </td>"
j=j-1
loop
string2=string2 & "</tr>"
end if
next
if weekday(myyear & "-" & mymonth & "-" & totaldays)=1 then string2="<tr>" & string2 & "</tr>"
response.write string2
%>
</table>
</center>
<br>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -