<% ' this will display list of events for dates range public function ListEvents(DtDateFrom, DtDateTo) dim sH : sH = "" dim DayColumns dim EventList dim Q_DATE dim help1 dim help2 dim strHELP sH = sH & "" ' Event's List for day range DtDateFrom to DtDateTo For DayColumns = DtDateFrom to DtDateTo 'Only validated events are shown StrSql = "SELECT wcal_events.Cust1, wcal_events.Cust2, wcal_events.Cust3, wcal_events.Cust4, wcal_events.Cust5, wcal_events.IDEvent as ID, wcal_events.IDUser, wcal_events.Place, wcal_events.EventName, wcal_eventrec.StartTime, wcal_eventrec.EndTime, wcal_eventrec.Description FROM (wcal_eventcat LEFT JOIN (wcal_events LEFT JOIN wcal_eventrec ON wcal_events.IDEvent = wcal_eventrec.IDEvent) ON wcal_eventcat.IDEvent = wcal_events.IDEvent) INNER JOIN wcal_category ON wcal_eventcat.IDCat = wcal_category.IDCat where (UserPrivate=0 OR UserPrivate=" & session("WCAL_USERID") & ") AND wcal_eventrec.Lang=" & session("LANG")& " and wcal_eventrec.Client=" & session("Client") & " and EventDate = " & funcs.VDate(DayColumns) & " AND wcal_events.IDUser > -1" if Session("FILTER_CATEGORY") <> "" then StrSql = strSQL & " AND wcal_eventcat.IDCat IN (" & Session("FILTER_CATEGORY") & "0)" if Session("FILTER_LOCATION") <> "" then strSQL = strSQL & " AND wcal_events.Place like '%" & Session("FILTER_LOCATION") & "%'" 'if session("wcal_pers") <> "" then strSQL = strSQL & " AND wcal_events.Person = '" & session("wcal_pers") & "'" 'We order records by StartTime StrSql = strSQL & " ORDER BY wcal_eventrec.StartTime " ' help1 has dayname and date link help1 = "" ' BEGIN: Column with dayname and date help1 = help1 & "" & VbCrLf ' END: Column with dayname and date ' BEGIN: Column with one day help1 = help1 & "" ' END: Column with one day sH = sH & "" & VbCrLf end if next EventList.Close set EventList = Nothing sH = sH & "
" help1 = help1 & weekdayName(weekday(DayColumns)) & VbCrLf help1 = help1 & "
" ' If Day view is enabled if blView6 then help1 = help1 & " " & funcs.DateView(DayColumns) & "" else help1 = help1 & " " & funcs.DateView(DayColumns) & "" end if help1 = help1 & "
" & VbCrLf set EventList = Server.CreateObject("ADODB.Recordset") EventList.CursorLocation = 3 EventList.Open strSql, my_conn EventList.CacheSize = 100 help2 = "" if EventList.BOF or EventList.EOF then ' there is no event for this day EventCOUNT=0 ' if request("View")="Month" or request("View")="" then ' Help1="" ' end if else ' BEGIN: LOOP OF EVENTS do until EventList.EOF strHELP = CAL_ViewOneEvent(EventList, DayColumns, "LONG") if EventCount=0 then strHELP = " " help2 = help2 & strHELP & VbCrLf EventList.MoveNext Loop ' END: LOOP OF EVENTS end if if Help1 <> "" then ' if Help2 = "" then help2 = help2 & "" & application(session("LANG") & "_wcal14") & "" & VbCrLf if Help2 = "" then help2 = help2 & "  " & VbCrLf sH = sH & Help1 & Help2 & "
" ListEvents = sH end function %>