<% ' ################################# Public Function CAL_VIEW_FROMTODAY dim sH : sH = "" dim strSQL, Last, intEVENTPAGING, Navigation, help1, help2, DateActual, DatePrev, HowMany, strHELP 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.EventDate, 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(dtDate) & " 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") & "%'" strSQL = strSQL & " order by EventDate asc" set Last = Server.CreateObject("ADODB.Recordset") Last.CursorLocation = 3 Last.Open strSQL, my_conn Last.CacheSize = 100 sH = sH & "" & VbCrLf sH = sH & "" sH = sH & "
" if session("FILTER_CATEGORY") <> "" then sH = sH & CAL_SHOWCATFILTERS() 'writes list of categories in filter end if sH = sH & "" sH = sH & CAL_ViewIcons(dtDate, "W; WS; M; MG; FT; Y;") sH = sH & "
" & VbCrLf sH = sH & "" & VbCrLf intEVENTPAGING = 15 Navigation = funcs.Paging(intEVENTPAGING, Last, Count, "") sH = sH & application(session("LANG") & "_PAGE:") & Navigation if NOT (Last.BOF or Last.EOF) then ' BEGIN: LOOP OF EVENTS do until Last.EOF or HowMany = intEVENTPAGING help1 = "" ' BEGIN: Column with dayname and date help1 = help1 & "" & VbCrLf ' END: Column with dayname and date ' BEGIN: Column with one day help1 = help1 & "" & VbCrLf ' END: Column with one day sH = sH & "" & VbCrLf end if Loop ' END: LOOP OF EVENTS end if Last.Close set Last = nothing sH = sH & "
" & VbCrLf help1 = help1 & weekdayName(weekday(Last("EventDate"))) & VbCrLf help1 = help1 & "
" ' If Day view is enabled if blView6 then help1 = help1 & " " & funcs.DateView(Last("EventDate")) & "" & VbCrLf else help1 = help1 & " " & funcs.DateView(Last("EventDate")) & "" & VbCrLf end if help1 = help1 & "
" & VbCrLf help2 = "" ' BEGIN: LOOP OF EVENTS DateActual = Last("EventDate") DatePrev = Last("EventDate") do while ((DatePrev = DateActual) and (HowMany < intEVENTPAGING)) strHELP = CAL_ViewOneEvent(Last, cdate(DateActual), "LONG") help2 = help2 & strHELP & VbCrLf Last.MoveNext HowMany = HowMany + 1 if (Last.EOF) then DateActual = 0 else DateActual = Last("EventDate") end if Loop ' END: LOOP OF EVENTS if Help1 <> "" then if Help2 = "" then help2 = help2 & "  " & VbCrLf sH = sH & Help1 & Help2 & "
" & VbCrLf CAL_VIEW_FROMTODAY = sH End Function %>