<% Option Explicit '########################################################### '## COPYRIGHT (C) 2002-2008, Metasun Software Corp. '## '## 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. '########################################################### %> <% Dim strClass, intDayLoop Dim strShortDate : strShortDate = aryMTConfig(10) Dim strFormName : strFormname = Request.Querystring("name") Dim datSelected : datSelected = Request.Querystring("sdate") Dim datCurrent : 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) Dim datToday : datToday = Date() Dim datMonth : datMonth = Month(datCurrent) Dim datMonthName : datMonthName = Monthname(datMonth) Dim datYear : datYear = Year(datCurrent) Dim datNextMonth : datNextMonth = Month(DateAdd("m", 1, datCurrent)) Dim datNextMonthYear : datNextMonthYear = Year(DateAdd("m", 1, datCurrent)) Dim intDaysInMonth : intDaysInMonth = Day(DateSerial(Year(datCurrent), Month(datCurrent) + 1, 0)) Dim intStartWeekday : intStartWeekday = Weekday(DateAdd("d", (1 - Day(datCurrent)), datCurrent), 1) Dim intEndWeekday : intEndWeekday = Weekday(DateAdd("d", intDaysInMonth, DateAdd("d", (0 - Day(datCurrent)), datCurrent)), 1) Dim intWeekdayPos : 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 = DateSerial(datYear, datMonth, intDayLoop) Then strClass = "selected" elseif datToday = DateSerial(datYear, datMonth, intDayLoop) 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 %>