📄 day.asp
字号:
<!--#include file="Connections.asp" -->
<!--#include file="top.asp" -->
<%cpbtitle="论坛日历"
call toptitle(l_title,cpbtitle)
call head(4,"论坛信息",Request.ServerVariables("HTTP_REFERER"),cpbtitle)%>
<%
dtoday =year(nowtime)&"-"&month(nowtime)&"-"&day(nowtime)'获得当天日期
'用一个函数来计算日期所在的星期,默认将每个月的第一天跟所在星期相比较
Function jscurday(Byval dt)
dtt=WeekDay(dt)-1
if dtt>0 then
dt = DateAdd("d", -dtt, dt)
end if
jscurday = dt
End Function
%>
<%if h_viewcpb=1 and isuser=false then response.redirect("login.asp")
month1=request("month")
year1=request("year")
if year1<>"" and month1<>"" then
viewmonth = DateSerial(year1, month1, 1)
else
viewmonth = DateSerial(Year(dtoday), Month(dtoday), 1)
End If
%>
<CENTER>
<table border=1 borderColor=<%=tdc2%> cellPadding=1 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse" align=center>
<TR VALIGN=MIDDLE ALIGN=CENTER>
<TD COLSPAN=7>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%" BORDER=0>
<TR VALIGN=MIDDLE ALIGN=CENTER>
<TD WIDTH="100%" <%=hcolor%> height=23>
<B>
<FONT class=tdc1>
<%=MonthName(Month(viewmonth)) & " " & Year(viewmonth)%>
</FONT>
</B>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR VALIGN=middle ALIGN=CENTER>
<% '写出星期
For i = 1 To 7 %>
<Td WIDTH="14%" <%=tcolor%> height=20 class=tdc1><%=WeekDayName(i)%></Td>
<%Next %>
</TR>
<%
curday = jscurday(viewmonth)
For itr = 0 To 5'分成6行
Response.Write "<TR VALIGN=TOP>"
For itd = 0 To 6'分成7列
If Month(curday) = Month(viewmonth) Then
If year(curday)&month(curday)&day(curday) = year(dtoday)&month(dtoday)&day(dtoday) Then
bgcolor = tcolor1
Else
bgcolor = tcolor2
End If
'在表格中写入此月的每一天,如果是当前天,则用不同的背景色表示出来
Response.Write "<TD HEIGHT=25 align=left bgcolor="&bgcolor&" class=tdc>"
Response.Write "<B>"
Response.Write Day(curday) & "</B><BR>"
'读出生日
sql="select username,h_birder from user where month(h_birder)="&month(curday)&" and day(h_birder)="&day(curday)
set rs=conn.execute(sql)
do while not rs.Eof
hyear=DateDiff("yyyy",rs("h_birder"),nowtime)
response.write("<a href=""viewuser.asp?username="&rs("username")&""" target=_blank title=今天是"""&rs("username")&"""的"&hyear&"岁生日>"&_
rs("username")&"</a> 的生日("&hyear&") <br>")
rs.movenext
loop
else
Response.Write "<TD HEIGHT=25 align=center bgcolor=#F0F8FF>"
Response.Write(" ")
End If
Response.Write "</TD>"
curday = DateAdd("d", 1, curday)
Next
Response.Write "</Tr>"
next
set rs=nothing
%>
</TABLE>
<%'计算上月
premonth = DateAdd("m", -1, viewmonth)
preyear=year(premonth)
premmonth=month(premonth)
prenmonth=monthname(premmonth)
'计算下月
nextmonth = DateAdd("m", 1, viewmonth)
nextyear=year(nextmonth)
nextmmonth=month(nextmonth)
nextnmonth=monthname(nextmmonth)%>
<table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse" height=25>
<form action="day.asp" method="post">
<tr>
<td bgcolor="<%=tcolor1%>" align="center" class=tdc width=20%><a href=day.asp?year=<%=preyear%>&month=<%=premmonth%> title=查看上个月><%=prenmonth%> <%=preyear%></a></td>
<td bgcolor="<%=tcolor2%>" align="center" class=tdc>
<select name="month" class=bdtj3>
<option value="<%=month(dtoday)%>"><%=monthName(month(dtoday))%></option>
<option value="1">一月</option>
<option value="2">二月</option>
<option value="3">三月</option>
<option value="4">四月</option>
<option value="5">五月</option>
<option value="6">六月</option>
<option value="7">七月</option>
<option value="8">八月</option>
<option value="9">九月</option>
<option value="10">十月</option>
<option value="11">十一月</option>
<option value="12">十二月</option>
</select>
<select name="year" class=bdtj3>
<option value="<%=year(dtoday)%>"><%=year(dtoday)%>年</option>
<option value="2000">2000年</option>
<option value="2001">2001年</option>
<option value="2002">2002年</option>
<option value="2003">2003年</option>
<option value="2004">2004年</option>
</select> <input type="submit" value="提 交" name="go" class=bdtj></td>
<td bgcolor="<%=tcolor1%>" align="center" class=tdc width=20%><a href=day.asp?year=<%=nextyear%>&month=<%=nextmmonth%> title=查看下个月><%=nextnmonth%> <%=nextyear%></a></td>
</tr>
</form>
</table>
</CENTER>
<!--#include file="bq.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -