⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mwdate.asp

📁 航空订票系统基于asp.net和sql2005包含数据库和图片
💻 ASP
字号:
<%@ Language=VBScript %>
<%Option Explicit%>
<%
	dim SelectedDate,curYear,curMonth
	dim toDate

	
	curYear = cint("0" & Request.QueryString("curYear"))
	curMonth = cint("0" & Request.QueryString("curMonth"))
	if curMonth > 12 then curMonth = 0
	if isdate(Request.QueryString("Date")) then 
		SelectedDate = cdate(Request.QueryString("Date")) 
	else 
		SelectedDate = null
	end if
	toDate = cdate(Year(now()) & "-" & Month(now()) & "-" & day(now()))
	if curYear = 0 or curMonth=0 then 
		if isnull(SelectedDate) then
			curYear = Year(toDate)
			curMonth = Month(toDate)
		else
			curYear = Year(SelectedDate)
			curMonth = Month(SelectedDate)
		end if
	end if
%>
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="../../css/Normal.css">
<SCRIPT LANGUAGE=javascript>
<!--
	var curYear = <%=curYear%>;
	var curMonth = <%=curMonth%>;
	var selectedDate = "<%=selectedDate%>";
	var toDate =  "<%=toDate%>";

	function NextMonth(){
		curMonth++;
		if(curMonth>12){
			curMonth = 1;
			curYear++;
		}
		document.all.year.value = curYear;    
		document.all.month.value = curMonth;    
		RefreshTable();
	}

	function PrevMonth(){
		curMonth--;
		if(curMonth<1){
			curMonth = 12;
			curYear--;
		}
		document.all.year.value = curYear;    
		document.all.month.value = curMonth;    
		RefreshTable();
	}
	
	function SelectChange(){
		curYear =  parseInt(document.all.year.value);    
		curMonth = parseInt(document.all.month.value);    
		RefreshTable();
	}
	
	function OK(n){
		window.returnValue = curYear+"-"+ (curMonth+n)  + "-" + window.event.srcElement.innerText;
		window.close();
	}

	function clear(){
		window.returnValue = "Cancel";
		window.close();
	}
	
//-->
</SCRIPT>
<SCRIPT LANGUAGE=vbs>
<!--
	function RefreshTable()
		dim html 
		dim row,col,idate
		toDate = CDate(toDate)
		if selectedDate <> "" then selectedDate = CDate(selectedDate)
		html = "<table id=datetable border=1 bordercolordark=white cellspacing=0 cellpadding=3 width=210>"
		html = html & "<tr align=center bgcolor=#EEEEEE>"
		html = html & "<td width=14% style=""color:red;font-weight:bold;font-size:9pt"">日</td>"
		html = html & "<td width=14% style=""font-weight:bold;font-size:9pt"">一</td>"
		html = html & "<td width=14% style=""font-weight:bold;font-size:9pt"">二</td>"
		html = html & "<td width=14% style=""font-weight:bold;font-size:9pt"">三</td>"
		html = html & "<td width=14% style=""font-weight:bold;font-size:9pt"">四</td>"
		html = html & "<td width=14% style=""font-weight:bold;font-size:9pt"">五</td>"
		html = html & "<td width=14% style=""color:red;font-weight:bold;font-size:9pt"">六</td>"
		html = html & "</tr>"
		iDate = cdate(curYear & "-" & curMonth & "-1")
		iDate = iDate - Weekday(iDate) + 1
		for row=1 to 6
			html = html &  "<tr align=middle>"
			for col=1 to 7 
				html = html &  "<td style=""font-family:Verdana;font-size:9pt"""
				html = html &  "onmouseover=""window.event.srcElement.style.background='#DDDDDD';"""
				html = html &  "onmouseout=""window.event.srcElement.style.background='white';"""
				if SelectedDate = iDate then
					html = html &  " onclick=""OK(0)"" style=""cursor:hand;font-weight:bold"""
				else 
					if month(idate) <> curMonth then
						if Month(idate) < curMonth then
							html = html &  " onclick=""OK(-1)"" style=""cursor:hand;color=gray;"""
						else
							html = html &  " onclick=""OK(1)""  style=""cursor:hand;color=gray;"""
						end if
					else
						if  idate = toDate then 
							html = html &  " onclick=""OK(0)"" style=""cursor:hand;color:red;font-weight:bold"""
						else
							if weekday(idate) = 1 or  weekday(idate) = 7 then
								html = html &  " onclick=""OK(0)"" style=""color:red;cursor:hand;"""
							else
								html = html &  " onclick=""OK(0)"" style=""cursor:hand;"""
							end if
						end if
					end if
				end if
				 html = html &  ">" & day(iDate) & "</td>"
				iDate = iDate + 1
			next
			html = html &  "</tr>"
			if Month(iDate) > curMonth then exit for
		next
		
		html = html & "</table>"
		document.all.datetable.outerHTML = html  
	end function
