<% 'Designer: Todd Cutler (317-839-2114) 'Copyright 2002 '2.0 08/01/02 Search version of calendar with multi-library features '2.1 09/03/02 Change TABLE setting for List view to NOT be centered. ' Fixed problem with calendar not displaying correctly in maintenance modes. ' Moved EVENTTYPESEARCHENABLE = 1 & MULTILIBENABLE = 1 to defines.inc '2.2 01/08/02 Fixed problem with showing the wrong year '2.3 01/30/03 Fixed issue with Netscape 6.x and up '2.4 02/20/03 Added eventtitle in order by statement '2.5 04/21/03 Added support for no personal schedule link from="events" Response.Buffer = True Response.CacheControl="no-cache" Dim WRITESTYLES WRITESTYLES = "1" %> <% Sub Display_Date(DispType) If DispType = "list" Then Response.Write "" %> <%=DATE_LANG%>:
><%=DATE_RANGE_LANG%>
<%DisplaySelect2D "dr1Month", arrMonths, "", MonthStart, " class=dropdown ", "OnChange = getdays('dr1');", true, ""%>  <%DisplaySelect "dr1Day", GetDays(MonthStart), "", DayStart, " class=dropdown ", "", true, ""%>  <%DisplaySelect "dr1Year", aYears, "", YearStart, " class=dropdown ", "OnChange = getdays('dr1');", true, ""%>   
 <%=TO_LANG%> 
<%DisplaySelect2D "dr2Month", arrMonths, "", MonthEnd, " class=dropdown ", "OnChange = getdays('dr2');", true, ""%>  <%DisplaySelect "dr2Day", GetDays(MonthEnd), "", DayEnd, " class=dropdown ", "", true, ""%>  <%DisplaySelect "dr2Year", aYears, "", YearEnd, " class=dropdown ", "OnChange = getdays('dr2');", true, ""%>    <% Response.Write "" End If %> "calendar" and disptype <> "week" then response.Write("sd") else response.Write(Request.Form("date_type"))%>"> "> "> "calendar" and disptype <> "week" then response.Write(dtCurViewMonth)%>"> <% End Sub Sub Display_Format() Response.Write "" %> <%=DISPLAY_FORMAT_LANG%>: <%=Checked(DispType,"week")%>><%=CALENDAR_LANG%>  ><%=LIST_LANG%> <% Response.Write "" End Sub Sub Display_Zip() If ZIPENABLE = 1 Then Response.Write "" %> <%=ZIP_CODE_LANG%>: <% Response.Write "" End If End Sub Sub Display_Keyword() Response.Write "" %> <%=KEYWORD_LANG%>:
<%=KEYWORD_TEXT%> <% Response.Write "" End Sub Sub Display_Pub_Status () If pointer = "inhouse" Then Response.Write "" %> Publishing Filter:
>Published   >Not Published <% Response.Write "" End If End Sub Sub Display_Presenter() If PRESENTERENABLE = 1 Then Response.Write "" %> <%=PRESENTER_INSTRUCTOR_LANG%>: <% Response.Write "" End If End Sub Sub Display_AgeGroup If AGEGROUPENABLE = 1 Then Response.Write "" Response.Write ageGroupField Response.Write "" End If End Sub Sub Display_EventType() If EVENTTYPESEARCHENABLE Then Response.Write "" Response.Write eventTypeField Response.Write "" Else EventListSelect = EventListSelect & "( (eventschedule.LibNum=" & LIBRARYNUMBER & ") And libraryid=eventschedule.libnum) And" End If ' End Library Selection End Sub Sub Display_Branches() If MULTILIBENABLE Then Response.Write "" Response.Write locationField Response.Write "" Else Response.Write "" End If End Sub '*********************************** 'Display Calendar for selecting dates ' Calls: None ' Input: None ' Uses: '*********************************** Sub DisplayMonthYearOptions(Byval CheckDateVal) Response.Write "" Response.Write "" End Sub Sub DisplayTinyCal(strsql) %>
< <% DisplayMonthYearOptions dtCurViewMonth %> >
<% For iDay = vbSunday To vbSaturday %> <%Next %> <% StrSql = "SELECT DISTINCT Eventdate FROM (eventschedule,libraryinfo)" _ & EventListJoin _ & AgeGroupJoin _ & " WHERE Level=0 AND " & AgeGroupSelect & " " & EventListSelect & " " & LocationListSelect & " " & kw_string & " " & presenterSTR & " month(EventDate)=" & month(dtCurViewMonth) & " AND year(EventDate)=" & year(dtCurViewMonth) & " order by eventdate, eventtime, eventtitle" set tc = my_conn.Execute (StrSql) dtCurViewDay = DtPrevSunday(DateSerial(Year(dtCurViewMonth), Month(dtCurViewMonth), 1)) 'Clear day count intCount= 0 For iWeek = 0 To 5 WeekEnd = DateAdd("d", 6, dtCurViewDay) weekviewSTR = " onclick=""document.forms[0].date_type.value='';document.forms[0].dt.value='dr';"_ & "document.forms[0].ds.value='" & Year(dtCurViewDay) & "-" & Month(dtCurViewDay) & "-" & Day(dtCurViewDay) & "';"_ & "document.forms[0].de.value='" & Year(WeekEnd) & "-" & Month(WeekEnd) & "-" & Day(WeekEnd) & "';"_ & "document.forms[0].submit();""" Response.Write "" & vbCrLf weekFlag = 0 For iDay = 0 To 6 sClass = "class='calendar_day'" If Month(dtCurViewDay) = Month(dtCurViewMonth) Then weekFlag = 1 If dtCurViewDay = dtToday Then sClass = "class='calendar_current_day'" Else sClass = "class='calendar_day'" End If If Month(dtCurViewDay) = Month(dtCurViewMonth) Then Response.Write "" & vbCrLf weekNum = DatePart("ww", dtCurViewDay) dtCurViewDay = DateAdd("d", 1, dtCurViewDay) Next Response.Write "" & vbCrLf Response.Write "" & vbCrLf Next %>
<%=sWeekDayAbr(iDay-1)%>W
" '---- Write day of month If Not tc.EOF Then tempDay = Day(tc("EventDate")) If Day(dtCurViewDay) = Day(tc("EventDate")) Then Response.Write "" & Day(dtCurViewDay) & "" tempDay = Day(tc("EventDate")) Do until x=1 tc.MoveNext If NOT tc.EOF Then If Day(tc("EventDate")) <> tempDay Then Exit Do End If Else Exit Do End If Loop Else Response.Write Day(dtCurViewDay) End If Else Response.Write Day(dtCurViewDay) End If Else Response.Write "" End If Response.Write "" sClass = "class='tinycal_day'" If weekFlag=1 Then Response.Write weekNum & "
" End If Response.Write "

<% End Sub 'STARTPAGE will be added to a configuration database to determine 'whether the patron side will default to calendar or search and calendar 'Get event calendar hyperlink pointer: attendance, inhouse or nothing pointer = "" pointer = Request.QueryString("pointer") If len(pointer) = 0 Then pointer = Request.Form("SavePointer") End If AgeGroup = Request.Form("AgeGroup") keyword = Request.Form("keyword") If keyword = "" Then keyword = Request.QueryString("kw") End If If pointer <> "" Then Session.Timeout=90 End If pubFilterPub = Request.Form("DispPub") If pubFilterPub = "" Then pubFilterPub = Request.QueryString("pub") End If pubFilterNoPub = Request.Form("DispNoPub") If pubFilterNoPub = "" Then pubFilterNoPub = Request.QueryString("nopub") End If If pubFilterPub = "" And pubFilterNoPub = "" Then pubFilterPub = "1" End If WindowMode = CStr(Request.QueryString("windowmode")) If WindowMode = "" Then WindowMode = Request.Form("WindowMode") End If noheader = Request.QueryString("noheader") If noheader = "" Then noheader = Request.Form("noheader") End If LookupAttendeeID = Request.QueryString("lad") If LookupAttendeeID = "" Then LookupAttendeeID = Request.Form("lad") End If %> <% If LANGENABLE = 1 Then LangType = CStr(Request.Form("LangType")) If LangType = "" Then LangType = CStr(Request.Querystring("LangType")) If LangType = "" Then LangType = CStr(DEFAULT_LANG_TYPE) End If End If LangStr = " And Lang=" & LangType Else LangType = "0" LangStr = "" End If %> <% If EVENTSENABLE = 0 Then Response.Write "

E*vents is not enabled.
Contact your supplier to have it activated.

" Response.Write "" Response.End End If Dim incval '****************************** 'Connect to MySQL database '****************************** ' Use the connection string directly as entered from the wizard set my_conn = CreateObject("ADODB.Connection") my_Conn.Open "DSN=" & DSNNAME If Err.Description <> "" Then Response.Write "Database Error: " + Err.Description + "" End If getSettings = "SELECT DISTINCT SEARCHENABLE,SearchWindowState,EventsDefaultView, EventsDefaultViewStaff, HIDEPATRONSCHED,CALTIMEDISPLAY,COMBINEDCALHEADER FROM configsystem WHERE LibNum='" & LIBRARYNUMBER & "'" set fp_rs = my_conn.Execute(getSettings) SEARCHENABLE = fp_rs("SEARCHENABLE") SearchWindowState = fp_rs("SearchWindowState") EventsDefaultViewPatron = fp_rs("EventsDefaultView") EventsDefaultViewStaff = fp_rs("EventsDefaultViewStaff") HIDEPATRONSCHED = fp_rs("HIDEPATRONSCHED") CALTIMEDISPLAY = fp_rs("CALTIMEDISPLAY") COMBINEDCALHEADER = fp_rs("COMBINEDCALHEADER") '******************************************************* ' Adjust strings for single ("'") and double ("") quotes ' Calls: Replace (VBScript Function) ' Returns: new string with adjusted ' & " '******************************************************* Function modstr(str) 'modstr = Replace(str, "'", "\'") modstr = Replace(Replace(str, "'", "\'"), CHR(34), """) End Function Function FormatStr(String) String = Replace(String, CHR(13), "") String = Replace(String, CHR(10) & CHR(10), "

") String = Replace(String, CHR(10), "
") FormatStr = String End Function Function MakeTime(TimeVal) EventHour = Hour(TimeVal) If EventHour = 0 And Minute(TimeVal) <> 1 Then TimeRet = 0 Else If EventHour > 12 Then EventHour = EventHour - 12 AMPM = "PM" ElseIf EventHour = 12 Then AMPM = "PM" Else If EventHour = 0 Then EventHour = 12 End If AMPM = "AM" End If EventMinute = Minute(TimeVal) If EventMinute <= 9 Then EventMinute = "0" & EventMinute End If TimeRet = EventHour & ":" & EventMinute & " " & AMPM End If MakeTime = TimeRet End Function '****************************** 'Check whether or not a checkbox should be checked 'return CHECKED if value is 1 ' Calls: None ' Input: CheckValue - Compare to 1 ' Returns: "CHECKED" '****************************** Function Checked(FirstVal, SecondVal) If FirstVal = SecondVal Then Checked = " CHECKED" End If End Function '****************************** 'Check whether or not a drop-down box item is selected 'return SELECTED if values match ' Calls: None ' Input: FirstVal - First value to compare ' SecondVal - Second value to compare agains firstvalue for match ' Returns: "SELECTED" '****************************** Function Selected(FirstVal, SecondVal) If FirstVal = SecondVal Then Selected = " SELECTED" End If End Function 'Get calendar number from link CalNum = Request.QueryString("num") If CalNum = "" Then 'Get calendar number from hidden value CalNum = Request.Form("CalNum") If CalNum = "" Then CalNum = Request.QueryString("cn") If CalNum = "" Then CalNum = 0 End If End If End If If pointer = "inhouse" or pointer = "attendance" Then EventsDefaultView = EventsDefaultViewStaff Else EventsDefaultView = EventsDefaultViewPatron End If TableStr = Request.Form("TableStr") DispType = Request.Form("DispType") If DispType = "" Then DispType = Request.Form("SaveDispType") If DispType = "" Then DispType = Request.QueryString("df") If DispType = "" Then If EventsDefaultView = 0 Then DispType = "calendar" ElseIf EventsDefaultView = 1 Then DispType = "list" End If End If End If End If If DispType = "calendar" Then QPrintMode = "&df=cal" Else QPrintMode = "&df=list" End If CalNum = UCase(CalNum) If CalNum <> "ALL" Then CalNumVal = CalNum Else CalNumVal = 0 End If 'Set CalNum for permalink cnvSTR = "CalNum ='" & CalNumVal & "'" QcnvSTR = "&cn=" & CalNumVal PrivateVal = CStr(Request.QueryString("private")) If PrivateVal = "" Then PrivateVal = 0 End If pvSTR = " And Private='" & PrivateVal & "' AND NotPublished = '0'" QpvSTR = "&private=" & PrivateVal nopw = Request.QueryString("nopw") If nopw = "" Then nopw = Request.Form("nopw") End if 'Check for valid login (Added 05/03/02) If pointer <> "" And EVENTSPASSWORDENABLE = 1 AND nopw <> "1" Then PWSession = DSNNAME & "allowevents" & LIBRARYNUMBER If session(PWSession) = False And session("eventsBranch") <> MASTERBRANCH Then Response.Redirect "maintenance.asp" ElseIf CInt(session(DSNNAME & "allowevents" & LIBRARYNUMBER)) > RONLY Or CInt(session(DSNNAME & "allowevents999")) > RONLY Then AddLinkFlag = true AddEventLink = "  [+]" End If End If 'Get Previous Signup Entry ID, if available AttendeeID = Request.QueryString("ad") If AttendeeID = "" Then AttendeeID = Request.Form("ad") End If %><% Dim dtToday dtToday = DateAdd("h",HOUROFFSET,Now()) dtToday = cDate(FormatDateTime(month(dtToday) & "/" & Day(dtToday) & "/" & Year(dtToday))) 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 Month or Year were selected, build the date from the month and year If Request.Form("CURDATE_month") = "" then tmpMonth = month(now()) Else tmpMonth = Request.Form("CURDATE_month") tmpDate = "1 " & tmpMonth & " 1999" tmpMonth = Month(tmpDate) End If If Request.Form("CURDATE_year") = "" then If Request.Form("saved_year") = "" then tmpyear = year(now()) Else tmpyear = Request.Form("saved_year") End If Else tmpyear = Request.Form("CURDATE_year") End If frmDate = DateSerial(tmpyear, tmpMonth, 1) If Request("CURDATE") <> "" then frmDate= Request("CURDATE") CurDate = frmDate ElseIf Request.Form("viewIndividualDate") = "true" And Request.Form("view_date") <> "" then frmDate= DateSerial(year(Request.Form("view_date")), month(Request.Form("view_date")), day(Request.Form("view_date"))) ElseIf Request.Form("view_date") <> "" then frmDate= DateSerial(year(Request.Form("view_date")), month(Request.Form("view_date")), 1) End If ' 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 = DateSerial(year(dt), month(dt), day(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 Request.Form("direction") = "subPrev" Then dtCurViewMonth = DateAdd("m", -1, frmDate) ' if next button was hit on the form ElseIf Request.Form("direction") = "subNext" Then dtCurViewMonth = DateAdd("m", 1, frmDate) ' any other time Else ' date add in text box If frmDate <> "" then dtCurviewMonth = frmDate Else dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1) End If End If zipSql = "SELECT * FROM t_listitems WHERE listname='ZipCode'" set fp_rs = my_conn.Execute (zipSql) If NOT fp_rs.EOF Then ZIPENABLE = 1 Else ZIPENABLE = 0 End If set fp_rs = my_conn.Execute ("SELECT * FROM instructorlist") If NOT fp_rs.EOF Then PRESENTERENABLE = 1 Else PRESENTERENABLE = 0 End If REM --------BEGINNING OF DRAW CALENDAR SECTION-------- REM This section executes the event query and draws a matching calendar. Dim iDay, iWeek, intCount 'Determine number of libraries in filter/search Dim LibSearchArr transfer = Request.QueryString("transfer") If transfer = "" Then transfer = Request.Form("transfer") End If LibSearchStr = Request.Form("Lib") If LibSearchStr = "" Then LibSearchSTR = Request.QueryString("ln") End If LibSearchArr = Split(LibSearchStr, ", ") If ubound(LibSearchArr) = -1 Then LibSearchStr = Request.Querystring("Lib") LibSearchArr = Split(LibSearchStr, ", ") End If tempTotal = ubound(LibSearchArr) If LibSearchStr = "All" And transfer = "Y" Then LIBRARYNUMBER = 999 End If If LIBRARYNUMBER = 999 And LibSearchStr = "" Then TotalLibSelected = 2 LibSearchStr = "ALL" Else TotalLibSelected = ubound(LibSearchArr) + 1 End If If TotalLibSelected > 1 Or LibSearchStr="ALL" Or LIBRARYNUMBER = 999 Then CalHeaderStr = Request.Querystring("pagetitle") CalTitleStr = Request.Querystring("windowtitle") If CalHeaderStr <> "" And CalTitleStr = "" Then CalTitleStr = CalHeaderStr ElseIf CalHeaderStr = "" Then CalTitleStr = Replace(COMBINEDCALHEADER, "
", " ") '*** COMBINEDCALTITLE *** CalTitleStr = Replace(COMBINEDCALHEADER, "
", " ") CalHeaderStr = COMBINEDCALHEADER End If CalLibVal = NOLIBHEADER HOMEPAGE = "" strSql = "SELECT homepage FROM libraryinfo WHERE Libraryid=999" set fp_rs = my_Conn.Execute (strSql) GetHomeFlag = 0 If fp_rs.EOF Then GetHomeFlag = 1 Else HOMEPAGE = fp_rs("homepage") 'Path to home page for HOME links If HOMEPAGE = "" Then GetHomeFlag = 1 End If End If If GetHomeFlag = 1 Then strSql = "SELECT homepage FROM libraryinfo WHERE Libraryid=0" set fp_rs = my_Conn.Execute (strSql) If Not fp_rs.EOF Then HOMEPAGE = fp_rs("homepage") 'Path to home page for HOME links End If End If LibVal = 0 Else If TotalLibSelected=0 Then LibVal = LIBRARYNUMBER Else LibVal = LibSearchArr(0) End If strSql = "SELECT * FROM configdeptcalname WHERE LibNum=" & LibVal & " And CalNum=" & CalNumVal set fp_rs = my_Conn.Execute (strSql) If fp_rs.EOF Then TempCalTitleStr = "Schedule of Events" TempCalHeaderStr = "Schedule of Events" TempCalLibVal = "1" Else TempCalTitleStr = fp_rs("CalName") TempCalHeaderStr = fp_rs("CalName") TempCalLibVal = fp_rs("UseLibName") End If CalHeaderStr = Request.Querystring("pagetitle") CalTitleStr = Request.Querystring("windowtitle") libnameintitle = CStr(Request.Querystring("libnameintitle")) If CalHeaderStr <> "" And CalTitleStr = "" Then CalTitleStr = CalHeaderStr ElseIf CalHeaderStr = "" Then CalHeaderStr = TempCalHeaderStr CalTitleStr = TempCalTitleStr End If If libnameintitle = "0" Or libnameintitle = "1" Then CalLibVal = libnameintitle Else CalLibVal = TempCalLibVal End If strSql = "SELECT libraryname, homepage FROM libraryinfo WHERE Libraryid=" & LibVal & "" set fp_rs = my_Conn.Execute (strSql) If fp_rs.EOF AND fp_rs.BOF Then '************ LIBRARY INFORMATION *************** LIBNAME = "Library " & LibVal Else '************ LIBRARY INFORMATION *************** LIBNAME = fp_rs("libraryname") HOMEPAGE = fp_rs("homepage") 'Path to home page for HOME links End If End If If (pointer = "inhouse" Or pointer = "attendance" Or pointer = "transfer") And CStr(nopw) <> "1" Then If noheader <> "1" Then headerval = 1 Else headerval = 0 End If If pointer="inhouse" Then CalHeaderStr = CalHeaderStr & "
(In-House Registration Mode)" ElseIf pointer="attendance" Then CalHeaderStr = CalHeaderStr & "
(In-House Attendance Mode)" ElseIf pointer="transfer" Then CalHeaderStr = CalHeaderStr & "
(In-House Transfer Mode)" End If DisplayMaintHeader CalTitleStr, CalHeaderStr, 1, "events", headerval Else DisplayHeader CalTitleStr, CalHeaderStr, CalLibVal End If PrintTitle = CalHeaderStr If CalLibVal = LIBHEADER Then PrintTitle = LIBNAME & "
" & PrintTitle End If OngoingClickStr = "

" & ONGOING_EVENTS_VIEW_LANG & "
" & ONGOING_EVENTS_VIEW_LANG & "
" OngoingCloseStr = "
" & ONGOING_EVENTS_CLOSE_LANG & "
" & ONGOING_EVENTS_CLOSE_LANG & "
" %> <% '@@@@@@@@@@@@@@@ Age Groups @@@@@@@@@@@@@@@@@@ 'Get a list of Age Groups StrSql = "Select * FROM t_listitems WHERE ListName=""AgeGroup"" ORDER BY OrderWeight" set fp_rs = my_conn.Execute (StrSql) If Not fp_rs.EOF Then AGEGROUPENABLE = 1 ageGroupField = "" ageGroupField = ageGroupField & "" & AGE_GROUPS_LANG & ":
" & vbCRLF 'Clear EventListSelect string AgeGroupSelect = "" Dim AgeSearchArr AgeSearchStr = Request.Form("AgeGroup") If AgeSearchSTR = "" Then AgeSearchStr = Request.QueryString("ag") End If AgeSearchArr = Split(AgeSearchStr, ", ") If ubound(AgeSearchArr) = -1 Then AgeSearchStr = Request.Querystring("AgeGroup") AgeSearchArr = Split(AgeSearchStr, ", ") End If If AgeSearchStr="ALL" Then AgeSearchStr = "" AgeSearchArr = Split(AgeSearchStr, ", ") End If TotalSelected = ubound(AgeSearchArr) + 1 'Determine state of All Event Types checkbox If (TotalSelected <= 0) Or (request.form("AllAgeGroups") <> "") Then CheckedVal = " CHECKED" AllFlag = 1 TotalSelected = 0 AgeSearchStr = "ALL" Else CheckedVal = "" AllFlag = 0 If TotalSelected > 0 Then AgeGroupSelect = AgeGroupSelect & "(" End If End If ageGroupField = ageGroupField & "" & ALL_AGE_GROUPS_LANG & "
" & vbCRLF TotalAgeGroups = 0 LoopCnt = 0 ListItemCol = 3 Do Until fp_rs.EOF CheckBoxVal = fp_rs("ListItem") If CheckboxVal <> "NONE" Then If AllFlag=0 Then If (LoopCnt < TotalSelected) Then FormVal = AgeSearchArr(LoopCnt) CheckedVal = Checked(LCase(FormVal),LCase(CheckBoxVal)) If (CheckedVal = " CHECKED") Then 'AgeGroupSelect = AgeGroupSelect & "(AgeGroup LIKE '" & modstr(CheckBoxVal) & "%' Or AgeGroup LIKE '%" & modstr(CheckBoxVal) & "')" AgeGroupSelect = AgeGroupSelect & "temp.item=" & chr(34) & modstr(CheckBoxVal) & chr(34) If first <> 1 Then QagSTR = QagSTR & CheckBoxVal first = 1 Else QagSTR = QagSTR & ", " & CheckBoxVal End If End If Else CheckedVal = " " End If Else CheckedVal = " CHECKED" End If ageGroupField = ageGroupField & "
" & fp_rs("ListItem") & "
" & vbCLRF TotalAgeGroups = TotalAgeGroups + 1 If CheckedVal = " CHECKED" Then LoopCnt = LoopCnt + 1 If (LoopCnt < TotalSelected) And (AllFlag = 0) Then AgeGroupSelect = AgeGroupSelect & " Or " End If End If End If fp_rs.MoveNext Loop first = 0 ageGroupField = ageGroupField & "
" If TotalSelected > 0 Then AgeGroupSelect = AgeGroupSelect & ") And " AgeGroupJoin = " LEFT JOIN eventschedulegroup as temp ON temp.EventID=eventschedule.Identifier And temp.GroupName='AgeGroup'" 'TableStr = TableStr & ", eventschedulegroup" End If Else AGEGROUPENABLE = 0 End If '@@@@@@@@@@@@@@ Event Types @@@@@@@@@@@@@@@@@@ 'Get a list of Event Types Set PublicInfo = CreateObject("ADODB.Recordset") StrSql = "Select * from eventlist " StrSqlPublic = StrSql & "Where Private=0 ORDER BY event ASC" If pointer = "" Then StrSql = StrSql & "Where Private=0 " End If StrSql = StrSql & "ORDER BY event ASC" set fp_rs = my_conn.Execute (StrSql) PublicInfo.Open StrSqlPublic,my_conn,adOpenStatic 'FormOutputEvents = fp_rs.GetRows() eventTypeField ="" eventTypeField ="" & EVENT_TYPES_LANG & ":
" & vbCLRF 'Clear EventListSelect string EventListSelect = "" Dim EventSearchArr EventSearchStr = Request.Form("EventType") If EventSearchStr = "" Then EventSearchStr = trim(Request.QueryString("et")) End If EventSearchArr = Split(EventSearchStr, ", ") If ubound(EventSearchArr) = -1 Then EventSearchStr = Request.Querystring("EventType") EventSearchArr = Split(EventSearchStr, ", ") End If If EventSearchStr="ALL" Then EventSearchStr = "" EventSearchArr = Split(EventSearchStr, ", ") End If TotalSelected = ubound(EventSearchArr) + 1 'Determine state of All Event Types checkbox If (TotalSelected <= 0) Or (request.form("AllTypes") <> "") Then CheckedVal = " CHECKED" AllFlag = 1 TotalSelected = 0 EventSearchStr = "ALL" Else CheckedVal = "" AllFlag = 0 If TotalSelected > 0 Then EventListSelect = EventListSelect & "(" End If End If eventTypeField = eventTypeField & "" & ALL_EVENT_TYPES_LANG & "
" TotalEvents = 0 LoopCnt = 0 createStaffURL = False Do Until fp_rs.EOF CheckBoxVal = fp_rs("Event") If CheckboxVal <> "NONE" Then If AllFlag=0 Then If (LoopCnt < TotalSelected) Then FormVal = EventSearchArr(LoopCnt) CheckedVal = Checked(LCase(FormVal),LCase(CheckBoxVal)) If (CheckedVal = " CHECKED") Then EventListSelect = EventListSelect & "eventschedulegroup.item=" & chr(34) & modstr(CheckBoxVal) & chr(34) PublicInfo.MoveFirst If first <> 1 Then QetSTR = QetSTR & CheckBoxVal If fp_rs("Private") = 1 Then createStaffURL = True End If first = 1 Do Until PublicInfo.EOF If PublicInfo("Event") = CheckBoxVal Then QetSTRPublic = QetSTRPublic & CheckBoxVal End If PublicInfo.MoveNext Loop Else QetSTR = QetSTR & ", " & CheckBoxVal If fp_rs("Private") = 1 Then createStaffURL = True End If Do Until PublicInfo.EOF If PublicInfo("Event") = CheckBoxVal Then QetSTRPublic = QetSTRPublic & ", " & CheckBoxVal End If PublicInfo.MoveNext Loop End If End If Else CheckedVal = " " End If Else PublicInfo.MoveFirst If first <> 1 Then first = 1 Do Until PublicInfo.EOF If fp_rs("Private") = 1 Then createStaffURL = True End If checkPublic = PublicInfo("Event") If checkPublic = CheckBoxVal Then QetSTRPublic = QetSTRPublic & CheckBoxVal End If PublicInfo.MoveNext Loop Else Do Until PublicInfo.EOF If fp_rs("Private") = 1 Then createStaffURL = True End If checkPublic = PublicInfo("Event") If checkPublic = CheckBoxVal Then QetSTRPublic = QetSTRPublic & ", " & CheckBoxVal End If PublicInfo.MoveNext Loop End If CheckedVal = " CHECKED" End If pSTR = "" If fp_rs("Private") = 1 Then pSTR = " (P)" End If If fp_rs.EOF Then TextColor = "#000080" BkColor = "#FFFFFF" Else TextColor = fp_rs("TextColor") BkColor = fp_rs("BackgroundColor") End If eventTypeField = eventTypeField & "
" & fp_rs("Event") & pSTR & "
" & vbCLRF TotalEvents = TotalEvents + 1 If CheckedVal = " CHECKED" Then LoopCnt = LoopCnt + 1 If (LoopCnt < TotalSelected) And (AllFlag = 0) Then EventListSelect = EventListSelect & " Or " End If End If End If fp_rs.MoveNext Loop If TotalSelected > 0 Then 'No event type found but event types are being filtered so force bogus event type to show blank results ' This is most likely a result of filtering a Private event type on the public side of the calendar If first <> 1 Then EventListSelect = EventListSelect & "eventschedulegroup.item=" & chr(34) & "@@@" & chr(34) End If EventListSelect = EventListSelect & ") And " EventListJoin = " LEFT JOIN eventschedulegroup ON eventschedulegroup.EventID=eventschedule.Identifier And eventschedulegroup.GroupName='EventType'" 'TableStr = ", eventschedulegroup" End If first = 0 eventTypeField = eventTypeField & "
" & vbCLRF '@@@@@@@@@@@@@@@ Locations @@@@@@@@@@@@@@@@@ If request.form("AllLibs") = "ALL" OR LibSearchStr = "ALL" Then AllFlag = 1 Else AllFlag = 0 End If locationField = "" & LOCATIONS_LANG & ":
" & vbCLRF PrivateBranchStr = "" PrivateBranchFlag = false If pointer = "" Then PrivateBranchStr = " And PrivateBranch <> 1" PrivateBranchFlag = true End If 'Load Libraries StrSql = "Select * from libraryinfo Where libraryid < 255 " & PrivateBranchStr StrSql = StrSql & " ORDER BY librarylistname ASC" set fp_rs = my_conn.Execute (StrSql) zipSTR = "" zip = Request.Form("zip") If zip = "" Then zip = Request.QueryString("zp") End If If zip <> "" Then zipSql = "SELECT DISTINCT LibNum FROM t_listitems,libraryinfo WHERE LibNum=libraryid And ListName = 'ZipCode' AND ListItem Like '%" & Zip & "%'" & PrivateBranchStr zipSql = zipSql & " ORDER BY librarylistname ASC" Set rs = my_conn.Execute(zipSql) If Not rs.EOF Then LibSearchStr = "" TotalLibSelected = 0 Do While Not rs.EOF LibSearchStr = LibSearchStr & rs("LibNum") rs.MoveNext TotalLibSelected = TotalLibSelected + 1 If Not rs.EOF Then LibSearchStr = LibSearchStr & ", " End If Loop LibSearchArr = Split(LibSearchStr, ", ") If TotalLibSelected > 0 Then AllFlag = 0 End If End If End If TotalLibs = 0 LoopCnt = 0 locationField = locationField & "" & ALL_LOCATIONS_LANG & "
" & vbCLRF 'Library Selection Display and manipulation If TotalLibSelected > 0 Then If AllFlag = 1 Then CheckedVal = " CHECKED" LibSearchArr = "" LibSearchStr = "ALL" Else CheckedVal = "" End If Else 'First time through set select library to configured library number ' Basically fool it into thinking the default library was selected CheckedVal = "" AllFlag = 3 FormVal = CInt(LIBRARYNUMBER) If PrivateBranchFlag Then StrSql = "Select libraryID from libraryinfo Where PrivateBranch <> 1 And libraryid = " & LIBRARYNUMBER Set rs = my_conn.Execute(StrSql) If Not rs.EOF Then FormVal = CInt(rs("libraryID")) End If End If TotalLibSelected = 1 End If If fp_rs.EOF Then ExtraCheck = " AND libraryinfo.privatebranch=0" End If LocationListSelect = "" ExtraParen = "" LocationListSelectCalnum = "" ORStr = "" QlnSTR = "" QlnSTRSkip = false Do Until fp_rs.EOF CheckBoxVal = CInt(fp_rs("libraryID")) If AllFlag=0 And LoopCnt < TotalLibSelected Then FormVal = Cint(LibSearchArr(LoopCnt)) CheckedVal = Checked(FormVal,CheckBoxVal) ElseIf AllFlag = 1 Then CheckedVal = " CHECKED" QlnSTR = "ALL" QlnSTRSkip = true Else CheckedVal = Checked(FormVal,CheckBoxVal) End If If CheckedVal = " CHECKED" Then LocationListSelect = LocationListSelect & "eventschedule.LibNum=" & CheckBoxVal If Not QlnSTRSkip Then If first <> 1 Then QlnSTR = QlnSTR & CheckBoxVal first = 1 Else QlnSTR = QlnSTR & ", " & CheckBoxVal End If End If End If LibName = fp_rs("librarylistname") If CInt(fp_rs("PrivateBranch")) = 1 Then LibName = LibName & " (P)" End If locationField = locationField & "
" & LibName & "
" & vbCLRF fp_rs.MoveNext TotalLibs = TotalLibs + 1 If CheckedVal = " CHECKED" Then LoopCnt = LoopCnt + 1 If AllFlag <> 1 Then If LoopCnt < TotalLibSelected Then LocationListSelect = LocationListSelect & " Or " End If Else If NOT fp_rs.EOF Then LocationListSelect = LocationListSelect & " Or " End If End If End If Loop If LocationListSelect <> "" Then ORStr = " Or " If SEPARATEDEPT=1 And CalNum <> "ALL" Then LocationListSelectCalnum = "(CalNum=" & CalNum & " And " ExtraParen = ")" End If End If LocationListSelect = "( (" & LocationListSelectCalnum & LocationListSelect & ExtraParen & ORStr & "(eventschedule.LibNum=999 And eventschedule.calnum=0)) And libraryid=eventschedule.libnum" & ExtraCheck & ") And " locationField = locationField & "
" & vbCLRF If SEARCHENABLE = "1" Then If EVENTSTARTPAGE = "1" Then search_btn = "" Else search_btn = "" End If End If If DispType = "calendar" Or DispType = "week" Then cal_viewSTR = "" cal_viewSTRTXT = "" & CALENDAR_VIEW_LANG & " | " lst_viewSTR = "" lst_viewSTRTXT = "" & LIST_VIEW_LANG & "" ElseIf DispType="list" Then If Request.Form("date_type") <> "ind_day" AND Request.Form("date_type") <> "today" Then cal_viewSTR = "" lst_viewSTR = "" cal_viewSTRTXT = "" & CALENDAR_VIEW_LANG & " | " lst_viewSTRTXT = "" & LIST_VIEW_LANG & "" Else cal_viewSTRTXT = "" & CALENDAR_VIEW_LANG & " | " lst_viewSTRTXT = "" & LIST_VIEW_LANG & "" End If 'Else ' cal_viewSTR = "" ' cal_viewSTRTXT = "" & CALENDAR_VIEW_LANG & " | " ' lst_viewSTR = "" ' lst_viewSTRTXT = "" & LIST_VIEW_LANG & "" End If 'Create Query String used for Logout and event sign up links. If pointer = "attendance" Then EventListSelect = EventListSelect & " CalNum=" & CalNum & " And ReserveID=0 And" ElseIf pointer = "inhouse" Or pointer = "transfer" Then If session(DSNNAME & "EventPatronStatus") = "AUTH" Then %>
<%=CLEAR_PATRON_INFO_LANG%>: <% End If 'EventListSelect = EventListSelect & " CalNum=" & CalNum & " And" Else If UCase(CalNum) <> "ALL" Then If disptype = "calendar" Then Set fp_rs = my_conn.Execute ("SELECT CalInstruction INSTR FROM eventsystemmesslist WHERE libraryid=" & LibVal & " AND DeptID=0 AND Lang=" & LangType) Else Set fp_rs = my_conn.Execute ("SELECT ListInstruction INSTR FROM eventsystemmesslist WHERE libraryid=" & LibVal & " AND DeptID=0 AND Lang=" & LangType) End If If Not fp_rs.EOF Then InstructionStr = fp_rs("INSTR") ElseIf disptype = "calendar" Then InstructionStr = DEFAULTCALENDARINSTRUCTION End If If IsNull(InstructionStr) Then InstructionStr = "" End If InstructionStr=Replace(InstructionStr, vbCRLF, "
") InstructionStr=Replace(InstructionStr,"^SEARCHBUTTON^","") End If If session(DSNNAME & "EventPatronStatus") = "AUTH" Then %>
<%=LOG_IN_MESS_LANG%>: <% End If If SEPARATEDEPT=1 And UCase(CalNum) <> "ALL" Then EventListSelect = EventListSelect & " CalNum=" & CalNum & " And" End If End If presenterSTR = "" Presenter = Request.Form("Presenter") If Presenter = "" Then Presenter = Request.QueryString("ps") End If If Presenter <> "" Then presenterSTR = " (Instructor Like '%" & modstr(Presenter) & "%') AND " QpsSTR = "&ps=" & Server.URLEncode(Presenter) End If If PrivateVal = "1" Then EventListSelect = EventListSelect & " Private=1 AND " ElseIf pointer = "" Then EventListSelect = EventListSelect & " Private=0 AND " End If If pubFilterNOPub = "1" And pubFilterPub = "" Then EventListSelect = EventListSelect & " NotPublished = '1' and " ElseIf (pubFilterPub = "1" Or pubFilterPub = "") And pubFilterNOPub = "" Then EventListSelect = EventListSelect & " NotPublished = '0' and " End If If keyword <> "" Then kw_string = "" kw_sql = "select searchfields from keywordlist where GroupName like 'EVENTPATRONKEYWORDLIST'" Set kw_results = my_conn.Execute(kw_sql) Dim searchFields searchFields = Split(kw_results("searchfields"), ", ") kw_string = "(" For i = 0 to ubound(searchFields) kw_string = kw_string & searchFields(i) & " Like '%" & modstr(keyword) & "%' OR " Next If kw_string <> "(" Then kw_string = Left(kw_string, Len(kw_string) - 4) & ") AND " Else kw_string = "" End If QkwSTR = "&kw=" & Server.URLEncode(keyword) Else kw_string = "" End If HideOldEventsVal = CStr(Request.QueryString("hideoldevents")) If HideOldEventsVal = "" Then HideOldEventsVal = CStr(HIDEOLDEVENTS) If HideOldEventsVal = "" Then HideOldEventsVal = "0" End If End If OldEventTodayVal = Year(Date()) & "-" & Month(Date()) & "-" & Day(Date()) checkDay = Request.Form("viewIndividualDate") date_type = Request.Form("date_type") NumDays = CStr(Request.QueryString("nd")) If date_type = "" Then date_type = Request.QueryString("dt") If date_type = "" Then date_type = Request.Form("dt") End If If NumDays <> "" Then date_type = "range" DispType = "list" If CurDate <> "" Then TempStartDate = CurDate Else TempStartDate = Date() End If TempDate = DateAdd("d", NumDays, TempStartDate) YearStart = year(TempStartDate) DayStart = day(TempStartDate) MonthStart = month(TempStartDate) YearEnd = year(TempDate) DayEnd = day(TempDate) MonthEnd = month(TempDate) SearchDateStart = YearStart & "-" & MonthStart & "-" & DayStart SearchDateEnd = YearEnd & "-" & MonthEnd & "-" & DayEnd End If If date_type <> "" Then gotDate = 1 End If If date_type = "dr" or (date_type = "range" and NumDays = "") Then date_type = "range" SearchDateStart = Request.QueryString("ds") If SearchDateStart = "" Then SearchDateStart = Request.Form("ds") End If SearchDateEnd = Request.QueryString("de") If SearchDateEnd = "" Then SearchDateEnd = Request.Form("de") End If 'Set form values tempDate = Split(SearchDateStart, "-") YearStart = tempDate(0) DayStart = tempDate(2) MonthStart = tempDate(1) tempDate = Split(SearchDateEnd, "-") YearEnd = tempDate(0) DayEnd = tempDate(2) MonthEnd = tempDate(1) dtCurViewMonth = DateSerial(YearStart, MonthStart, 1) ElseIf date_type = "sd" and disptype <> "calendar" and disptype <> "week" Then date_type = "ind_day" dtCurViewMonth = Request.QueryString("sd") If dtCurViewMonth = "" Then dtCurViewMonth = Request.Form("sd") If dtCurViewMonth = "" Then dtCurViewMonth = Date() End If End If YearStart = year(dtCurViewMonth) DayStart = day(dtCurViewMonth) MonthStart = month(dtCurViewMonth) ElseIf date_type = "mo" Then date_type = "month" dtCurViewMonthSave = dtCurViewMonth dtCurViewMonth = Request.QueryString("mo") If dtCurViewMonth = "" Then dtCurViewMonth = Request.Form("sd") If dtCurViewMonth = "" Then dtCurViewMonth = dtCurViewMonthSave End If End If End If End If DayCheckSTR = "" If HIDEOLDEVENTS = 1 And disptype = "list" And (date_type = "month" Or date_type = "") Then If month(dtCurViewMonth) = month(Date()) And year(dtCurViewMonth) = year(Date()) Then DayCheckSTR = " AND dayofmonth(eventdate) >= " & day(Date()) End If End If If date_type = "range" Then If gotDate <> 1 Then YearStart = Request.Form("dr1Year") MonthStart = Request.Form("dr1Month") DayStart = Request.Form("dr1Day") YearEnd = Request.Form("dr2Year") MonthEnd = Request.Form("dr2Month") DayEnd = Request.Form("dr2Day") SearchDateStart = YearStart & "-" & MonthStart & "-" & DayStart SearchDateEnd = YearEnd & "-" & MonthEnd & "-" & DayEnd End If If HideOldEventsVal = "1" And disptype = "list" Then If cDate(SearchDateStart) < cDate(OldEventTodayVal) Then MonthStart = Month(Date()) DayStart = Day(Date()) SearchDateStart = YearStart & "-" & MonthStart & "-" & DayStart End If End If StartDateVal = DateSerial(YearStart, MonthStart, DayStart) EndDateVal = DateSerial(YearEnd, MonthEnd, DayEnd) rangeLength = DateDiff("d", StartDateVal, EndDateVal) If rangeLength <= 6 AND (DispType = "calendar" OR DispType = "week") Then DispType = "week" weekStart = StartDateVal End If If DispType = "calendar" Then QprintDateSTR = "&drSel=tm&tmMonth=" & MonthStart & "&tmYear=" & YearStart DateSTR = " month(eventdate)= " & month(dtCurViewMonth) & " AND year(eventdate) = " & year(dtCurViewMonth) Else QprintDateSTR = "&drSel=dr&dr1Year=" & YearStart & "&dr1Month=" & MonthStart & "&dr1Day=" & DayStart QprintDateSTR = QprintDateSTR & "&dr2Year=" & YearEnd & "&dr2Month=" & MonthEnd & "&dr2Day=" & DayEnd DateSTR = " (EventDate <= '" & SearchDateEnd & "') AND (EventDate >= '" & SearchDateStart & "')" If DispType <> "week" Then DateSTR = " (" & DateSTR _ & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & SearchDateStart & "' AND OngoingEndDate >= '" & SearchDateEnd & "') " _ & "Or (OngoingStartDate BETWEEN '" & SearchDateStart & "' AND '" & SearchDateEnd & "') " _ & "Or (OngoingEndDate BETWEEN '" & SearchDateStart & "' AND '" & SearchDateEnd & "')))) " End If End If QdateSTR = "&dt=dr&ds=" & SearchDateStart & "&de=" & SearchDateEnd dtCurViewMonth = DateSerial(YearStart, MonthStart, 1) ElseIf date_type = "month" Then DateSTR = " (month(eventdate) = " & month(dtCurViewMonth) & " AND year(eventdate) = " & year(dtCurViewMonth) & DayCheckSTR & ") " If disptype = "list" Or ONGOINGDISABLE <> 1 Then DateSTR = " (" & DateSTR & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND OngoingEndDate >= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "') " _ & "Or (OngoingStartDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "') " _ & "Or (OngoingEndDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "')))) " End If QprintDateSTR = "&drSel=tm&tmMonth=" & month(dtCurViewMonth) & "&tmYear=" & year(dtCurViewMonth) QdateSTR = "&dt=mo&mo=" & dtCurViewMonth ElseIf date_type = "week" Then dtToday = DateAdd("h",HOUROFFSET,Now()) dtToday = cDate(FormatDateTime(month(dtToday) & "/" & Day(dtToday) & "/" & Year(dtToday))) TmpVal = WeekDay(dtToday) - vbSunday TmpVal = TmpVal * -1 SearchDateStart = DateAdd("d", TmpVal, dtToday) weekstart = SearchDateStart rangeLength = 7 SearchDateStart = year(SearchDateStart) & "-" & month(SearchDateStart) & "-" & day(SearchDateStart) DispDate = month(SearchDateStart) & "/1/" & year(SearchDateStart) TmpVal = vbSaturday - WeekDay(dtToday) SearchDateEnd = DateAdd("d", TmpVal, dtToday) SearchDateEnd = year(SearchDateEnd) & "-" & month(SearchDateEnd) & "-" & day(SearchDateEnd) DateRangeStr = "This Week" DayStart = day(SearchDateStart) MonthStart= month(SearchDateStart) YearStart= year(SearchDateStart) DayEnd= day(SearchDateEnd) MonthEnd = month(SearchDateEnd) YearEnd = year(SearchDateEnd) If HideOldEventsVal = "1" And disptype = "list" Then OldEventCheckVal = CLng(YearStart & MonthStart & DayStart) If OldEventCheckVal< OldEventTodayVal Then MonthStart = Month(Date()) DayStart = Day(Date()) SearchDateStart = YearStart & "-" & MonthStart & "-" & DayStart End If End If DateSTR = " (EventDate <= '" & SearchDateEnd & "' AND EventDate >= '" & SearchDateStart & "') " If disptype = "list" Or ONGOINGDISABLE <> 1 Then DateSTR = " (" & DateSTR & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & SearchDateStart & "' AND OngoingEndDate >= '" & SearchDateEnd & "') " _ & "Or (OngoingStartDate BETWEEN '" & SearchDateStart & "' AND '" & SearchDateEnd & "') " _ & "Or (OngoingEndDate BETWEEN '" & SearchDateStart & "' AND '" & SearchDateEnd & "')))) " End If QdateSTR = "&dt=dr&ds=" & SearchDateStart & "&de=" & SearchDateEnd ElseIf (date_type="today" OR date_type="ind_day") Then DispType = "list" If date_type="today" Then dtCurViewMonth = Date() Else If gotDate <> 1 Then YearStart = Request.Form("dr3Year") MonthStart = Request.Form("dr3Month") DayStart = Request.Form("dr3Day") dtCurViewMonth = DateSerial(YearStart, MonthStart, DayStart) End If End If weekStart = dtCurViewMonth DateSTR = " (dayofmonth(eventdate) = " & day(dtCurViewMonth) & " AND month(eventdate)= " & month(dtCurViewMonth) & " AND year(eventdate) = " & year(dtCurViewMonth) & ") " If disptype = "list" Then DateSTR = " (" & DateSTR & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "' AND OngoingEndDate >= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "') " _ & "Or (OngoingStartDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "') " _ & "Or (OngoingEndDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & Day(dtCurViewMonth) & "')))) " End If QdateSTR = "&dt=sd&sd=" & dtCurViewMonth ElseIf checkDay <> "" Then checkDayStr = " AND dayofmonth(eventdate) =" & checkDay & " " DateSTR = " (month(eventdate)= " & month(dtCurViewMonth) & " AND year(eventdate) = " & year(dtCurViewMonth) & checkDayStr & ") " If disptype = "list" Or ONGOINGDISABLE <> 1 Then DateSTR = " (" & DateSTR & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "' AND OngoingEndDate >= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "') " _ & "Or (OngoingStartDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "') " _ & "Or (OngoingEndDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & checkDay & "')))) " End If QdateSTR = "&dt=sd&sd=" & checkDay Else date_type = "month" DateSTR = " (month(eventdate)= " & month(dtCurViewMonth) & " AND year(eventdate) = " & year(dtCurViewMonth) & DayCheckSTR & ") " If disptype = "list" Or ONGOINGDISABLE <> 1 Then DateSTR = " (" & DateSTR & "Or (Ongoing=1 AND ( (OngoingStartDate <= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND OngoingEndDate >= '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "') " _ & "Or (OngoingStartDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "') " _ & "Or (OngoingEndDate BETWEEN '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/1' AND '" & Year(dtCurViewMonth) & "/" & Month(dtCurViewMonth) & "/" & GetNumberOfDays(Month(dtCurViewMonth)) & "')))) " End If QprintDateSTR = "&drSel=tm&tmMonth=" & month(dtCurViewMonth) & "&tmYear=" & year(dtCurViewMonth) QdateSTR = "&dt=mo&mo=" & dtCurViewMonth End If strSql = "SELECT DISTINCT eventschedule.Identifier, " _ & "eventschedule.EventTitle, " _ & "eventschedule.Event, " _ & "eventschedule.LibNum, " _ & "eventschedule.EventDesc, " _ & "eventschedule.EventDate, " _ & "eventschedule.EventTime, " _ & "eventschedule.Location, " _ & "eventschedule.signup, " _ & "eventschedule.SignupStartOffset, " _ & "eventschedule.residentstip, " _ & "eventschedule.MinAge, " _ & "eventschedule.MaxAge, " _ & "eventschedule.MinGrade, " _ & "eventschedule.MaxGrade, " _ & "eventschedule.CancelNoticeStip, " _ & "eventschedule.CheckStip, " _ & "eventschedule.MaxPeople, " _ & "eventschedule.MaxReached, " _ & "eventschedule.MaxWaitList, " _ & "eventschedule.AttendanceFlag, " _ & "eventschedule.OtherInfo, " _ & "eventschedule.Instructor, " _ & "eventschedule.EventLength, " _ & "eventschedule.PayStip, " _ & "eventschedule.NoWait, " _ & "eventschedule.SignupEnds, " _ & "eventschedule.SignupEndOffset, " _ & "eventschedule.SignupDate, " _ & "eventschedule.AuthenticateStip, " _ & "eventschedule.CardNotRequired, " _ & "eventschedule.AllDay, " _ & "eventschedule.Image, " _ & "eventschedule.ImageHeight, " _ & "eventschedule.ImageWidth, " _ & "eventschedule.ImageAlt, " _ & "eventschedule.AgeGroup, " _ & "eventschedule.AttendanceLinkID, " _ & "eventschedule.RCID, " _ & "eventschedule.InternalSpots, " _ & "eventschedule.InhouseSpotsTimeout, " _ & "eventschedule.Ongoing, " _ & "eventschedule.OngoingStartDate, " _ & "eventschedule.OngoingEndDate, " _ & "eventschedule.AttendanceType, " _ & "eventschedule.PatronStatusDisplay, " _ & "libraryinfo.LibraryListName" _ & " FROM (eventschedule,libraryinfo)" _ & EventListJoin _ & AgeGroupJoin _ & " WHERE Level=0 AND " & AgeGroupSelect & " " & EventListSelect & " " & LocationListSelect & " " & kw_string & " " & presenterSTR & " " & DateSTR & " order by ongoing desc, OngoingStartDate, eventdate, eventtime, eventtitle " If DispType = "list" Then PerPageDisplayValue = Request.Form("perPageDispTracker") If PerPageDisplayValue = "" Then PerPageDisplayValue = Request.QueryString("pgdisp") End If If PerPageDisplayValue = "" Then PerPageDisplayValue = perPageDispOption1 End If CountStrSql = "SELECT count(1) AS totalResults"_ & " FROM (eventschedule,libraryinfo)" _ & EventListJoin _ & AgeGroupJoin _ & " WHERE Level=0 AND " & AgeGroupSelect & " " & EventListSelect & " " & LocationListSelect & " " & kw_string & " " & presenterSTR & " " & DateSTR & " order by ongoing desc, OngoingStartDate, eventdate, eventtime, eventtitle " set Count_rs = my_conn.Execute (CountStrSql) totalResults = CInt(Count_rs("totalResults")) TotalPages = (Cint(totalResults) / CInt(PerPageDisplayValue)) If (totalResults mod PerPageDisplayValue) > 0 And TotalPages > Round(TotalPages)Then TotalPages = Round((totalResults / PerPageDisplayValue) + 1) Else TotalPages = Round(totalResults / PerPageDisplayValue) End If CurrentPage = Request.Form("pageTracker") If CurrentPage = "" Then CurrentPage = Request.QueryString("page") End If If CurrentPage = "" Then CurrentPage = 1 End If If CurrentPage = 1 Then CurrentStart = 0 Else CurrentStart = (CurrentPage-1) * PerPageDisplayValue End If PerPageDisplaySTR = "Limit " & CurrentStart & ", " & PerPageDisplayValue 'Set the XML display for date range 'Needs to be discussed to get everything going. xmlMonthDisplay = "&nd=30" Else 'Set the XML display mode for a month xmlMonthDisplay = "&nd=30" End If strSql = strSql & PerPageDisplaySTR 'per page is blank if not in list view QlnnumSTR = "&ln=" & QlnSTR QlibSTR = "&lib=" & QlnSTR If QetSTR = "" Or Request.Form("AllTypes") <> "" Then QetSTR = "&et=" QetSTRPublic = "&et=" Else QetSTR = "&et=" & Server.URLEncode(QetSTR) QetSTRPublic = "&et=" & Server.URLEncode(QetSTRPublic) End If QagSTR = "?ag=" & Server.URLEncode(QagSTR) QStr = "ret=eventcalendar.asp&pointer=" & pointer & "&returnToSearch=" & saveSearchReturn & "&SignupType=" & pointer & "&num=" & calnum & "&ad=" & AttendeeID & QdateSTR & QkwSTR & "&df=" & DispType & "&EventType=" & Server.URLEncode(EventSearchStr) & "&Lib=" & Server.URLEncode(LibSearchStr) & "&AgeGroup=" & Server.URLEncode(AgeSearchStr) & "&LangType=" & LangType & "&WindowMode=" & WindowMode & "&noheader=" & noheader & "&lad=" & LookupAttendeeID buildUrl = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") buildXML = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") LenVal = Len(buildXML)-17 buildXML = Left(buildXML, LenVal) buildXML = buildXML & "eventsxml.asp" If createStaffURL Then staffUrl = buildURL & QagSTR & QetSTR & QkwSTR & QpsSTR & QzpSTR & QdateSTR & "&df=" & DispType & QcnvSTR & QpvSTR & QlnnumSTR & QptrSTR & "&pointer=inhouse" 'staffXML = buildXML & QagSTR & QetSTR & QkwSTR & QlibSTR & "&dm=rss2" End If pubfixUrl = buildURL & QagSTR & QetSTRPublic & QkwSTR & QpsSTR & QzpSTR & QdateSTR & "&df=" & DispType & QcnvSTR & QpvSTR & QlnnumSTR & QptrSTR pubprintURL = "eventspr.asp" & QagSTR & "&LangType=" & LangType & "&printmode=1&opmode=report&dt=html&pgtitle=" & Server.URLEncode(PrintTitle) & QPrintMode & QetSTRPublic & QlibSTR & QprintDateSTR & QkwSTR pubdynUrl = buildURL & QagSTR & QetSTRPublic & QkwSTR & QpsSTR & QzpSTR & "&df=" & DispType & QcnvSTR & QpvSTR & QlnnumSTR & QptrSTR pubdynXML = buildXML & QagSTR & QetSTRPublic & QkwSTR & QlibSTR & xmlMonthDisplay & "&feedtitle=" & Server.URLEncode(PrintTitle) & "&dm=rss2&LangType=" & LangType If RSS_FEED_LANG = "" Then RSS_FEED_LANG = "RSS Feed" End If If pointer = "inhouse" or pointer = "transfer" Then permaLink = "" permaLinkTXT = "Show URL" RSSLinkTXT = " " & RSS_FEED_LANG & "" Else If PRINT_VIEW_LANG = "" Then PRINT_VIEW_LANG = "Print View" End If PatronRSSLink = " " & RSS_FEED_LANG & "" printViewTXT = "" & PRINT_VIEW_LANG & "" End If If Request.Form("returnToSearch") <> "" OR Request.QueryString("returnToSearch") <> "" OR Request.QueryString ("rts") <> "" Then saveSearchReturn = "true" ReturnToSearchSTR = ""_ & "" & FULL_SEARCH_LANG & "" End If If HIDEPATRONSCHED = 1 Then pointerSTR = "" If pointer <> "" Then pointerSTR = "&pointer=" & pointer pointerSTR2 = "?pointer=" & pointer End If patron_schedSTRTXT = "" End If set rs = my_conn.Execute (StrSql) If disptype = "list" Then twidth=219 Else twidth=312 End If If HIDEPATRONSCHED = 1 Then twidth = Cint(twidth) - 101 End If SearchState = Request.Form("SearchState") OngoingState = Request.Form("OngoingState") If SearchState = "" Or disptype = "list" Then If SEARCHWINDOWSTATE <> 0 Or (disptype = "list" And ( (pointer = "inhouse" Or pointer = "attendance") Or (SEARCHENABLE = "1") )) Then startDisplayWindow = "block" Else startDisplayWindow = "none" End If Else startDisplayWindow = SearchState End If %>
> > > > <% If WindowMode = "1" Then %> <% End If %> <% 'If SEARCHENABLE = "1" Or pointer = "inhouse" Or pointer = "attendance" Then If disptype <> "list" And SEARCHWINDOWSTATE <> 2 Then ClassStr = " class=""switchcontent""" XStr = "  " Else ClassStr = "" XStr = "" End If %> <% If dispType = "list" Then tmpID = "id=""event_container""" Else tmpID = "style=""width:80%;vertical-align:top;padding:5px;""" End If %> <% If WindowMode = "1" Then %> <% End If %>
> <% 'Library Selection Display and manipulation If disptype <> "calendar" And disptype <> "week" Then %> <% End If set trs = my_conn.Execute ("SELECT * FROM searchfm WHERE SliderEnable = 1 ORDER BY DisplayOrder ASC") Do While Not trs.EOF Select Case trs("id") Case 1 Display_Keyword() Case 2 Display_Zip() Case 3 Display_Presenter() Case 4 Display_Date(DispType) Case 5 Display_AgeGroup() Case 6 Display_Branches() Case 7 Display_EventType() Case 8 Display_Format() Case 9 Display_Pub_Status() End Select trs.MoveNext Loop %>
<%=UCase(SEARCH_LANG)%><%=XStr%>
  

