请给我一个可用的日历,单机的时候可以选定日期
如提 问题点数:0、回复次数:4Top
1 楼raoguofeng(蓝色幻想)回复于 2003-09-04 11:39:43 得分 0
<INPUT readonly onclick="showin()" name="DBAdd_gogodate" size="20" value style="width: 300; height: 19">
<%
dim serveryear,servermonth,serverday
serveryear=year(date())
servermonth=month(date())
serverday=day(date())
%>
<DIV id="showcalendar" style="position: absolute ; display: none" align="left">
<OBJECT classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendarme" codebase="OBJ/MSCAL.OCX" width="300" height="148" border="0" align="left">
<PARAM name="_Version" value="524288">
<PARAM name="_ExtentX" value="7938">
<PARAM name="_ExtentY" value="3916">
<PARAM name="_StockProps" value="1">
<PARAM name="BackColor" value="12632256">
<PARAM name="Year" value="<%response.write(serveryear)%>">
<PARAM name="Month" value="<%response.write(servermonth)%>">
<PARAM name="Day" value="<%response.write(serverday)%>">
<PARAM name="DayLength" value="1">
<PARAM name="MonthLength" value="0">
<PARAM name="DayFontColor" value="32768">
<PARAM name="FirstDay" value="1">
<PARAM name="GridCellEffect" value="1">
<PARAM name="GridFontColor" value="16711680">
<PARAM name="GridLinesColor" value="0">
<PARAM name="ShowDateSelectors" value="-1">
<PARAM name="ShowDays" value="-1">
<PARAM name="ShowHorizontalGrid" value="0">
<PARAM name="ShowTitle" value="-1">
<PARAM name="ShowVerticalGrid" value="0">
<PARAM name="TitleFontColor" value="10485760">
<PARAM name="ValueIsNull" value="0">
</OBJECT>
</DIV>
看懂了吗???呵呵Top
2 楼zjzsjm(奇玉)回复于 2003-09-04 11:48:05 得分 0
<%@ Language=VBScript %>
<%myyear=Request.Item("myyear")
mymonth=Request.Item("mymonth")%>
<html>
<head>
<META name=VI60_defaultClientScript content=VBScript>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub mymonth_onchange
form1.action="qdqt.asp?myyear="&form1.myyear.value&"&mymonth="&form1.mymonth.value
form1.submit()
End Sub
Sub myyear_onchange
form1.action="qdqt.asp?myyear="&form1.myyear.value&"&mymonth="&form1.mymonth.value
form1.submit()
End Sub
-->
</SCRIPT>
</head>
<body bgcolor="#E2F1FF">
<form name="form1" id="form1" method="post" >
<table>
<tr><th>签到查询</th></tr>
</table>
<table>
请选择月份:
<SELECT id="myyear" name="myyear">
<%for myi=1900 to 2050%>
<OPTION value="<%=myi%>"><%=myi%></OPTION>
<%next%>
</SELECT>年
<SELECT id="mymonth" name="mymonth">
<%for myi=1 to 12%>
<OPTION value="<%=myi%>"><%=myi%></OPTION>
<%next%>
</SELECT>月
</table>
<center>
<TABLE id="mytable">
<TR>
<TD>
<P align=center>星期日</P></TD>
<TD>
<P align=center>星期一</P></TD>
<TD>
<P align=center>星期二</P></TD>
<TD>
<P align=center>星期三</P></TD>
<TD>
<P align=center>星期四</P></TD>
<TD>
<P align=center>星期五</P></TD>
<TD>
<P align=center>星期六</P></TD>
</TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD> </TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD></TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD></TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD></TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD></TR>
<TR><TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD></TR>
</TABLE>
<%call bgbottom()%>
</center>
<SCRIPT LANGUAGE=javascript>
<!--
function openqd(mydate)
{
if (getlen(mydate)==1)
{
mydate="0"+mydate
}
if(getlen(form1.mymonth.value)==1)
{
mymonth="0"+form1.mymonth.value
}
else
{
mymonth=form1.mymonth.value
}
mytime=form1.myyear.value+mymonth+mydate
form1.action="qdqt_run.asp?unit="+form1.accessdept.value+"&man="+form1.accessman.value+"&mydate="+mytime
form1.target="qdqt_run"
form1.submit()
parent.SwitchFrame("qdqt_run")
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=vbscript>
<!--
if "<%=myyear%>"<>"" then
form1.myyear.value="<%=myyear%>"
else
form1.myyear.value="<%=year(date)%>"
end if
if "<%=mymonth%>"<>"" then
form1.mymonth.value="<%=mymonth%>"
else
form1.mymonth.value="<%=month(date)%>"
end if
function getlen(mystr)
getlen=len(mystr)
end function
if "<%=myyear%>"="" and "<%=mymonth%>"="" then
mydate=year(date)&"-"&month(date)&"-1"
else
mydate="<%=myyear%>-<%=mymonth%>-1"
end if
mymonth=month(mydate)
if mymonth=1 or mymonth=3 or mymonth=5 or mymonth=7 or mymonth=8 or mymonth=10 or mymonth=12 then
daynum=31
elseif mymonth=4 or mymonth=6 or mymonth=9 or mymonth=11 then
daynum=30
elseif mymonth=2 then
if year(mydate) mod 4=0 then
daynum=29
else
daynum=28
end if
end if
select case Weekday(mydate)
case 1'星期日
myrow=1
mycol=0
case 2'星期一
myrow=1
mycol=1
case 3'星期二
myrow=1
mycol=2
case 4'星期三
myrow=1
mycol=3
case 5'星期四
myrow=1
mycol=4
case 6'星期五
myrow=1
mycol=5
case 7'星期六
myrow=1
mycol=6
end select
mynum=1
dim i,j
for i=1 to 6'行循环
if i=1 then
for j=mycol to 6
if cint(mynum)>cint(day(date)) then
if cstr(form1.myyear.value&"-"&form1.mymonth.value&"-"&mynum)=cstr(date) then
mytable.rows(i).cells(j).innerHTML="<font style='color:red'><b>"&mynum&"</b></font>"
else
mytable.rows(i).cells(j).innerHTML="<font style='color:#0000ff'><b>"&mynum&"</b></font>"
end if
else
if cstr(form1.myyear.value&"-"&form1.mymonth.value&"-"&mynum)=cstr(date) then
mytable.rows(i).cells(j).innerHTML="<font style='cursor:hand;color:red' onclick='javascript:openqd("&mynum&")'><b>"&mynum&"</b></font>"
else
mytable.rows(i).cells(j).innerHTML="<font style='cursor:hand;color:#0000ff' onclick='javascript:openqd("&mynum&")'><b>"&mynum&"</b></font>"
end if
end if
mynum=mynum+1
next
else
for j=0 to 6
if cint(mynum)>cint(day(date)) then
if cstr(form1.myyear.value&"-"&form1.mymonth.value&"-"&mynum)=cstr(date) then
mytable.rows(i).cells(j).innerHTML="<font style='color:red;'><b>"&mynum&"</b></font>"
else
mytable.rows(i).cells(j).innerHTML="<font style='color:#0000ff'><b>"&mynum&"</b></font>"
end if
else
if cstr(form1.myyear.value&"-"&form1.mymonth.value&"-"&mynum)=cstr(date) then
mytable.rows(i).cells(j).innerHTML="<font style='cursor:hand;color:red;' onclick='javascript:openqd("&mynum&")'><b>"&mynum&"</b></font>"
else
mytable.rows(i).cells(j).innerHTML="<font style='cursor:hand;color:#0000ff' onclick='javascript:openqd("&mynum&")'><b>"&mynum&"</b></font>"
end if
end if
mynum=mynum+1
if mynum>daynum then
exit for
end if
next
end if
if mynum>daynum then
exit for
end if
next
-->
</SCRIPT>
</FORM>
</BODY>
</HTML>
Top
3 楼esri(df)回复于 2003-09-04 14:27:46 得分 0
谁有梅花雨的?Top
4 楼superdullwolf(超级大笨狼,每天要自强,MVP)回复于 2004-01-19 03:43:33 得分 0
http://www.adr.gov.cn/download/ddd.htm
http://www.adr.gov.cn/download/ccc.htm
此外送给大家一个VBS版本的日历
VBS版本外表样式一样的:
<table border = 0 cellpadding = 0 cellspacing = 0>
<tr>
<td>
<table border = 0 cellpadding = 0 cellspacing = 0 width = 60 height = 70 style = 'position:absolute ;visibility:hidden' bgcolor = #FFFFE7>
<tr>
<td align = center>
<font style = 'cursor:hand ;color:#FF0000 ;font-family:宋体 ;font-size:14pt ;line-height:120%' > </font>
</td>
</tr>
<tr>
<td align = center>
<font style ='cursor:hand ;color:#2000FF ;font-family:宋体 ;font-size:9pt ;line-height:110%'> </font>
</td>
</tr>
</table>
<table border = 0 cellpadding = 0 cellspacing = 0 width = 61 bgcolor = #D6D3CE height = 70>
<tr>
<td valign = top width = 100% height = 100%>
<table border = 1 cellpadding = 0 cellspacing = 0 width = 58 bgcolor = #FFFFE7 height = 67>
<tr>
<td align = center width = 100% height = 100%>
<font id = C1 style = "font-family:宋体; font-size:7pt; line-height:120%"> </font></br>
<font id = C2 style = "color:#FF0000; font-family:Arial ;font-size:14pt ;line-height:120%"> </font></br>
<font id = C3 style = "font-family:宋体 ;font-size:9pt ;line-height:120%"> </font></br>
<font id = C4 style = "color:#100080 ;font-family:宋体; font-size:8pt ;line-height:120%"> </font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<SCRIPT language=vbs>
function YM() '年月
YM = "<font color = #3A6EA5>"
if Weekday(date) = 0 then YM = "<font color = #C00000>"
if Weekday(date) = 6 then YM = "<font color = #00C000>"
YM= YM & Year(date) & "年" & Month(date) & "月</font>"
end function
function DD() '日
DD= "<font color = #FF0000>"
if Weekday(date)=0 then DD = "<font color = #C00000>"
if Weekday(date)=6 then DD = "<font color = #00C000>"
DD= DD & day(date) & "</font>"
end function
function HMS() '时分秒
HMS=Hour(Now) & ":"
dim mm:mm=Minute(Now)
dim ss:ss=Second(Now)
if mm<10 then HMS=HMS & "0" & mm else HMS=HMS & mm
if ss<10 then HMS=HMS & "0" & ss else HMS=HMS & ss
end function
function WW() '星期
WW= "<font color = #0000DF>"
Dim w:w=Weekday(date)
if w = 0 then WW = "<font color = #C00000>"
if w = 6 then WW = "<font color = #00C000>"
WW= WW & WeekDayName(w,true) & "</font>"
end function
sub CCC() '刷新时间
C1.innerHTML = YM()
C2.innerHTML = DD()
C3.innerHTML = WW()
C4.innerHTML = HMS()
end sub
CCC
window.setInterval "CCC", "1000" ,"vbs"
</SCRIPT>
个人认为VBS比JS的代码易读,短小,功能方便
我用JS只为了改别人的垃圾代码,如果自己开发,首选VBS
JS版本对照:
<SCRIPT language=javascript>
<!--
function Year_Month()
{
var now = new Date();
var yyyy = now.getYear();
var mmmm = now.getMonth() + 1;
var cl = '<font color = "#3A6EA5">';
if ( now.getDay() == 0 )
cl = '<font color = "#C00000">';
if ( now.getDay() == 6 )
cl = '<font color = "#00C000">';
return( cl + yyyy + '年' + mmmm + '月</font>' );
}
function Date_of_Today()
{
var now = new Date();
var cl = '<font color = "#FF0000">';
if ( now.getDay() == 0 )
cl = '<font color = "#C00000">';
if ( now.getDay() == 6 )
cl = '<font color = "#00C000">';
return( cl + now.getDate() + '</font>' );
}
function CurentTime()
{
var now = new Date();
var hh = now.getHours();
var mm = now.getMinutes();
var ss = now.getTime() % 60000;
ss = ( ss - ( ss % 1000 ) ) / 1000;
var clock = hh + ':';
if( mm < 10 )
clock += '0';
clock += mm + ':';
if( ss < 10 )
clock += '0';
clock += ss;
return( clock );
}
function Day_of_Today()
{
var day = new Array();
day[0] = "星期日";
day[1] = "星期一";
day[2] = "星期二";
day[3] = "星期三";
day[4] = "星期四";
day[5] = "星期五";
day[6] = "星期六";
var now = new Date();
var cl = '<font color = "#0000DF">';
if ( now.getDay() == 0 )
cl = '<font color = "#C00000">';
if ( now.getDay() == 6 )
cl = '<font color = "#00C000">';
return( cl + day[ now.getDay() ] + '</font>' );
}
function refreshCalendarClock()
{
document.all.calendarClock1.innerHTML = Year_Month();
document.all.calendarClock2.innerHTML = Date_of_Today();
document.all.calendarClock3.innerHTML = Day_of_Today();
document.all.calendarClock4.innerHTML = CurentTime();
}
var
webUrl = webUrl;
document.write( '<table border = "0" cellpadding = "0" cellspacing = "0"><tr><td>' );
document.write( '<table id = "CalendarClockFreeCode" border = "0" cellpadding = "0" cellspacing = "0" width = "60" height = "70" style = "position:absolute; visibility:hidden" bgcolor = "#FFFFE7">' );
document.write( '<tr><td align = "center"><font style = "cursor:hand; color:#FF0000; font-family:宋体; font-size:14pt; line-height:120%"' );
if( webUrl != 'netflower' )
{
document.write( '</td></tr><tr><td align = "center"><font style = "cursor:hand; color:#2000FF; font-family:宋体; font-size:9pt; line-height:110%"' );
}
document.write( '</td></tr></table>' );
document.write( '<table border = "0" cellpadding = "0" cellspacing = "0" width = "61" bgcolor = "#D6D3CE" height = "70">' );
document.write( '<tr><td valign = "top" width = "100%" height = "100%">' );
document.write( '<table border = "1" cellpadding = "0" cellspacing = "0" width = "58" bgcolor = "#FFFFE7" height = "67">' );
document.write( '<tr><td align = "center" width = "100%" height = "100%">' );
document.write( '<font id = "calendarClock1" style = "font-family:宋体; font-size:7pt; line-height:120%"></font><br/>' );
document.write( '<font id = "calendarClock2" style = "color:#FF0000; font-family:Arial; font-size:14pt; line-height:120%"></font><br/>' );
document.write( '<font id = "calendarClock3" style = "font-family:宋体; font-size:9pt; line-height:120%"></font><br/>' );
document.write( '<font id = "calendarClock4" style = "color:#100080; font-family:宋体; font-size:8pt; line-height:120%"></font>' );
document.write( '</td></tr></table>' );
document.write( '</td></tr></table>' );
document.write( '</td></tr></table>' );
refreshCalendarClock();
setInterval( 'refreshCalendarClock()', 1000);
-->
</SCRIPT>
Top