-->
</SCRIPT>

<title>日历</title>
 <Script Language="JavaScript" src="global/Script/CheckForm.js"></Script><Script Language="JavaScript" src="global/Script/AdminFunc.js"></script></head>
<BODY scroll=no>
<table border=1 bordercolordark=white cellspacing=0 cellpadding=3 width=210>
	<tr bgcolor=#CCCCCC>
		<td colspan=7 align=center nowrap>
		<a onclick="PrevMonth()" style="cursor:hand;color:blue"><u>&lt;&lt;</u></a>
		<%ShowYear curYear%>年<%ShowMonth curMonth%>月
		<a onclick="NextMonth()" style="cursor:hand;color:blue"><u>&gt;&gt;</u></a>
		</td>
	</tr>
</table>
<table id=datetable border=1 bordercolordark=white cellspacing=0 cellpadding=3 width=210>
	<thead>
	<tr align=center bgcolor=#EEEEEE>
		<td width=14% style="color:red;font-weight:bold;font-size:9pt">日</td>
		<td width=14% style="font-weight:bold;font-size:9pt">一</td>
		<td width=14% style="font-weight:bold;font-size:9pt">二</td>
		<td width=14% style="font-weight:bold;font-size:9pt">三</td>
		<td width=14% style="font-weight:bold;font-size:9pt">四</td>
		<td width=14% style="font-weight:bold;font-size:9pt">五</td>
		<td width=14% style="color:red;font-weight:bold;font-size:9pt">六</td>
	</tr>
	</thead>
	<tbody>
<%
	dim row,col,iDate
	iDate = cdate(curYear & "-" & curMonth & "-1")
	iDate = iDate - Weekday(iDate) + 1
	for row=1 to 6
		Response.Write "<tr align=middle>"
		for col=1 to 7 
			Response.Write "<td style=""font-family:Verdana;font-size:9pt"" "
			Response.Write "onmouseover=""window.event.srcElement.style.background='#DDDDDD';"""
			Response.Write "onmouseout=""window.event.srcElement.style.background='white';"""
			if SelectedDate = iDate then
				Response.Write " onclick=""OK(0)"" style=""color:blue;cursor:hand;font-weight:bold"""
			else 
				if month(idate) <> curMonth then
					if Month(idate) < curMonth then
						Response.Write " onclick=""OK(-1)"" style=""cursor:hand;color=gray;"""
					else
						Response.Write " onclick=""OK(1)""  style=""cursor:hand;color=gray;"""
					end if
				else
					if  idate = toDate then 
						Response.Write " onclick=""OK(0)"" style=""cursor:hand;color:red;font-weight:bold"""
					else
						if weekday(idate) = 1 or  weekday(idate) = 7 then
							Response.Write " onclick=""OK(0)"" style=""color:red;cursor:hand;"""
						else
							Response.Write " onclick=""OK(0)"" style=""cursor:hand;"""
						end if
					end if
				end if
			end if
			 Response.Write ">" & day(iDate) & "</td>"
			iDate = iDate + 1
		next
		Response.Write "</tr>"
		if Month(iDate) > curMonth then exit for
	next
%>
</tbody>
</table>
<p align=center>
	<input type=button value=" 清 空 " onclick="window.clear()" id=button1 name=button1>
	<input type=button value=" 关 闭 " onclick="window.close()" id=button2 name=button2>	
</p>
</BODY>
</HTML>

<%
	function ShowYear(nYear)
		dim i
		Response.Write "<select style=""font-family:Arial;"" id=year onchange=""SelectChange()"">"
		for i=1901 to 2099
			Response.Write "<option value=" & i & ""
			if nYear = i then Response.Write " selected"
			Response.Write ">" & i & "</option>"
		next
		Response.Write "</select>"
	end function

	function ShowMonth(nMonth)
		dim i
		Response.Write "<select style=""font-family:Arial;"" id=month  onchange=""SelectChange()"">"
		for i=1 to 12
			Response.Write "<option value=" & i & ""
			if nMonth = i then Response.Write " selected"
			Response.Write ">" & i & "</option>"
		next
		Response.Write "</select>"
	end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -