<%@ Language=VBScript %> <% Response.Buffer = True %> <% Server.ScriptTimeout = 1000 %> <% '_________________________________________________________________________________ '--------------------------------------------------------------------------------- ' Script Name : aspWebCalendar 2008 - Event Display Engine ' File Name : events.asp ' Version : 5.0 (2008) ' Copyright : 2000 - 2008 Full Revolution, Inc. '_________________________________________________________________________________ '--------------------------------------------------------------------------------- '********************************************************************************* '******** Page Opening Code ****************************************************** '********************************************************************************* %> <% '********************************************************************************* '******** Determine the Browser Type ********************************************* '********************************************************************************* ClientBrowser = GetBrowserType(request.ServerVariables("HTTP_USER_AGENT")) '********************************************************************************* '******** Required Variables ***************************************************** '********************************************************************************* If Session("EventsConfigLoaded") = "" or Session("EventsConfigLoaded") = "NO" then SQL = "SELECT * FROM Cal_Config WHERE Cal_ConfigID = 1" Set RS=dbc.execute(SQL) Session("ScriptTitle") = RS("Cal_ConfigScriptTitle") Session("DefaultColorScheme") = RS("Cal_ConfigDefaultColorScheme") Session("ImageFolder") = RS("Cal_ConfigImageFolder") Session("DateFormat") = RS("Cal_ConfigDateFormat") Session("MainFontFace") = RS("Cal_ConfigMainFontFace") Session("MonthBlockHeight") = RS("Cal_ConfigMonthBlockHeight") Session("MiniCalendarWidth") = RS("Cal_ConfigMiniCalendarWidth") Session("DefaultView") = RS("Cal_ConfigDefaultView") Session("EventViewFeatures") = RS("Cal_ConfigEventViewFeatures") Session("FavoriteIcon") = RS("Cal_ConfigFavoriteIcon") Session("LCID") = RS("Cal_ConfigLCID") Session("EventsConfigLoaded") = "YES" Session("User1Name") = RS("Cal_ConfigUser1Name") Session("User1Description") = RS("Cal_ConfigUser1Description") Session("User1Type") = RS("Cal_ConfigUser1Type") 'SELECT,TEXT,TEXTAREA,RADIO,CHECK Session("User1OptionLabels") = RS("Cal_ConfigUser1OptionLabels") 'seperate with a | Session("User1OptionValues") = RS("Cal_ConfigUser1OptionValues")'seperate with a | Session("User1DefaultValue") = RS("Cal_ConfigUser1DefaultValue") Session("User1Height") = RS("Cal_ConfigUser1Height") Session("User1Validation") = RS("Cal_ConfigUser1Validation") 'REQ,etc... Session("User2Name") = RS("Cal_ConfigUser2Name") Session("User2Description") = RS("Cal_ConfigUser2Description") Session("User2Type") = RS("Cal_ConfigUser2Type") 'SELECT,TEXT,TEXTAREA,RADIO,CHECK Session("User2OptionLabels") = RS("Cal_ConfigUser2OptionLabels") 'seperate with a | Session("User2OptionValues") = RS("Cal_ConfigUser2OptionValues") 'seperate with a | Session("User2DefaultValue") = RS("Cal_ConfigUser2DefaultValue") Session("User2Height") = RS("Cal_ConfigUser2Height") Session("User2Validation") = RS("Cal_ConfigUser2Validation") 'REQ,etc... Session("User3Name") = RS("Cal_ConfigUser3Name") Session("User3Description") = RS("Cal_ConfigUser3Description") Session("User3Type") = RS("Cal_ConfigUser3Type") 'SELECT,TEXT,TEXTAREA,RADIO,CHECK Session("User3OptionLabels") = RS("Cal_ConfigUser3OptionLabels") 'seperate with a | Session("User3OptionValues") = RS("Cal_ConfigUser3OptionValues") 'seperate with a | Session("User3DefaultValue") = RS("Cal_ConfigUser3DefaultValue") Session("User3Height") = RS("Cal_ConfigUser3Height") Session("User3Validation") = RS("Cal_ConfigUser3Validation") 'REQ,etc... Session("User4Name") = RS("Cal_ConfigUser4Name") Session("User4Description") = RS("Cal_ConfigUser4Description") Session("User4Type") = RS("Cal_ConfigUser4Type") 'SELECT,TEXT,TEXTAREA,RADIO,CHECK Session("User4OptionLabels") = RS("Cal_ConfigUser4OptionLabels") 'seperate with a | Session("User4OptionValues") = RS("Cal_ConfigUser4OptionValues") 'seperate with a | Session("User4DefaultValue") = RS("Cal_ConfigUser4DefaultValue") Session("User4Height") = RS("Cal_ConfigUser4Height") Session("User4Validation") = RS("Cal_ConfigUser4Validation") 'REQ,etc... Session("User5Name") = RS("Cal_ConfigUser5Name") Session("User5Description") = RS("Cal_ConfigUser5Description") Session("User5Type") = RS("Cal_ConfigUser5Type") 'SELECT,TEXT,TEXTAREA,RADIO,CHECK Session("User5OptionLabels") = RS("Cal_ConfigUser5OptionLabels") 'seperate with a | Session("User5OptionValues") = RS("Cal_ConfigUser5OptionValues") 'seperate with a | Session("User5DefaultValue") = RS("Cal_ConfigUser5DefaultValue") Session("User5Height") = RS("Cal_ConfigUser5Height") Session("User5Validation") = RS("Cal_ConfigUser5Validation") 'REQ,etc... SQLc = "SELECT * FROM Cal_ColorSchemes WHERE ColorSchemeID = " & RS("Cal_ConfigDefaultColorScheme") Set RSc=dbc.execute(SQLc) Session("LightColor") = RSc("LightColor") Session("MidLightColor") = RSc("MidLightColor") Session("LightMainColor") = RSc("LightMainColor") Session("DarkMainColor") = RSc("DarkMainColor") Session("LightLineColor") = RSc("LightLineColor") Session("PrimaryHighlightColor") = RSc("PrimaryHighlightColor") Session("SecondaryHighlightColor") = RSc("SecondaryHighlightColor") RSc.Close Set RSc=Nothing RS.Close Set RS=Nothing End If ScriptTitle = Session("ScriptTitle") DefaultColorScheme = Session("DefaultColorScheme") ImageFolder = Session("ImageFolder") DateFormat = Session("DateFormat") MainFontFace = Session("MainFontFace") MonthBlockHeight = Session("MonthBlockHeight") MiniCalendarWidth = Session("MiniCalendarWidth") DefaultView = Session("DefaultView") EventViewFeatures = Session("EventViewFeatures") LCID = Session("LCID") LightColor = Session("LightColor") MidLightColor = Session("MidLightColor") LightMainColor = Session("LightMainColor") DarkMainColor = Session("DarkMainColor") LightLineColor = Session("LightLineColor") PrimaryHighlightColor = Session("PrimaryHighlightColor") SecondaryHighlightColor = Session("SecondaryHighlightColor") MiniCalendarHeight = 1 Session.LCID = LCID MonthSundayName = WeekDayName(1) MonthMondayName = WeekDayName(2) MonthTuesdayName = WeekDayName(3) MonthWednesdayName = WeekDayName(4) MonthThursdayName = WeekDayName(5) MonthFridayName = WeekDayName(6) MonthSaturdayName = WeekDayName(7) MiniSundayName = "S" MiniMondayName = "M" MiniTuesdayName = "T" MiniWednesdayName = "W" MiniThursdayName = "T" MiniFridayName = "F" MiniSaturdayName = "S" FavoriteIcon = Session("FavoriteIcon") '---- Adjust favorite icon to local path if it doesnt have http in it------ If InStr(UCase(FavoriteIcon),"HTTP") then Else FavoriteIcon = GetURL("EVENTS") & FavoriteIcon End If '********************************************************************************* '******** Get a list of published calendars ************************************** '********************************************************************************* SQL = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarPublishWebsite = 'YES'" Set RS=dbc.execute(SQL) Do While NOT RS.EOF PublishedCalendars = PublishedCalendars & RS("Cal_CalendarID") & "," RS.MoveNext Loop RS.Close Set RS=Nothing If right(PublishedCalendars,1) = "," then PublishedCalendars = left(PublishedCalendars,len(PublishedCalendars)-1) End If '********************************************************************************* '******** Setup Time Formatting ************************************************** '********************************************************************************* TestTime = "1:00PM" TestTime = FormatDateTime(TestTime) If TestTime = "13:00:00" then TimeFormatToUse = "24" Else TimeFormatToUse = "12" End If '********************************************************************************* '******** Find Out What We Should Be Doing *************************************** '********************************************************************************* Call BuildStyles response.Write "" response.Write "" & ScriptTitle & "" response.Write "" & vbcrlf response.Write "" %> <% response.Write "" response.Write "" If request.form("txtCalSelector") <> "" then Session("CalendarFilter") = request.form("txtCalSelector") End If If Session("CalendarFilter") = "" then Session("CalendarFilter") = 0 End If If request.querystring("calendar") <> "" then Session("CalendarFilter") = request.querystring("calendar") End If Session("CalendarFilter") = cint(Session("CalendarFilter")) If request.querystring("date") <> "" then WorkingDate = UniversalDate(request.querystring("date")) Else WorkingDate = UniversalDate(Date()) End If ScriptAction = request.querystring("action") If ScriptAction = "" then ScriptAction = DefaultView End If SELECT CASE ScriptAction CASE "month" response.write Session("PageHeader") CalType = "month" Call DrawHeaderBar Call DrawMonthView response.write Session("PageFooter") CASE "day" response.write Session("PageHeader") CalType = "day" Call DrawHeaderBar Call DrawDayView response.write Session("PageFooter") CASE "week" response.write Session("PageHeader") CalType = "week" Call DrawHeaderBar Call DrawWeekView response.write Session("PageFooter") CASE "year" response.write Session("PageHeader") CalType = "year" Call DrawHeaderBar Call DrawYearView response.write Session("PageFooter") CASE "viewevent" response.write Session("PageHeader") CalType = "day" Call DrawHeaderBar Call DrawViewEvent response.write Session("PageFooter") CASE ELSE END SELECT dbc.close Set dbc=Nothing response.Write "" '********************************************************************************* '********************************************************************************* '******** Draw Header Bar ******************************************************** '********************************************************************************* Sub DrawHeaderBar theDate = WorkingDate HeaderText = CalType SELECT CASE HeaderText CASE "month" BackTitle = "Back a Month" ForwardTitle = "Forward a Month" HeaderInfo = MonthName(Month(theDate)) & " " & Year(theDate) If Month(theDate) > 1 then PrevMonth = Month(theDate) - 1 PrevYear = Year(theDate) Else PrevMonth = 12 PrevYear = Year(theDate) - 1 End If If Month(theDate) < 12 then NextMonth = Month(theDate) + 1 NextYear = Year(theDate) Else NextMonth = 1 NextYear = Year(theDate) + 1 End If PrevDate = PrevYear & "-" & PrevMonth & "-1" NextDate = NextYear & "-" & NextMonth & "-1" CASE "day" BackTitle = "Back a Day" ForwardTitle = "Forward a Day" HeaderInfo = FormatDateTime(theDate,1) PrevDate = cDate(theDate) - 1 NextDate = cDate(theDate) + 1 CASE "week" BackTitle = "Back a Week" ForwardTitle = "Forward a Week" WeekDayTitleName = Weekday(theDate, 1) WeekDayTitleName = "Week of " & DateAdd("w", 1-WeekDayTitleName, theDate) HeaderInfo = WeekDayTitleName PrevDate = DateAdd("ww", -1, theDate) NextDate = DateAdd("ww", 1, theDate) CASE "year" BackTitle = "Back a Year" ForwardTitle = "Forward a Year" PrevDate = DateAdd("yyyy", -1, theDate) NextDate = DateAdd("yyyy", 1, theDate) HeaderInfo = "Year View of " & Year(theDate) CASE "listing" PrevDate = DateAdd("m", -1, theDate) NextDate = DateAdd("m", 1, theDate) HeaderInfo = MonthName(Month(theDate)) & " " & Year(theDate) & " - " & MonthName(Month(DateAdd("m", 2, theDate))) & " " & Year(DateAdd("m", 2, theDate)) END SELECT '---------- New Button Bar -------------------------------------------------------- response.write "
" response.write "" If ClientBrowser <> "OTHER" then If request.QueryString("action") <> "viewevent" then Call DrawButton("button_back.gif",BackTitle,"","window.location.reload('events.asp?date=" & PrevDate & "&action=" & CalType & "');",30) Call DrawButton("","",HeaderInfo,"",150) Call DrawButton("button_forward.gif",ForwardTitle,"","window.location.reload('events.asp?date=" & NextDate & "&action=" & CalType & "');",30) Call DrawButtonSep End If Call DrawButton("button_day.gif","Day View","","window.location.reload('events.asp?action=day&date=" & theDate & "');",30) Call DrawButton("button_week.gif","Week View","","window.location.reload('events.asp?action=week&date=" & theDate & "');",30) Call DrawButton("button_month.gif","Month View","","window.location.reload('events.asp?action=month&date=" & theDate & "');",30) Call DrawButton("button_year.gif","Year View","","window.location.reload('events.asp?action=year&date=" & theDate & "');",30) Call DrawButton("button_gototoday.gif","Goto Today","","window.location.reload('events.asp?action=day&date=" & Date() & "');",30) Call DrawButtonSep Call DrawCalendarSelector 'Call DrawButtonSep 'If Session("FR_UserID") = 1 then ' Call DrawButton("button_addevent.gif","Add Event","","NewWindow('events.asp?action=addevent&date=" & theDate & "','aspWebCalendarADDEVENT','500','540','no');",30) 'End If 'If Session("FR_UserID") = "" then 'Call DrawButton("button_logon.gif","Login","","NewWindow('events.asp?action=login','aspWebCalendarLOGIN','580','430','no');",30) 'End If 'If Session("FR_UserID") = 1 Then ' Call DrawButtonSep ' Call DrawButton("button_config.gif","Modify Config","","NewWindow('events.asp?action=modifyconfig','aspWebCalendarCONFIG','500','430','no');",30) ' Call DrawButton("button_calendars.gif","Manage Calendars","","NewWindow('events.asp?action=managecalendars','aspWebCalendarCALENDARS','500','400','no');",30) ' Call DrawButtonSep ' Call DrawButton("button_logoff.gif","Logoff","","window.location.reload('events.asp?action=logoff');",30) 'End If Else Call DrawBadBrowserButton("button_back.gif","Back a Month","","events.asp?date=" & PrevDate & "&action=" & CalType,30) Call DrawBadBrowserButton("","",HeaderInfo,"",150) Call DrawBadBrowserButton("button_forward.gif","Forward a Month","","events.asp?date=" & NextDate & "&action=" & CalType,30) Call DrawButtonSep Call DrawBadBrowserButton("button_day.gif","Day View","","events.asp?action=day&date=" & theDate & "",30) Call DrawBadBrowserButton("button_week.gif","Week View","","events.asp?action=week&date=" & theDate,30) Call DrawBadBrowserButton("button_month.gif","Month View","","events.asp?action=month&date=" & theDate,30) Call DrawBadBrowserButton("button_year.gif","Year View","","events.asp?action=year&date=" & theDate,30) Call DrawBadBrowserButton("button_gototoday.gif","Goto Today","","events.asp?action=day&date=" & Date() & "",30) Call DrawButtonSep Call DrawCalendarSelector 'Call DrawButtonSep 'If Session("FR_UserID") = 1 then ' Call DrawButton("button_addevent.gif","Add Event","","NewWindow('events.asp?action=addevent&date=" & theDate & "','aspWebCalendarADDEVENT','500','540','no');",30) 'End If 'If Session("FR_UserID") = "" then ' Call DrawButton("button_logon.gif","Login","","NewWindow('events.asp?action=login','aspWebCalendarLOGIN','580','430','no');",30) 'End If 'If Session("FR_UserID") = 1 Then ' Call DrawButtonSep ' Call DrawBadBrowserButton("button_config.gif","Modify Config","","NewWindow('events.asp?action=modifyconfig','aspWebCalendarCONFIG','500','600','yes');",30) ' Call DrawBadBrowserButton("button_calendars.gif","Manage Calendars","","NewWindow('events.asp?action=managecalendars','aspWebCalendarCALENDARS','500','400','no');",30) ' Call DrawButtonSep ' Call DrawBadBrowserButton("button_logoff.gif","Logoff","","events.asp?action=logoff",30) 'End If End If response.write "
" response.write "
" '----------------------------------------------------------------------------------- End Sub '********************************************************************************* '******** Draw Month View ******************************************************** '********************************************************************************* Sub DrawMonthView '------- Setup some information about the month ----------------- ThisMonthsFirstDay = Year(WorkingDate) & "-" & Month(WorkingDate) & "-1" NextMonthsFirstDay = dateAdd("m",1,ThisMonthsFirstDay) ThisMonthsLastDay = dateadd("d",-1,NextMonthsFirstDay) LastMonthsLastDay = dateadd("d",-1,ThisMonthsFirstDay) StartDate = dateadd("d",1-weekday(ThisMonthsFirstDay),ThisMonthsFirstDay) '------- Draw the beginning of the calendar ---------------------- response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & MonthSundayName & "" & MonthMondayName & "" & MonthTuesdayName & "" & MonthWednesdayName & "" & MonthThursdayName & "" & MonthFridayName & "" & MonthSaturdayName & "
" '-------- Main Calendar Table ------------------------------------- response.write "" response.write "" '-------- If the first day is not sunday -------------------------- If weekday(ThisMonthsFirstDay) > 1 then For Counter = day(StartDate) to day(LastMonthsLastDay) Call DrawOtherMonthDay(Counter) Next End If '-------- Draw normal days after Saturday, start a new row -------- For Counter = 1 to day(ThisMonthsLastDay) DateToUse = Year(WorkingDate) & "-" & Month(WorkingDate) & "-" & Counter Call DrawMonthNormalDay(Counter) If weekday(DateToUse) = 7 then response.write "" If Counter <> day(ThisMonthsLastDay) then response.write "" End If End if Next '-------- If last day is not saturday ----------------------------- If weekday(ThisMonthsLastDay) < 7 then For Counter = 1 to 7 - weekday(ThisMonthsLastDay) Call DrawOtherMonthDay(Counter) Next End If '-------- Draw the last row of the calendar ----------------------- response.write "" response.write "
" End Sub Sub DrawMonthNormalDay(DayNumber) '----------------------------------- Draw a Normal Day DateToUse = Year(WorkingDate) & "-" & Month(WorkingDate) & "-" & DayNumber If Date() = cDate(DateToUse) then MonthCalDayClass = "TableMonthDayCellToday" Else MonthCalDayClass = "TableMonthDayCell" End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write DayNumber response.write "  " response.write "
" 'response.write "
" Call WriteEvent(DateToUse, "MONTH") 'response.write "
" response.write "" End Sub Sub DrawOtherMonthDay(DayNumber) '--------------------------------------- Draw Other Day response.write "" response.write "" End Sub '********************************************************************************* '******** Write Event ************************************************************ '********************************************************************************* Sub WriteEvent(DateToUse, CalViewType) If Session("CalendarFilter") > 0 then SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventCalendarID = "& Session("CalendarFilter") &" AND Cal_EventStartDate <= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" Else SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventStartDate <= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" End If Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic Do While NOT RS.EOF SQLc = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarID = " & RS("Cal_EventCalendarID") Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then EventColor = RSc("Cal_CalendarColor") End If RSc.Close Set RSc=Nothing If RS("Cal_EventAllDay") <> "TRUE" then response.write "
" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" End If response.write "" response.write "" response.write "
  " response.write FormatTime(RS("Cal_EventStartTime")) response.write "" response.write "" response.write "" response.write "" response.write RS("Cal_EventTitle") & "" response.write "
" response.write "
" Else response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" End If response.write "" response.write "" response.write "
"" then ' response.write " colspan=2" 'End If response.write ">" response.write "" response.write "
" response.write "" response.write "" response.write "" response.write RS("Cal_EventTitle") & "" response.write "
" response.write "
" End If RS.MoveNext Loop RS.Close Set RS=Nothing End Sub '********************************************************************************* '******** Draw Mini Calendar ***************************************************** '********************************************************************************* Sub DrawMiniCalendar(theDate) '------- Setup some information about the month ----------------- ThisMonthsFirstDay = Year(theDate) & "-" & Month(theDate) & "-1" NextMonthsFirstDay = dateAdd("m",1,ThisMonthsFirstDay) ThisMonthsLastDay = dateadd("d",-1,NextMonthsFirstDay) LastMonthsLastDay = dateadd("d",-1,ThisMonthsFirstDay) StartDate = dateadd("d",1-weekday(ThisMonthsFirstDay),ThisMonthsFirstDay) '------- Containter for whole mini calendar ---------------------- response.write "" response.write "
" '------- Draw the month heading ---------------------------------- response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write MonthName(Month(theDate)) & " " & Year(theDate) response.write "" response.write "
" '------- Draw the beginning of the calendar ---------------------- response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" 'response.write "
 " & MiniSundayName & "" & MiniMondayName & "" & MiniTuesdayName & "" & MiniWednesdayName & "" & MiniThursdayName & "" & MiniFridayName & "" & MiniSaturdayName & "
" '-------- Main Calendar Table ------------------------------------- 'response.write "" response.write "" '----- Draw the Week button --------------------------------------- response.write "" '-------- If the first day is not sunday -------------------------- If weekday(ThisMonthsFirstDay) > 1 then For Counter = day(StartDate) to day(LastMonthsLastDay) Call DrawOtherMiniDay(Counter) Next End If '-------- Draw normal days after Saturday, start a new row -------- For Counter = 1 to day(ThisMonthsLastDay) DateToUse = Year(theDate) & "-" & Month(theDate) & "-" & Counter Call DrawMiniNormalDay(Counter, DateToUse) If weekday(DateToUse) = 7 then response.write "" If Counter <> day(ThisMonthsLastDay) then response.write "" '----- Draw the Week button --------------------------------------- response.write "" End If End If Next '-------- If last day is not saturday ----------------------------- If weekday(ThisMonthsLastDay) < 7 then For Counter = 1 to 7 - weekday(ThisMonthsLastDay) Call DrawOtherMiniDay(Counter) Next End If '-------- Draw the last row of the calendar ----------------------- response.write "" response.write "
W
W
" '-------- End of Container ---------------------------------------- response.write "

" End Sub Sub DrawMiniNormalDay(DayNumber, theDate) '----------------------------------- Draw a Normal Day DateToUse = Year(theDate) & "-" & Month(theDate) & "-" & DayNumber If Date() = cDate(DateToUse) then MonthCalDayClass = "TableMiniDayCellToday" Else MonthCalDayClass = "TableMiniDayCell" End If IsThereAnEvent = CheckForEvent(DateToUse) If IsThereAnEvent = "YES" then MonthCalDayClass = "TableMiniDayCellWithEvent" End If response.write "" response.write "" response.write "" response.write DayNumber response.write "" response.write "" End Sub Sub DrawOtherMiniDay(DayNumber) '--------------------------------------- Draw Other Day response.write "" response.write " " response.write "" End Sub '********************************************************************************* '******** Draw Day View ********************************************************** '********************************************************************************* Sub DrawDayView response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" TitleToWrite = "Events for: " & FormatDateTime(WorkingDate,1) & "" Call DrawTitle("100%","24",TitleToWrite,"11pt") Call DrawHLine(2) '----- Draw out the events ----------------------------------------------------- If Session("CalendarFilter") > 0 then SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventCalendarID = "& Session("CalendarFilter") &" AND Cal_EventStartDate <= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" Else SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventStartDate <= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" End If Set RS=dbc.execute(SQL) If RS.EOF then '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- response.write "" response.write "There are no events on this date." response.write "" '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- End If Do While NOT RS.EOF '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- EventColor = "gray" SQLc = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarID = " & SafeSQL(RS("Cal_EventCalendarID")) Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then EventColor = RSc("Cal_CalendarColor") End If RSc.Close Set RSc=Nothing response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" Else response.write "" End If response.write "" response.write "" response.write "
" response.write RS("Cal_EventTitle") response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventAllDay") = "TRUE" then response.write "" Else response.write "" End If If RS("Cal_EventLink") = "" or IsNull(RS("Cal_EventLink")) then Else response.write "" End If If RS("Cal_EventImage") = "" or IsNull(RS("Cal_EventImage")) then Else response.write "" End If If Session("User1Name") = "" or IsNull(Session("User1Name")) then Else response.write "" End If If Session("User2Name") = "" or IsNull(Session("User2Name")) then Else response.write "" End If If Session("User3Name") = "" or IsNull(Session("User3Name")) then Else response.write "" End If If Session("User4Name") = "" or IsNull(Session("User4Name")) then Else response.write "" End If If Session("User5Name") = "" or IsNull(Session("User5Name")) then Else response.write "" End If response.write "
Dates:" & FormatDateTime(RS("Cal_EventStartDate"),1) If RS("Cal_EventStartDate") <> RS("Cal_EventEndDate") then response.Write " - " & FormatDateTime(RS("Cal_EventEndDate"),1) End If response.Write "
Title:" & RS("Cal_EventTitle") & "
Description:" & RS("Cal_EventBody") & "
Times:ALL DAY EVENT
Times:" & FormatTime(RS("Cal_EventStartTime")) & " - " & FormatTime(RS("Cal_EventEndTime")) & "
Link:" & RS("Cal_EventLink") & "
Attachment:" & RS("Cal_EventImage") & "
" & Session("User1Name") & ":" & RS("Cal_EventUser1") & "
" & Session("User2Name") & ":" & RS("Cal_EventUser2") & "
" & Session("User3Name") & ":" & RS("Cal_EventUser3") & "
" & Session("User4Name") & ":" & RS("Cal_EventUser4") & "
" & Session("User5Name") & ":" & RS("Cal_EventUser5") & "
" response.write "

