国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp制作的日歷程序

2024-05-04 11:06:41
字體:
來源:轉載
供稿:網友

純asp打造的日歷程序,可自行美化,這里僅提供最簡單的css樣式。。。

<style>
body{font-size:12px; margin:20px 0 0 20px; padding:0}
tr,td{text-align:center;}
</style>
<%
'=================================
'說明:日歷文件
'=================================
'取出對應的年月博客日志數據
'=======================
ryear = cint(request.querystring("year"))
rmonth = cint(request.querystring("month"))
if ryear = 0  or ryear = null then ryear = year(now)
if rmonth = 0 or rmonth = null then rmonth = month(now)
nowtime = ryear&"-"&rmonth&"-1"   '得到本月第一天
nowyear = year(nowtime)           '年份
nowmonth = month(nowtime)         '月份
nowweekday = weekday(nowtime) - 1 '當前禮拜
'獲取2月天數
febdays = 28
if nowyear / 4 = 0 then febdays = 29
'獲取本月天數
if nowmonth = 1 then
    monthdays = 31
elseif nowmonth = 2 then     
    monthdays = febdays
elseif nowmonth = 3 then     
    monthdays = 31
elseif nowmonth = 4 then     
    monthdays = 30
elseif nowmonth = 5 then     
    monthdays = 31
elseif nowmonth = 6 then     
    monthdays = 30
elseif nowmonth = 7 then     
    monthdays = 31
elseif nowmonth = 8 then     
    monthdays = 31
elseif nowmonth = 9 then     
    monthdays = 30
elseif nowmonth = 10 then     
    monthdays = 31
elseif nowmonth = 11 then     
    monthdays = 30
else
    monthdays = 31
end if
calendar =  "<a href='calendar.asp?year="&nowyear - 1&"&month="&nowmonth&"'> &lt;&lt;</a>&nbsp;"
willshowmonthmonth = nowmonth
if willshowmonthmonth - 1 <= 0 then willshowmonthmonth = 2
calendar =  calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth - 1&"'> &lt;</a>&nbsp;"
if willshowmonthmonth + 1 > 12 then willshowmonthmonth = 11
calendar =  calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth + 1&"''> &gt;</a>&nbsp;"
calendar =  calendar & "<a href='calendar.asp?year="&nowyear + 1&"&month="&nowmonth&"'> &gt;&gt;</a>&nbsp;"
calendar =  calendar & "<table bgcolor=#000000 cellspacing=1 width=200><tr bgcolor=#ffffff><td colspan=7>"&nowyear&"-"&nowmonth&"-"&day(now)&"</td></tr>"&vbcrlf
calendar =  calendar & "  <tr bgcolor=#ffffff>"&vbcrlf
calendar =  calendar & "<td>日</td>"&vbcrlf
calendar =  calendar & "<td>一</td>"&vbcrlf
calendar =  calendar & "<td>二</td>"&vbcrlf
calendar =  calendar & "<td>三</td>"&vbcrlf
calendar =  calendar & "<td>四</td>"&vbcrlf
calendar =  calendar & "<td>五</td>"&vbcrlf
calendar =  calendar & "<td>六</td>"&vbcrlf
calendar =  calendar & "</tr>"&vbcrlf
calendar =  calendar &  vbcrlf&"<tr bgcolor=#ffffff>"&vbcrlf
'把前面的空白補充出來
nowmonthfirstiweekday = weekday(nowyear&"-"&nowmonth&"-1") - 2 '本月第一天的星期
for i=0 to nowmonthfirstiweekday
    calendar =  calendar & "<td bgcolor=#efefef>&nbsp;</td>"&vbcrlf
next
'開始循環寫日期
t=1
for i=1 to monthdays
    if year(now) = year(nowyear&"-"&nowmonth&"-"&i) and day(now) = day(nowyear&"-"&nowmonth&"-"&i) then                   '高亮顯示今日
   
        calendar =  calendar &  "<td bgcolor=#cccccc><a href=''>"&i&"</a></td>"&vbcrlf
    else
        calendar =  calendar &  "<td>"&i&"</td>"&vbcrlf
    end if
    
    if weekday(nowyear&"-"&nowmonth&"-"&i) = 7 then
    t=t+1
    calendar =  calendar &  "</tr><tr bgcolor=#ffffff>"&vbcrlf
    end if
next
for i=1 to (7*t-(nowmonthfirstiweekday+1+monthdays))
calendar =  calendar &  "<td  bgcolor=#ffffff></td>"&vbcrlf
next
calendar =  calendar &  vbcrlf&"</tr>"
calendar =  calendar &  "</table>"&vbcrlf
response.write calendar
%>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 肃北| 库尔勒市| 乌兰察布市| 新源县| 克什克腾旗| 樟树市| 芮城县| 富民县| 阳原县| 无为县| 宣恩县| 墨竹工卡县| 大厂| 阿合奇县| 治多县| 台北县| 若尔盖县| 邵阳市| 巴林右旗| 铁岭县| 隆昌县| 婺源县| 基隆市| 英德市| 哈尔滨市| 尼木县| 高淳县| 贡觉县| 靖江市| 闽侯县| 武夷山市| 西和县| 景东| 奉化市| 凤台县| 云林县| 江门市| 大邑县| 呼玛县| 中牟县| 罗田县|