国产探花免费观看_亚洲丰满少妇自慰呻吟_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
%>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 托克托县| 阳城县| 明光市| 偃师市| 彩票| 江川县| 宁德市| 渝北区| 宕昌县| 察雅县| 望江县| 新源县| 石门县| 山阴县| 多伦县| 上虞市| 东兴市| 永靖县| 镇巴县| 台北县| 武汉市| 蓬溪县| 天柱县| 石首市| 抚松县| 新河县| 武夷山市| 通化市| 观塘区| 桂林市| 阿尔山市| 南昌县| 绿春县| 德安县| 谢通门县| 扎兰屯市| 屏南县| 洪泽县| 定西市| 鲜城| 霍邱县|