<% '########################################################### '## COPYRIGHT (C) 2003, Metasun Software '## '## For licensing details, lease read the license.txt file '## included with MetaTraffic or located at: '## http://www.metasun.com/products/metatraffic/license.asp '## '## All copyright notices regarding MetaTraffic '## must remain intact in the scripts and in the '## outputted HTML. All text and logos with '## references to Metasun or MetaTraffic must '## remain visible when the pages are viewed on '## the internet or intranet. '## '## For support, please visit http://www.metasun.com '## and use the support forum. '########################################################### %> <% Option Explicit %> <% Dim datToday, datCurrent, datSelected Dim datMonth, datMonthName, datYear Dim datNextMonth, datNextMonthYear Dim intDaysInMonth, intStartWeekDay, intEndWeekday Dim intDayLoop, intWeekdayPos Dim strClass, strFormname strFormname = Request.Querystring("name") datSelected = Request.Querystring("sdate") datCurrent = Request.Querystring("cdate") If Isdate(datSelected)=False Then datSelected = Date() End If If Isdate(datCurrent)=False Then datCurrent = datSelected End If datSelected = Cdate(datSelected) datCurrent = Cdate(datCurrent) ' SET SOME CONSTANTS datToday = Date() datMonth = Month(datCurrent) datMonthName = Monthname(datMonth) datYear = Year(datCurrent) datNextMonth = Month(DateAdd("m", 1, datCurrent)) datNextMonthYear = Year(DateAdd("m", 1, datCurrent)) intDaysInMonth = Day(DateAdd("d", 0 - Day(datCurrent), DateAdd("m", 1, datCurrent))) intStartWeekday = Weekday(DateAdd("d", (1 - Day(datCurrent)), datCurrent), 1) intEndWeekday = Weekday(DateAdd("d", intDaysInMonth, DateAdd("d", (0 - Day(datCurrent)), datCurrent)), 1) intWeekdayPos = 0 %> Calendar: Select a date <% With Response .Write "" .Write "" .Write "" .Write "" End With If intStartWeekday > 1 Then For intDayLoop = 1 to (intStartWeekday - 1) intWeekdayPos = intWeekdayPos + 1 Response.Write "" Next End If For intDayLoop = 1 to intDaysInMonth intWeekdayPos = intWeekdayPos + 1 ' START NEW ROW IF BEGINNING OF WEEK If intWeekdayPos Mod 7 = 1 Then Response.Write "" End If if datSelected = FormatDate(intDayLoop, datMonth, datYear) Then strClass = "selected" elseif datToday = FormatDate(intDayLoop, datMonth, datYear) Then strClass = "today" Else strClass = "normal" End If Response.Write "" ' CLOSE OFF ROW IF END OF WEEK If intWeekdayPos Mod 7 = 0 Then Response.Write "" End If Next If intEndWeekday < 7 Then For intDayLoop = 1 to (7 - intEndWeekday) intWeekdayPos = intWeekdayPos + 1 Response.Write "" Next End If Response.Write "
" .Write "" .Write "" .Write "" .Write "
" .Write "" .Write " « " .Write "" & datMonthName & " " & datYear & "" .Write "" .Write " » " .Write "
SMTWTFS
 
" Response.Write "" Response.Write intDayLoop & "
 
" Response.Write Request.Form("cdate") Function FormatDate (intDay, intMonth, intYear) Dim datTemp, datReference datReference = Date() datTemp = datReference ' SET YEAR datTemp = DateAdd("yyyy", intYear - Year(datReference), datTemp) ' SET MONTH datTemp = DateAdd("m", intMonth - Month(datReference), datTemp) ' SET DAY datTemp = DateAdd("d", intDay - Day(datReference), datTemp) FormatDate = datTemp End Function %>