" RS.MoveNext '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- Loop RS.Close Set RS=Nothing response.write "
" PreviousMonth = DateAdd("m",-1,WorkingDate) NextMonth = DateAdd("m",1,WorkingDate) Call DrawMiniCalendar(PreviousMonth) Call DrawMiniCalendar(WorkingDate) Call DrawMiniCalendar(NextMonth) response.write "
" End Sub '********************************************************************************* '******** Draw Week View ********************************************************* '********************************************************************************* Sub DrawWeekView '----- Change the working date to the first day of the current week ----------- WeekDayTitleName = Weekday(WorkingDate, 1) WorkingDate = DateAdd("w", 1-WeekDayTitleName, WorkingDate) response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" TitleToWrite = "Events between: " & FormatDateTime(WorkingDate,1) & " and " & FormatDateTime(DateAdd("d",6,WorkingDate),1) & "" Call DrawTitle("100%","24",TitleToWrite,"11pt") Call DrawHLine(2) For I = 1 to 7 If I > 1 then WorkingDate = DateAdd("d",1,WorkingDate) End If TitleToWrite = "Events for: " & FormatDateTime(WorkingDate,1) & "" Call DrawSmallTitle("100%","18",TitleToWrite,"9pt") '----- Draw out the events ----------------------------------------------------- If Session("CalendarFilter") > 0 then SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventCalendarID = "& Session("CalendarFilter") &" AND Cal_EventStartDate <= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" Else SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventStartDate <= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & WorkingDate & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" End If Set RS=dbc.execute(SQL) If RS.EOF then '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- response.write "" response.write "There are no events on this date." response.write "" '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- End If Do While NOT RS.EOF '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- EventColor = "gray" SQLc = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarID = " & SafeSQL(RS("Cal_EventCalendarID")) Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then EventColor = RSc("Cal_CalendarColor") End If RSc.Close Set RSc=Nothing response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" Else response.write "" End If response.write "" response.write "" response.write "
" response.write RS("Cal_EventTitle") response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventAllDay") = "TRUE" then response.write "" Else response.write "" End If If RS("Cal_EventLink") = "" or IsNull(RS("Cal_EventLink")) then Else response.write "" End If If RS("Cal_EventImage") = "" or IsNull(RS("Cal_EventImage")) then Else response.write "" End If If Session("User1Name") = "" or IsNull(Session("User1Name")) then Else response.write "" End If If Session("User2Name") = "" or IsNull(Session("User2Name")) then Else response.write "" End If If Session("User3Name") = "" or IsNull(Session("User3Name")) then Else response.write "" End If If Session("User4Name") = "" or IsNull(Session("User4Name")) then Else response.write "" End If If Session("User5Name") = "" or IsNull(Session("User5Name")) then Else response.write "" End If response.write "
Dates:" & FormatDateTime(RS("Cal_EventStartDate"),1) If RS("Cal_EventStartDate") <> RS("Cal_EventEndDate") then response.Write " - " & FormatDateTime(RS("Cal_EventEndDate"),1) End If response.Write "
Title:" & RS("Cal_EventTitle") & "
Description:" & RS("Cal_EventBody") & "
Times:ALL DAY EVENT
Times:" & FormatTime(RS("Cal_EventStartTime")) & " - " & FormatTime(RS("Cal_EventEndTime")) & "
Link:" & RS("Cal_EventLink") & "
Attachment:" & RS("Cal_EventImage") & "
" & Session("User1Name") & ":" & RS("Cal_EventUser1") & "
" & Session("User2Name") & ":" & RS("Cal_EventUser2") & "
" & Session("User3Name") & ":" & RS("Cal_EventUser3") & "
" & Session("User4Name") & ":" & RS("Cal_EventUser4") & "
" & Session("User5Name") & ":" & RS("Cal_EventUser5") & "
" response.write "

" '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- RS.MoveNext Loop RS.Close Set RS=Nothing Next response.write "
" PreviousMonth = DateAdd("m",-1,WorkingDate) NextMonth = DateAdd("m",1,WorkingDate) Call DrawMiniCalendar(PreviousMonth) Call DrawMiniCalendar(WorkingDate) Call DrawMiniCalendar(NextMonth) response.write "
" End Sub '********************************************************************************* '******** Draw Year View ********************************************************* '********************************************************************************* Sub DrawYearView YearsFirstDay = "1/1/" & Year(WorkingDate) YearsLastDay = "12/31/" & Year(WorkingDate) CurrentDate = WorkingDate response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" TitleToWrite = "Events between: " & FormatDateTime(YearsFirstDay,1) & " and " & FormatDateTime(YearsLastDay,1) & "" Call DrawTitle("100%","24",TitleToWrite,"11pt") Call DrawHLine(2) For I = 1 to 12 If I > 1 then WorkingDate = DateAdd("m",1,WorkingDate) End If '------- Setup some information about the month ----------------- ThisMonthsFirstDay = Year(WorkingDate) & "-" & Month(WorkingDate) & "-1" NextMonthsFirstDay = dateAdd("m",1,ThisMonthsFirstDay) ThisMonthsLastDay = dateadd("d",-1,NextMonthsFirstDay) LastMonthsLastDay = dateadd("d",-1,ThisMonthsFirstDay) TitleToWrite = "Events for: " & MonthName(Month(WorkingDate)) & " " & Year(WorkingDate) & "" Call DrawSmallTitle("100%","18",TitleToWrite,"9pt") '----- Draw out the events ----------------------------------------------------- If Session("CalendarFilter") > 0 then SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventCalendarID = "& Session("CalendarFilter") &" AND Cal_EventStartDate >= " & DateQualifier & ThisMonthsFirstDay & DateQualifier & " AND Cal_EventEndDate <= " & DateQualifier & ThisMonthsLastDay & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartDate, Cal_EventStartTime, Cal_EventEndTime" Else SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventStartDate >= " & DateQualifier & ThisMonthsFirstDay & DateQualifier & " AND Cal_EventEndDate <= " & DateQualifier & ThisMonthsLastDay & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartDate, Cal_EventStartTime, Cal_EventEndTime" End If Set RS=dbc.execute(SQL) If RS.EOF then '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- response.write "" response.write "There are no events on this date." response.write "" '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- End If Do While NOT RS.EOF '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- EventColor = "gray" SQLc = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarID = " & SafeSQL(RS("Cal_EventCalendarID")) Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then EventColor = RSc("Cal_CalendarColor") End If RSc.Close Set RSc=Nothing response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" Else response.write "" End If response.write "" response.write "" response.write "
" response.write RS("Cal_EventTitle") response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventAllDay") = "TRUE" then response.write "" Else response.write "" End If If RS("Cal_EventLink") = "" or IsNull(RS("Cal_EventLink")) then Else response.write "" End If If RS("Cal_EventImage") = "" or IsNull(RS("Cal_EventImage")) then Else response.write "" End If If Session("User1Name") = "" or IsNull(Session("User1Name")) then Else response.write "" End If If Session("User2Name") = "" or IsNull(Session("User2Name")) then Else response.write "" End If If Session("User3Name") = "" or IsNull(Session("User3Name")) then Else response.write "" End If If Session("User4Name") = "" or IsNull(Session("User4Name")) then Else response.write "" End If If Session("User5Name") = "" or IsNull(Session("User5Name")) then Else response.write "" End If response.write "
Dates:" & FormatDateTime(RS("Cal_EventStartDate"),1) If RS("Cal_EventStartDate") <> RS("Cal_EventEndDate") then response.Write " - " & FormatDateTime(RS("Cal_EventEndDate"),1) End If response.Write "
Title:" & RS("Cal_EventTitle") & "
Description:" & RS("Cal_EventBody") & "
Times:ALL DAY EVENT
Times:" & FormatTime(RS("Cal_EventStartTime")) & " - " & FormatTime(RS("Cal_EventEndTime")) & "
Link:" & RS("Cal_EventLink") & "
Attachment:" & RS("Cal_EventImage") & "
" & Session("User1Name") & ":" & RS("Cal_EventUser1") & "
" & Session("User2Name") & ":" & RS("Cal_EventUser2") & "
" & Session("User3Name") & ":" & RS("Cal_EventUser3") & "
" & Session("User4Name") & ":" & RS("Cal_EventUser4") & "
" & Session("User5Name") & ":" & RS("Cal_EventUser5") & "
" response.write "

" RS.MoveNext '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- Loop RS.Close Set RS=Nothing Next response.write "
" PreviousMonth = DateAdd("m",-1,CurrentDate) NextMonth = DateAdd("m",1,CurrentDate) Call DrawMiniCalendar(PreviousMonth) Call DrawMiniCalendar(CurrentDate) Call DrawMiniCalendar(NextMonth) response.write "
" End Sub '********************************************************************************* '******** Draw View Event ******************************************************** '********************************************************************************* Sub DrawViewEvent response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" TitleToWrite = "Event View: " Call DrawTitle("100%","24",TitleToWrite,"11pt") Call DrawHLine(2) SQL = "SELECT * FROM Cal_Events WHERE Cal_EventID = " & SafeSQL(request.querystring("eventid")) Set RS=dbc.execute(SQL) If NOT RS.EOF then '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- EventColor = "gray" SQLc = "SELECT * FROM Cal_Calendars WHERE Cal_CalendarID = " & SafeSQL(RS("Cal_EventCalendarID")) Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then EventColor = RSc("Cal_CalendarColor") End If RSc.Close Set RSc=Nothing response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventUser5") <> "" then response.write "" Else response.write "" End If response.write "" response.write "" response.write "
" response.write RS("Cal_EventTitle") response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If RS("Cal_EventAllDay") = "TRUE" then response.write "" Else response.write "" End If If RS("Cal_EventLink") = "" or IsNull(RS("Cal_EventLink")) then Else response.write "" End If If RS("Cal_EventImage") = "" or IsNull(RS("Cal_EventImage")) then Else response.write "" End If If Session("User1Name") = "" or IsNull(Session("User1Name")) then Else response.write "" End If If Session("User2Name") = "" or IsNull(Session("User2Name")) then Else response.write "" End If If Session("User3Name") = "" or IsNull(Session("User3Name")) then Else response.write "" End If If Session("User4Name") = "" or IsNull(Session("User4Name")) then Else response.write "" End If If Session("User5Name") = "" or IsNull(Session("User5Name")) then Else response.write "" End If response.write "
Dates:" & FormatDateTime(RS("Cal_EventStartDate"),1) If RS("Cal_EventStartDate") <> RS("Cal_EventEndDate") then response.Write " - " & FormatDateTime(RS("Cal_EventEndDate"),1) End If response.Write "
Title:" & RS("Cal_EventTitle") & "
Description:" & RS("Cal_EventBody") & "
Times:ALL DAY EVENT
Times:" & FormatTime(RS("Cal_EventStartTime")) & " - " & FormatTime(RS("Cal_EventEndTime")) & "
Link:" & RS("Cal_EventLink") & "
Attachment:" & RS("Cal_EventImage") & "
" & Session("User1Name") & ":" & RS("Cal_EventUser1") & "
" & Session("User2Name") & ":" & RS("Cal_EventUser2") & "
" & Session("User3Name") & ":" & RS("Cal_EventUser3") & "
" & Session("User4Name") & ":" & RS("Cal_EventUser4") & "
" & Session("User5Name") & ":" & RS("Cal_EventUser5") & "
" response.write "

" '---- Indent the events ---------------------------------------------------------------------------- response.write "
" '--------------------------------------------------------------------------------------------------- End If RS.Close Set RS=Nothing response.write "
" PreviousMonth = DateAdd("m",-1,WorkingDate) NextMonth = DateAdd("m",1,WorkingDate) Call DrawMiniCalendar(PreviousMonth) Call DrawMiniCalendar(WorkingDate) Call DrawMiniCalendar(NextMonth) response.write "
" End Sub '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '******** FUNCTIONS ONLY BELOW HERE ************************************************* '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '************************************************************************************ '********************************************************************************* '******** Build Style Tags ******************************************************* '********************************************************************************* Sub BuildStyles StyleCode = "" StyleCode = StyleCode & ".TableMonthHeader{font-family:" & MainFontFace & ";font-size:9pt;font-weight:bold;color:black}" & vbcrlf StyleCode = StyleCode & ".MonthHeadings{width:14%;text-align:center;font-size:9pt;font-family:" & MainFontFace & ";background-color:" & DarkMainColor & ";border-top:1px solid " & LightLineColor & ";border-bottom:1px solid " & LightLineColor & ";color:white;font-weight:bold;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightMainColor & "', EndColorStr='" & DarkMainColor & "')}" & vbcrlf StyleCode = StyleCode & ".TableMonthCalendar{font-family:" & MainFontFace & ";height:95%;padding:0;background-color:white;border-collapse:collapse;border-style:none;border-color:" & LightLineColor & ";}" & vbcrlf StyleCode = StyleCode & ".TableMonthDayCellToday{font-family:" & MainFontFace & ";border-style:solid;border-width:1;border-color:" & LightLineColor & ";text-align:left;vertical-align:top;background-color:#CCCCCC;}" & vbcrlf StyleCode = StyleCode & ".TableMonthDayCell{font-family:" & MainFontFace & ";border-style:solid;border-width:1;border-color:" & LightLineColor & ";text-align:left;vertical-align:top;background-color:#FFFFFF;border-collapse:collapse;}" & vbcrlf StyleCode = StyleCode & ".MonthSubHeadings{font-family:" & MainFontFace & ";font-size:8pt;background-color:" & MidLightColor & ";color:black;font-weight:normal;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightColor & "', EndColorStr='" & MidLightColor & "')}" & vbcrlf StyleCode = StyleCode & ".TableMonthOtherDayCell{font-family:" & MainFontFace & ";border-style:solid;border-width:1;border-color:" & LightLineColor & ";text-align:center;vertical-align:top;background-color:" & MidLightColor & ";border-collapse:collapse;}" & vbcrlf StyleCode = StyleCode & ".EventTable{font-family:" & MainFontFace & ";border-style:solid;border-width:1;border-color:black;border-collapse:collapse;border-width:1;text-align:left;background-color:white;padding:1;width:100%;}" & vbcrlf StyleCode = StyleCode & ".EventTitleFont{font-family:" & MainFontFace & ";font-size:7pt;}" & vbcrlf StyleCode = StyleCode & ".EventTimeCell{font-family:" & MainFontFace & ";font-size:7pt;width:10%;text-align:left;background-color:#DDDDDD;}" & vbcrlf StyleCode = StyleCode & ".EventTimeFont{font-family:" & MainFontFace & ";font-size:7pt;}" & vbcrlf StyleCode = StyleCode & ".EventTitleCell{font-family:" & MainFontFace & ";font-size:7pt;width:90%;text-align:left;background-color:white;}" & vbcrlf StyleCode = StyleCode & ".EventTitleFont{font-family:" & MainFontFace & ";font-size:7pt;}" & vbcrlf StyleCode = StyleCode & ".EventTitleCellAllDay{font-family:" & MainFontFace & ";font-size:7pt;text-align:center}" & vbcrlf StyleCode = StyleCode & ".MonthDayDiv{width:100%;height:85%;overflow:visible;}" & vbcrlf StyleCode = StyleCode & ".MiniHeadingBar{background-color:" & LightMainColor & ";height:19px;text-align:center;border-top:1px solid " & LightLineColor & ";border-bottom:1px solid " & LightLineColor & ";font-family:" & MainFontFace & ";font-size:8pt;color:black;font-weight:bold;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightColor & "', EndColorStr='" & MidLightColor & "')}" & vbcrlf StyleCode = StyleCode & ".TableMiniHeader{height:1;padding:0;background-color:white;border-style:solid;border-color:" & LightLineColor & ";border-width:0;border-collapse:collapse;}" & vbcrlf StyleCode = StyleCode & ".MiniCalHeading{width:14%;font-family:" & MainFontFace & ";font-size:8pt;color:black;font-weight:normal;background-color:" & LightColor & ";text-align:center;}" & vbcrlf StyleCode = StyleCode & ".TableMiniCalendar{padding:0;background-color:white;border-collapse:collapse;border-width:0;border-style:none;}" & vbcrlf StyleCode = StyleCode & ".TableMiniDayCellToday{border-style:solid;border-width:1;border-color:white;text-align:center;vertical-align:top;background-color:silver;padding:0;}" & vbcrlf StyleCode = StyleCode & ".TableMiniDayCell{border-style:solid;border-width:1;border-color:white;text-align:center;vertical-align:center;background-color:white;padding:0;border-collapse:collapse;cursor:hand;}" & vbcrlf StyleCode = StyleCode & ".TableMiniDayCellWithEvent{border-style:solid;border-width:1;border-color:white;text-align:center;vertical-align:center;background-color:" & PrimaryHighlightColor & ";padding:0;border-collapse:collapse;cursor:hand}" & vbcrlf StyleCode = StyleCode & ".FontCalendarDay{font-family:" & MainFontFace & ";font-size:7pt;}" & vbcrlf StyleCode = StyleCode & ".TableMiniOtherDayCell{border-style:solid;border-width:1;border-color:white;text-align:center;vertical-align:center;background-color:" & MidLightColor & ";padding:0;border-collapse:collapse;}" & vbcrlf StyleCode = StyleCode & ".EventLeftTD{width:20%;font-family:" & MainFontFace & ";font-size:8pt;font-weight:bold;background-color:" & LightColor & ";}" & vbcrlf StyleCode = StyleCode & ".EventRightTD{width:80%;font-family:" & MainFontFace & ";font-size:8pt;}" & vbcrlf StyleCode = StyleCode & ".EventTitleBar{background-color:" & MidLightColor & ";height:19px;text-align:left;border-top:1px solid " & LightLineColor & ";border-bottom:1px solid " & LightLineColor & ";font-family:" & MainFontFace & ";font-size:10pt;color:black;font-weight:bold;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightMainColor & "', EndColorStr='" & MidLightColor & "')}" & vbcrlf StyleCode = StyleCode & ".ButtonBar{background-color:" & LightColor & ";padding-top:1px;width:100%;height:30px;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightColor & "', EndColorStr='" & MidLightColor & "')}" & vbcrlf StyleCode = StyleCode & ".Button{background-color:" & LightColor & ";cursor:hand;padding:1px 1px 1px 1px;height:27px;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & LightColor & "', EndColorStr='" & MidLightColor & "')}" & vbcrlf StyleCode = StyleCode & ".ButtonOver{background-color:" & MidLightColor & ";cursor:hand;border: 1px solid " & LightLineColor & ";height:27px;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='" & PrimaryHighlightColor & "', EndColorStr='" & SecondaryHighlightColor & "')}" & vbcrlf StyleCode = StyleCode & ".ButtonFont{font-family:" & MainFontFace & ";font-size:9pt;font-weight:bold;}" & vbcrlf StyleCode = StyleCode & ".PageBody{background-color:" & DarkMainColor & ";filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='" & LightMainColor & "', EndColorStr='" & DarkMainColor & "')}" & vbcrlf StyleCode = StyleCode & ".SideBar{background-color:" & DarkMainColor & ";filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='" & LightMainColor & "', EndColorStr='" & DarkMainColor & "')}" & vbcrlf StyleCode = StyleCode & ".StandardFont{font-family:" & MainFontFace & ";font-size:8pt;color:black;font-weight:bold;}" & vbcrlf StyleCode = StyleCode & ".StandardTextBox{font-family:" & MainFontFace & ";font-size:8pt;color:black;font-weight:normal;width:100%;}" & vbcrlf StyleCode = StyleCode & ".DescriptionHeadingFont{font-family:" & MainFontFace & ";font-size:13pt;color:yellow;font-weight:bold;}" & vbcrlf StyleCode = StyleCode & ".DescriptionFont{font-family:" & MainFontFace & ";font-size:8pt;color:white;font-weight:normal;}" & vbcrlf StyleCode = StyleCode & ".EditPaneTable{width:99%; border:0px;}" & vbcrlf StyleCode = StyleCode & ".EditPaneLeft{width:25%;font-family:Arial;font-size:8pt;}" & vbcrlf StyleCode = StyleCode & ".EditPaneRight{width:75%;font-family:Arial;font-size:8pt;}" & vbcrlf StyleCode = StyleCode & ".ErrorFont{font-family:" & MainFontFace & ";font-size:8pt;color:red;font-weight:bold;}" & vbcrlf Session("StyleCode") = StyleCode End Sub '********************************************************************************* '******** Load the Template File We are Using ************************************ '********************************************************************************* Sub LoadTemplate Call BuildStyles TemplateFile = Server.MapPath(HTMLTemplate) Set fs = CreateObject("Scripting.FileSystemObject") Set thisfile = fs.OpenTextFile(TemplateFile, 1, False) tempSTR=thisfile.readall TemplateContent = tempSTR thisfile.Close set thisfile=nothing set fs=nothing TemplateContent = replace(TemplateContent,"%%STYLES%%",Session("StyleCode")) TemplateArray = split(TemplateContent,"%%CONTENT%%") Session("PageHeader") = TemplateArray(0) Session("PageFooter") = TemplateArray(1) Session("TemplateLoaded") = "YES" End Sub '********************************************************************************* '******** Draw Summary Window **************************************************** '********************************************************************************* Sub DrawSummary %> <% End Sub '********************************************************************************* '******** Draw Summary Window **************************************************** '********************************************************************************* Sub DrawSummary2 %> <% End Sub '************************************************************************************ '***** Universal Date Format Function *********************************************** '************************************************************************************ Function UniversalDate(dteDate) If IsDate(dteDate) = True Then dteDay = Day(dteDate) dteMonth = Month(dteDate) dteYear = Year(dteDate) UniversalDate = dteYear & "-" & Right(Cstr(dteMonth + 100),2) & "-" & Right(Cstr(dteDay + 100),2) Else UniversalDate = Null End If End Function '************************************************************************************ '***** Display Date Format Function ************************************************* '************************************************************************************ Function FormatDisplayDate(aDate) aDate = cdate(aDate) aDay = Day(aDate) aMonth = Month(aDate) aYear = Year(aDate) SELECT CASE DateDisplayFormat CASE "US" FormatDisplayDate = Right(Cstr(aMonth + 100),2) & "/" & Right(Cstr(aDay + 100),2) & "/" & aYear CASE "EURO" CASE "UNIVERSAL" CASE ELSE FormatDisplayDate = Right(Cstr(aMonth + 100),2) & "-" & Right(Cstr(aDay + 100),2) & "-" & aYear END SELECT End Function '********************************************************************************* '******** Determine Browser Type ************************************************* '********************************************************************************* Function GetBrowserType(BrowserAgent) If InStr(BrowserAgent, UCASE("MSIE")) then Browser = "Microsoft Internet Explorer" Else Browser = "OTHER" End If GetBrowserType = Browser End Function '*************************************************************************************** '****** Generic DB Record Add ********************************************************** '*************************************************************************************** Sub DBAddRecord TableName = Request("TableName") RedirURL = Request("RedirURL") Set RS = Server.CreateObject("ADODB.Recordset") RS.MaxRecords = 1 RS.Open "SELECT * FROM " & TableName , dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew For Each strColumnName in Request.Form If UCase(Left(strColumnName,3)) = "COL" then If Len(Request(strColumnName)) > 0 Then RS(Mid(strColumnName,4,Len(strColumnName))) = Request(strColumnName) 'response.write (Mid(strColumnName,4,Len(strColumnName))) & " = " & Request(strColumnName) & "
" End If End If Next RS.Update RS.Close Set RS = Nothing response.redirect RedirURL End Sub '*************************************************************************************** '****** Generic DB Record Update ******************************************************* '*************************************************************************************** Sub DBUpdateRecord TableKey = Request("TableKey") RecordID = Request("RecordID") TableName = Request("TableName") RedirURL = Request("RedirURL") SQL="UPDATE " & TableName & " SET " For Each strColumnName in Request.Form If UCase(Left(strColumnName,3)) = "COL" then 'If Len(Request(strColumnName)) > 0 Then SQL = SQL & Mid(strColumnName,4,Len(strColumnName)) & " = '" & FixString(Request(strColumnName)) & "'," 'End If End If Next SQL = Left(SQL, len(SQL)-1) SQL = SQL & " WHERE [" & TableKey & "] = " & RecordID dbc.execute(SQL) 'response.write SQL If request.form("from") = "editconfig" then Session("ConfigLoaded") = "NO" End If response.redirect RedirURL End Sub '********************************************************************************* '***** Format Time Function ****************************************************** '********************************************************************************* Function FormatTime(TimeValue) If TimeFormatToUse = "12" then TimeValue = replace(TimeValue," ","") TimeValue = replace(TimeValue,":","") TimeValue = replace(TimeValue,".","") TimeValue = replace(TimeValue,"-","") TimeValue = replace(TimeValue,"e","") TimeValue = replace(TimeValue,"E","") TimeValue = replace(TimeValue,"M","") TimeValue = replace(TimeValue,"m","") If NOT ((ucase(right(TimeValue,1))="A") or (ucase(right(TimeValue,1))="P")) then TimeFormat = "24" Else TempAMPM = ucase(right(TimeValue,1) & "M") End If TimeLength = len(TimeValue)-1 StripTime = left(TimeValue,TimeLength) If len(StripTime) > 4 then StripTime = left(StripTime,len(StripTime)-2) End If If len(StripTime) = 3 then TimePartA = abs(left(StripTime,1)) Else TimePartA = abs(left(StripTime,2)) TimePartB = abs(left(StripTime,2)) End If If left(TimePartA, 1) = 0 then TimePartA = right(TimePartA, len(TimePartA)-1) End If TimePartB = right(StripTime,2) TempTime = TimePartA & ":" & TimePartB & TempAMPM FormatTime = TempTime Else TempTimeValue = left(TimeValue, 5) FormatTime = TempTimeValue End If End Function '********************************************************************************* '***** Format Time Function ****************************************************** '********************************************************************************* Function FormatTime2(TimeValue) If TimeFormatToUse = "12" then TimeValue = replace(TimeValue," ","") TimeValue = replace(TimeValue,":","") TimeValue = replace(TimeValue,".","") TimeValue = replace(TimeValue,"-","") TimeValue = replace(TimeValue,"e","") TimeValue = replace(TimeValue,"E","") TimeValue = replace(TimeValue,"M","") TimeValue = replace(TimeValue,"m","") If NOT ((ucase(right(TimeValue,1))="A") or (ucase(right(TimeValue,1))="P")) then TimeFormat = "24" Else TempAMPM = ucase(right(TimeValue,1) & "M") End If TimeLength = len(TimeValue)-1 StripTime = left(TimeValue,TimeLength) If len(StripTime) > 4 then StripTime = left(StripTime,len(StripTime)-2) End If If len(StripTime) = 3 then TimePartA = abs(left(StripTime,1)) Else TimePartA = abs(left(StripTime,2)) TimePartB = abs(left(StripTime,2)) End If If left(TimePartA, 1) = 0 then TimePartA = right(TimePartA, len(TimePartA)-1) End If TimePartB = right(StripTime,2) TempTime = TimePartA & ":" & TimePartB & " " & TempAMPM FormatTime2 = TempTime Else Dim hour,minute hour = left(TimeValue, 2) minute = left(TimeValue, 5) minute = right(minute, 2) If right(hour, 1) = ":" then hour = left(hour, 1) End If If left(hour, 1) = "0" then hour = right(hour, 1) End If If right(minute,1) = ":" then minute = left(minute,1) & "0" End If If hour < 12 then clocktime = hour & ":" & minute & " AM" Else If hour <> 12 then hour = hour - 12 End If clocktime = hour & ":" & minute & " PM" End If StandardTime = clocktime TempTimeValue = StandardTime FormatTime2 = TempTimeValue End If End Function '********************************************************************************* '******* Check Day For Event ***************************************************** '********************************************************************************* Function CheckForEvent(DateToUse) If Session("CalendarFilter") > 0 then SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventCalendarID = "& Session("CalendarFilter") &" AND Cal_EventStartDate <= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" Else SQL = "SELECT * FROM Cal_Events WHERE Cal_EventCalendarID IN(" & PublishedCalendars & ") AND Cal_EventStartDate <= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventEndDate >= " & DateQualifier & DateToUse & DateQualifier & " AND Cal_EventCalendarID > 0 ORDER BY Cal_EventStartTime" End If Set RS=dbc.execute(SQL) Return = "NO" Do While NOT RS.EOF Return = "YES" Exit Do RS.MoveNext Loop RS.Close Set RS=Nothing CheckForEvent = Return End Function '********************************************************************************* '******** Draw Horizontal Line *************************************************** '********************************************************************************* Sub DrawHLine(LineWidth) response.write "
" response.write "
" End Sub '********************************************************************************* '******** Draw Title ************************************************************* '********************************************************************************* Sub DrawTitle(TitleWidth,TitleHeight,TitleToWrite,FontPoint) response.write "
" response.write "" & TitleToWrite & "" response.write "
" End Sub '********************************************************************************* '******** Draw Title 2 *********************************************************** '********************************************************************************* Sub DrawTitle2(TitleWidth,TitleHeight,TitleToWrite,FontPoint) response.write "
" response.write "" & TitleToWrite & "" response.write "
" End Sub '********************************************************************************* '******** Draw Title ************************************************************* '********************************************************************************* Sub DrawSmallTitle(TitleWidth,TitleHeight,TitleToWrite,FontPoint) response.write "
" response.write "" & TitleToWrite & "" response.write "
" End Sub '********************************************************************************* '******** Draw Button ************************************************************ '********************************************************************************* Sub DrawButton(ButtonImage, ButtonAlt, ButtonText, ButtonAction, ButtonWidth) response.write "" If ButtonAction <> "" then response.write "
" Else response.write "
" End If response.write "" response.write "" If ButtonImage <> "" then response.write "" End If If ButtonText <> "" then response.write "" End If response.write "" response.write "
" & ButtonAlt & " " & ButtonText & "
" response.write "
" response.write "" End Sub '********************************************************************************* '******** Draw Bad Browser Button ************************************************ '********************************************************************************* Sub DrawBadBrowserButton(ButtonImage, ButtonAlt, ButtonText, ButtonAction, ButtonWidth) response.write "" If ButtonAction <> "" then response.write "
" response.write "" End If response.write "" response.write "" If ButtonImage <> "" then response.write "" End If If ButtonText <> "" then response.write "" End If response.write "" response.write "
" & ButtonAlt & " " & ButtonText & "
" If ButtonAction <> "" then response.write "
" End If response.write "
" response.write "" End Sub '********************************************************************************* '******** Draw Button Seperator ************************************************** '********************************************************************************* Sub DrawButtonSep response.write "" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "
" response.write "" End Sub '********************************************************************************* '******** Draw Calendar Selector ************************************************* '********************************************************************************* Sub DrawCalendarSelector response.write "" response.write "
" response.write "" response.write "
" response.write "" End Sub '********************************************************************************* '******** Draw Time Drop Down **************************************************** '********************************************************************************* Sub CreateTimeDropDown(TimeToWrite, PartOfDay, WhichField) If TimeFormatToUse = "12" then If TimeToWrite <> "12" then response.write "" response.write "" response.write "" response.write "" Else If PartOfDay = "AM" then response.write "" response.write "" response.write "" response.write "" Else response.write "" End If End If Else If TimeToWrite <> "12" then response.write "" response.write "" response.write "" response.write "" Else response.write ">" & TimeToWrite & ":00 " response.write "" response.write "" response.write "" End If Else response.write ">" & cint(TimeToWrite) + 12 & ":00 " response.write "" response.write "" response.write "" End If Else If PartOfDay = "AM" then response.write "" response.write "" response.write "" response.write "" Else response.write "" End If End If End If End Sub '********************************************************************************* '******** SQL Injection Filter *************************************************** '********************************************************************************* Function SafeSQL(sInput) TempString = sInput 'sBadChars=array("select", "drop", ";", "--", "insert", "delete", "xp_", "#", "%", "&", "'", "(", ")", "/", "\", ":", ";", "<", ">", "=", "[", "]", "?", "`", "|") sBadChars=array("select", "drop", ";", "--", "insert", "delete", "xp_", "#", "%", "&", "'", "(", ")", ":", ";", "<", ">", "=", "[", "]", "?", "`", "|") For iCounter = 0 to uBound(sBadChars) TempString = replace(TempString,sBadChars(iCounter),"") Next SafeSQL = TempString End function '********************************************************************************* '******** FixString Function ***************************************************** '********************************************************************************* Function FixString(strSource) strSource = Replace(strSource, "'", "''") strSource = Replace(strSource, "''''", "''") FixString = Replace(strSource, "'''", "''") End Function %>