<%DisplayTinyCal (StrSql) %>

  
> <% If dispType = "calendar" Or disptype = "week" Or dispType = "list" Then Response.Write InstructionStr End If USETEXTNAV = 1 %> <% Response.Write ReturnToSearchStr If disptype <> "list" And (SEARCHENABLE = "1" Or pointer = "inhouse" Or pointer = "attendance") And SearchWindowState <> 2 Then %> <% End If If HIDEPATRONSCHED <> 0 Then %> <% End If %> <% If pointer = "inhouse" or pointer = "attendance" or pointer = "transfer" Then %> <% Else %> <% If TURNOFFHOMEBUTTON <> 1 Then %> <% End If End If %>
<%=SEARCH_SLIDER_LANG%><%=patron_schedSTRTXT%><%=PERSONAL_SCHEDULE_LANG%><%=VIEW_LANG%>: <%=cal_viewSTRTXT%> <%=lst_viewSTRTXT%><%=permaLinkTXT%> <%=RSSLinkTXT%><%=printViewTXT%> <%=PatronRSSLink%><%If LANGENABLE = 1 Then LangSelector()%>  " value="<%=HOME_LANG%>">
<% If ALWAYSSEARCH = 1 Then %> expandcontent(this, 'sc1', 'SearchState') <% End If %>