zoukankan      html  css  js  c++  java
  • 自己写的asp日历控件

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>日历</title>
    </head>
    
    <body>
    <%
    	Function CountDays(iMonth,iYear)
    	select case iMonth
    		case 1,3,5,7,8,10,12
    		 CountDays=31
    		 case 2
    		 if isdate("2/29" & iYear) then
    		 	CuntDays=29
    		 else
    		 	CountDays=28
    		  End if
    		  case 4,6,9,11
    		  	CountDays=30		 
    	End Select
    	end function
    	
    	function FirstDay(iMonth,iYear)
    		FirstDay=weekday(iMonth&"/1/"& iYear)
    	End Function
    	
    	
    	dim mMonth,mYear
    	 
    	if request.QueryString.count>0 and request.QueryString("month")<> "" then
    	
    		mMonth=request.QueryString("month")
    		mYear=request.QueryString("year")
    		if mMonth=0 then
    			 mYear=int(mYear)-1
    			 mMonth=12
    		elseif mMonth>12 then
    			mYear=int(mYear)+1
    			 mMonth=1
    		End If
    		
    	else
    		mMonth=month(date())
    		mYear=year(date())
    	end if
     	dim days
    		if mMonth=1 then
    			days=CountDays(12,mYear-1)
    		else
    			days=CountDays(mMonth-1,mYear)
    		End If
    		 
    	mdate=day(date())
    	response.Write("<center>"&myear&"年"&mmonth&"月</center>")
    %>
    <table  align=center>
    	<tr>
        <td><a href="?month=<%=int(mMonth)-1%>&year=<%=mYear%>"><img src="gd_left.png" width="35" height="112" /></a></td>
        <td>
        
    <table border=1 align=center>
    <tr>
    <td align=right>星期日</td>
    <td align=right>星期一</td>
    <td align=right>星期二</td>
    <td align=right>星期三</td>
    <td align=right>星期四</td>
    <td align=right>星期五</td>
    <td align=right>星期六</td>
    </tr><tr>
    <%
    	j=1
    	l=1
    	m=FirstDay(mMonth,mYear)
    	k=CountDays(mMonth,mYear)
    	days=days-m+2
    	if m<=5 then
    		n=35
    	else
    		n=42
    	End If
    	for i=1 to n
    			response.Write("<td align='right'>")
    			if i>=m and j<=k then
    				If mdate=j and int(mYear)=int(year(date())) And  int(mMonth)=int(month(date())) then
    					response.Write("<font color='red'>"&j&"</font>")
    				else
    					response.Write(j)
    				end if
    				j=j+1
    			elseif i>m then
    				response.Write("<font color='#9A8B90'>"&l&"</font>")
    				l=l+1
    			elseif i<m then
    				response.Write("<font color='#9A8B90'>"&days&"</font>")
    				days=days+1
    			else
    				response.Write(" ")
    			End  If
    			response.Write("</td>")
    			If i mod 7=0 then
    				response.Write("</tr><tr>")
    			end if
    	Next
    	
    	
    %>
    </tr>
    </table>
        
        
        </td>
        <td>
        <a href="?month=<%=int(mMonth)+1%>&year=<%=mYear%>"><img src="gd_right.png" width="35" height="112" /></a>
        </td>
        </tr>
       
    </table>
    
    
    </body>
    </html>
    

      

  • 相关阅读:
    事务四大特征:原子性,一致性,隔离性和持久性(ACID)
    解决“要登录到这台远程计算机,你必须被授予”
    SqlServer_查看SQLServer版本信息
    sed 查找文件的某一行内容
    linux echo命令的-n、-e两个参数
    在.Net中进行跨线程的控件操作(上篇:Control.Invoke)
    .NET性能优化方面的总结
    SQLSERVER2008 显示列信息,包含扩展属性
    C#4.0新特性:可选参数,命名参数,Dynamic
    浅谈.net中的params关键字
  • 原文地址:https://www.cnblogs.com/xyzhuzhou/p/2731523.html
Copyright © 2011-2022 走看看