📄 selectday.asp
字号:
<%
Dim i,day1,day2,day3,month1,month2,month3,year1,year2,year3
Dim TempDate1,TempDate2,TempDate3
'如果是第一次查询,就取当前日期前一天、前两天、前三天作为默认时间
If Session("dYear1") = "" Then
TempDate1 = DateAdd("d",-1,Date)
TempDate2 = DateAdd("d",-2,Date)
TempDate3 = DateAdd("d",-3,Date)
day1 = Day(TempDate1)
day2 = Day(TempDate2)
day3 = Day(TempDate3)
month1 = Month(TempDate1)
month2 = Month(TempDate2)
month3 = Month(TempDate3)
year1 = Year(TempDate1)
year2 = Year(TempDate2)
year3 = Year(TempDate3)
Else '如果不是第一次查询,则取上一次选择的日期为默认日期
day1 = CInt(Session("dDay1"))
day2 = CInt(Session("dDay2"))
day3 = CInt(Session("dDay3"))
month1 = CInt(Session("dMonth1"))
month2 = CInt(Session("dMonth2"))
month3 = CInt(Session("dMonth3"))
year1 = CInt(Session("dYear1"))
year2 = CInt(Session("dYear2"))
year3 = CInt(Session("dYear3"))
End If
%>
<form method="POST" action="DayPower.asp" target="Bottom">
<table border="0" cellpadding="0" cellspacing="0" width="630" align="center">
<tr>
<td width="50%" align="center" height="30">第一个日期:
<select size="1" name="Year1">
<%
For i = 2000 to 2010
If i = year1 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>年
<select size="1" name="Month1">
<%
For i = 1 to 12
If i = month1 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>月
<select size="1" name="Day1">
<%
For i = 1 to 31
If i = day1 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>日
</td>
<td width="50%" height="30" align="right">第二个日期:
<select size="1" name="Year2">
<%
For i = 2000 to 2010
If i = year2 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>年
<select size="1" name="Month2">
<%
For i = 1 to 12
If i = month2 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>月
<select size="1" name="Day2">
<%
For i = 1 to 31
If i = day2 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>日
</td>
</tr>
<tr>
<td width="50%" align="center" height="30">第三个日期:
<select size="1" name="Year3">
<%
For i = 2000 to 2010
If i = year3 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>年
<select size="1" name="Month3">
<%
For i = 1 to 12
If i = month3 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>月
<select size="1" name="Day3">
<%
For i = 1 to 31
If i = day3 Then
Response.Write "<option selected>"&i&"</option>"
Else
Response.Write "<option>"&i&"</option>"
End If
Next
%>
</select>日
</td>
<td width="50%" align="right" height="30">
<input type="submit" value="确认查询" name="B1">
<input type="reset" value="重置日期" name="B2">
</td>
</tr>
</table>
<input type="hidden" name="type" value="<%=Session("rtype")%>"></input>
<input type="hidden" name="name" value="<%=Session("rname")%>"></input>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -