<% ' E-Calendar ASP Edition 2.1 Release ' November 30th, 2002 ' Bug Fix for Recurring Events and minor date issues ' If you have any problems, please email support@futuretec-soft.com Session.LCID = 2057 'Option Explicit Dim dtToday dtToday = Date() Dim dtCurViewMonth ' First day of the currently viewed month Dim dtCurViewDay ' Current day of the currently viewed month Dim frmDate ' Date submitted by form ' if the GO button was used, build the date from the month and year If InStr(1, Request.QueryString, "subGO", 1) > 0 then if Request.QueryString("CURDATE_month") = "" then tmpMonth = month(now()) else tmpMonth = Request.QueryString("CURDATE_month") End If if Request.QueryString("CURDATE_year") = "" then tmpyear = year(now()) else tmpyear = Request.QueryString("CURDATE_year") End If tmpDate = "1 " & tmpMonth & " 2011" mnth = Month(tmpDate) frmDate = DateSerial(tmpyear, mnth, 1) Else frmDate = Request.QueryString("CURDATE") end if if Request("view_date") <> "" then frmDate= DateSerial(year(Request("view_date")), month(Request("view_date")), 1) end if %> <% REM This section defines functions to be used later on. %> <% REM This sets the Previous Sunday and the Current Month %> <% '-------------------------------------------------- Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function '-------------------------------------------------- %> <%REM Set current view month from posted CURDATE, or ' the current date as appropriate. ' if posted from the form ' if prev button was hit on the form If InStr(1, Request.QueryString, "subPrev", 1) > 0 Then dtCurViewMonth = DateAdd("m", -1, frmDate) ' if next button was hit on the form ElseIf InStr(1, Request.QueryString, "subNext", 1) > 0 Then dtCurViewMonth = DateAdd("m", 1, frmDate) ' anyother time Else ' date add in text box If InStr(1, Request.QueryString, "subGO", 1) > 0 then dtCurViewMonth = frmDate Else if Request("view_date") <> "" then dtCurviewMonth = frmDate else dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1) End If End If End If %> <% REM --------BEGINNING OF DRAW CALENDAR SECTION-------- %> <% REM This section executes the event query and draws a matching calendar. %> <% Dim iDay, iWeek, sFontColor, dictDte(31,2), intCount, newEvent 'Bug Fix : November 29th, 2002 if dtCurViewMonth = "" Then dtCurViewMonth = DateSerial(year(now),month(now),1) iDate = dtCurViewMonth tmpStart = iDate tmpEnd = DateSerial(Year(iDate), Month(iDate) + 1, 0) dStart = Month(tmpStart) & "/" & Day(tmpStart) & "/" & Year(tmpStart) dEnd = Month(tmpEnd) & "/" & Day(tmpEnd) & "/" & Year(tmpEnd) If DB_Type = "SQL" Then strSql = "SELECT ID,Title,ImgS,[Date],EndDate from Events WHERE ( ([Date] >='" & dStart & "' AND [Date]<='" & dEnd & "') OR ( EndDate >='" & dStart & "' AND EndDate<='" & dEnd & "' ) OR ( [Date] <'" & dStart & "' AND EndDate >'" & dEnd &"' ) ) ORDER BY DATE ASC, ENDDATE ASC;" Else strSql = "SELECT ID,Title,ImgS,[Date],EndDate from Events WHERE ( ([Date] >=#" & dStart & "# AND [Date]<=#" & dEnd & "#) OR ( EndDate >=#" & dStart & "# AND EndDate<=#" & dEnd & "# ) OR ( [Date] <#" & dStart & "# AND EndDate >#" & dEnd &"# ) ) ORDER BY DATE ASC, ENDDATE ASC;" End if 'Debugging 'Response.write strSql set rs = conn.Execute (StrSql) if not RS.EOF Then iEvents = Rs.GetRows() Else Dim iEvents(4,1) End if numcols=ubound(iEvents,1) numrows=ubound(iEvents,2) %> <% on Error resume next FOR intCount = 0 To 31 FOR rowcounter= 0 TO numrows cmpDate = DateSerial (Year(iDate), Month(iDate), intCount+1) SDate = iEvents(3, rowcounter) EDate = iEvents(4, rowcounter) 'Debugging 'Response.Write (cmpDate & " :: " & SDate & " :: " & EDate & " :: " & DateDiff("d",cmpDate,SDate) & " :: " & DateDiff("d",cmpDate,EDate)) If (DateDiff("d",cmpDate,SDate) <= 0 AND DateDiff("d",cmpDate,EDate) => 0) Then If iEvents(2, rowcounter) = "" Then newEvent = "" & ">> "&TrimTitle(iEvents(1, rowcounter))&"" Else newEvent = "" & "
>> " &TrimTitle(iEvents(1, rowcounter))&"
" End if if dictDte(intCount, 1) <> "" Then dictDte(intCount, 1) = dictDte(intCount, 1) & "
" & newEvent Else dictDte(intCount, 1) = newEvent End If Else End if Next dictDte(intCount, 2) = intCount + 1 Next %> Spam Allstars | Music, Podcasts, Dates and Assorted Funky News

Join us at the shows...

 
" METHOD="GET">

<% For iDay = vbSunday To vbSaturday %> <%Next %> <% dtCurViewDay = DtPrevSunday(dtCurViewMonth) For iWeek = 0 To 5 Response.Write "" & vbCrLf Dim sBGCOLOR sBGCOLOR = "#FFFFFF" For iDay = 0 To 6 ADay = ConvertDay(iday+1) sBGCOLOR = "" If Month(dtCurViewDay) = Month(dtCurViewMonth) Then If dtCurViewDay = dtToday Then sBGCOLOR = "#eeeeee" else sBGCOLOR = "" End If Response.Write "" & vbCrLf dtCurViewDay = DateAdd("d", 1, dtCurViewDay) Next Response.Write "" & vbCrLf Next %> <%REM --------END OF DRAW CALENDAR SECTION-------- conn.Close set conn = nothing %>
<%=monthName(Month(dtCurViewMonth)) & " " & Year(dtCurViewMonth)%>
<%=WeekDayName(iDay)%>
" If Month(dtCurViewDay) = Month(dtCurViewMonth) Then If dtCurViewDay = dtToday Then sFontColor = "#333333" Else sFontColor = "#333333" End If '---- Write day of month Response.Write "" Response.Write (Day(dtCurViewDay) & "
" & dictDte(Day(dtCurViewDay)- 1, 1) & "

") End If Response.Write "