<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'/
'PowerB="微秒工作室" '----公司名称
'SysName="日历"
'PowerBW="http://blog.csdn.net/fjp813"
'PowerW="http://blog.csdn.net/fjp813"
'PowerM="黑闪" ' 设计者
'PowerE="fjp813@hotmail.com"
'时间:2005-07-25
'
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>日历</title>
<style rel='stylesheet' type='text/css'>
body, td
{
color: #444444;
font-family: Tahoma;
font-size: 12px;
line-height: 11pt;
letter-spacing: 0px;
}
a:link, a:visited, a:active
{
text-decoration:none;
color: #266DBD;
}
a:hover
{
text-decoration:none;
color: #ff6600;
}
.thismonth
{
color: #f00;
}
.nullcell
{
background: #fafafa;
}
.style1 {color: #FFFFFF}
.style3 {color: #FFFFFF; font-weight: bold; }
</style>
<script language='javascript'>
function clk(date,objName)
{
parent.document.getElementById(objName).value = date;
parent.document.getElementById(objName + '_calendar').style.display = 'none';
}
function over(obj)
{
obj.style.backgroundColor = '#f3f3f3';
obj.style.color = '#ff6600';
}
function out(obj)
{
obj.style.backgroundColor = '';
obj.style.color = '';
}
</script>
</head>
<body>
<%
Y=DatePart("yyyy",Date)
M=DatePart("m",Date)
W=DatePart("w",Date)
url = "calendarASP.asp?"
if Request("year") <> "" then
Y = Request("year")
end if
if Request("month") <> "" then
M = Request("month")
end if
beginday=Y&"-"&M&"-"&"1"
if M>11 then
endday=Y+1&"-1-1"
else
endday=Y&"-"&M+1&"-"&"1"
end if
W=DatePart("w",beginday)
Monthdays=DateDiff("d", beginday, endday)
'Response.Write(Date)
'Response.Write("<br>")
'Response.Write(beginday)
'Response.Write("<br>")
'Response.Write(Y&"-"&M+1&"-"&"1")
'Response.Write("<br>")
'Response.Write(DateDiff("d", Y&"-"&M&"-"&"1", Y&"-"&M+1&"-"&"1"))
'Response.Write(y&m)
%>
<form name="form1" method="post" action="calendarASP.asp">
<TABLE width=600 cellPadding=2
cellSpacing=1 bgColor=white
style="BORDER-RIGHT: #468ddd 1px solid; BORDER-TOP: #468ddd 1px solid; BORDER-LEFT: #468ddd 1px solid; BORDER-BOTTOM: #468ddd 1px solid">
<tr>
<td><TABLE width=100% height="30" align=center cellPadding=0 cellSpacing=1>
<TR align="center" bgColor=#468ddd>
<TD width="16"><span class="style1"><FONT
face=webdings><a href="<%=(url&"year="&Y-1&"&month="&M)%>">3</a></FONT> </span></TD>
<TD width="42" ><span class="style1">year</span></TD>
<TD width="16"><span class="style1"><font
face=webdings><a href="<%=(url&"year="&Y+1&"&month="&M)%>">4</a></font></span></TD>
<TD width="137" ><span class="style3"><%=Y&" . "&M%></span></TD>
<TD width="16"><span class="style1"><font
face=webdings>
<%
if M<=1 then
Response.Write("<a href="&url&"year="&Y-1&"&month=12>3</a>")
else
Response.Write("<a href="&url&"year="&Y&"&month="&M-1&">3</a>")
end if
%>
</font></span></TD>
<TD width="42"><span class="style1">month</span></TD>
<TD width="16"><span class="style1"><FONT
face=webdings>
<%
if M>11 then
Response.Write("<a href="&url&"year="&Y+1&"&month=1>4</a>")
else
Response.Write("<a href="&url&"year="&Y&"&month="&M+1&">4</a>")
end if
%>
</FONT></span></TD>
<TD align="right" bgcolor="#78ACE7"><span class="style1">
<select name="month" id="month" >
<%for i=1 to 12 %>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>
month
<select name="year" id="year" >
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
</select>
year</span></TD>
<TD width="65" bgcolor="#78ACE7" style="cursor:hand;border-width:1px 1px 2px 1px" onClick="writedatenext()"><span style="color: #FFFFFF">
<input type="submit" name="Submit" value=" GO ">
</span></TD>
</TR>
</TABLE></td>
</tr>
<tr>
<td valign="top"><TABLE width=100% height="100%" border=1 align=center
cellPadding=2 cellSpacing=0 borderColor=#f6f6f6 style="BORDER-COLLAPSE: collapse">
<tr align="center" bgColor=#e9e9e9>
<td width="100" height="30">Sunday</td>
<td width="100" height="30" >Monday</td>
<td width="100" height="30" >Tuesday</td>
<td width="100" height="30" >Wednesday</td>
<td width="100" height="30">Thursday</td>
<td width="100" height="30">Friday</td>
<td width="100" height="30" >Saturday</td>
</tr>
<%
D=1
for i=1 to 6
%>
<tr align="center">
<%
for j=1 to 7
if j<W and i=1 or D>Monthdays then
%>
<td height ='60' class='nullcell' > </td>
<%
else
%>
<td height ='60' style='cursor:hand' οnmοuseοver=over(this) οnmοuseοut=out(this)
<%if Y=DatePart("yyyy",Date) and M=DatePart("m",Date) and D=DatePart("d",Date) then
response.Write("style=""background:url('images/calendar_today.gif') center no-repeat""")
end if
%>
><%=(D)%></td>
<%
D=D+1
end if
next
%>
</tr>
<%
next
%>
</table>
</tr>
</table>
</form>
</body>
</html>