仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2680|回复: 18
打印 上一主题 下一主题

[学习教程] ASP网页编程之一个关于日期选择的很适用的小器材

[复制链接]
第二个灵魂 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-16 00:27:46 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
无法实现跨操作系统的应用。当然这也是微软的理由之一,只有这样才能发挥ASP最佳的能力。可是我却认为正是Windows限制了ASP,ASP的概念本就是为一个能让系统运行于一个大的多样化环境而设计的;日期选择   <%
'day.asp
%>
<html>
<head>
<title>选择日期                </title>
<style type=text/CSS>
<!--
body{margin:0;font-size:9pt;color:#5E639B}
td{font-size:9pt;color:#000000}
a:link {color:#000000;text-decoration: none}
a:visited {color:#000000;text-decoration: none}
a:active {color:#000000;text-decoration: none}
a:hover { color:#ff3333;text-decoration: none}
-->
</style>
<Script Language="JavaScript">
function getDay(v){
window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field")%>.value=v;
window.close();
return false;
}
</Script>
</head>
<body bgcolor=#ffffff onBlur="window.focus()">
<%
oldDate=request("oldDate")
if not isDate(oldDate) then oldDate=date
yy=year(cdate(oldDate))
mm=month(cdate(oldDate))
if request("yy")<>"" then yy=request("yy")
if request("mm")<>"" then mm=request("mm")
if yy="" then yy=year(date)
if mm="" then mm=month(date)
if mm>12 then mm=1:yy=yy+1
if mm<1 then mm=12:yy=yy-1

dim m(12)
m(1)=31
m(3)=31
m(5)=31
m(7)=31
m(8)=31
m(10)=31
m(12)=31
m(2)=28
m(4)=30
m(6)=30
m(9)=30
m(11)=30
if (yy mod 4=0 and yy mod 100<>0) or yy mod 400=0 then m(2)=29
mms=m(mm)
week1=(weekday(cdate(yy & "-" & mm & "-1"))-1)
%>
<table width=250 cellspacing=1 cellpadding=0 bgcolor=#FFDFDF align=center>
<tr>
<td colspan=7 align=center>
<table width=100% height=20 cellspacing=0 cellpadding=0>
<tr height=20>
<td width=30 align=center>
<a href=day.asp?form=<%=request("form")%>&field=<%=request("field")%>&yy=<%=(yy-1)%>&mm=<%=mm%>>
<font face=webdings style=color:#000000 title="上一年">7</font>
</a>
<td width=30 align=center>
<a href=day.asp?form=<%=request("form")%>&field=<%=request("field")%>&mm=<%=(mm-1)%>&yy=<%=yy%>>
<font face=webdings style=color:#000000 title="上一月">3</font>
</a>
<td width=130 align=center style="FONT:9pt Verdana,Geneva,sans-serif;color:#CD0101">
<b><%=yy%> 年   <%=mm%> 月</b>
<td width=30 align=center>
<a href=day.asp?form=<%=request("form")%>&field=<%=request("field")%>&mm=<%=(mm+1)%>&yy=<%=yy%>>
<font face=webdings style=color:#000000 title="下一月">4</font>
</a>
<td width=30 align=center>
<a href=day.asp?form=<%=request("form")%>&field=<%=request("field")%>&yy=<%=(yy+1)%>&mm=<%=mm%>>
<font face=webdings style=color:#000000 title="下一年">8</font>
</a>
</table>
<tr bgcolor=#ffffff height=20>
<td width=35 align=center bgcolor=#FFF4F4 style=color:#ff6633>日
<td width=35 align=center bgcolor=#FFF4F4>一
<td width=35 align=center bgcolor=#FFF4F4>二
<td width=35 align=center bgcolor=#FFF4F4>三
<td width=35 align=center bgcolor=#FFF4F4>四
<td width=35 align=center bgcolor=#FFF4F4>五
<td width=35 align=center bgcolor=#FFF4F4>六
<%
if week1<>0 then
response.write "<tr>"
for i=1 to week1
response.write "<td width=35 height=20 bgcolor=#ffffff> "
next
end if
for i=1 to mms
if (i+week1-1) mod 7=0 then response.write "<tr>"
response.write "<td width=35 height=20 align=center bgcolor=#ffffff>"
if cdate(yy & "-" & mm & "-" & i)=date() then
%>
<input type=button value=<%=i%>
style="BORDER:#CD0101 1px groove;width:30;heigh</p>  asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-11 16:58

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表