<% ' ################################# public function CAL_CalendarSmall(intDIFFERENCE, blVIEWTODAY, blSHOWARROWS) ' This function will display small navigation menu dim sH : sH = "" dim ShortDayNames: ShortDayNames=true dim DtText dim Prev dim Nex dim VDay dim NumOfWeeks dim i dim iDay dim X, Y dim Amount dim iWeek dim CellBG dim strLINK dim CountEventSET dim intCOUNTEVENTS dim strEVENTS dim DtVMonth1 dim j DtVMonth1 = dateadd("m", intDIFFERENCE, DtVMonth) DtText = "" Prev = DateAdd("m", -1, DtVMonth1) Nex = DateAdd("m", +1, DtVMonth1) VDay = CAL_FirstWeekDay(DtVMonth1) ' Count amount of weeks in month NumOfWeeks = DateDiff("ww", DtVMonth1, dateadd("m",1,DtVMonth1)-1, session("FirstDayOfWeek"), FirstWeekOfYear) dim strHEADER strHEADER = strHEADER & "" strHEADER = strHEADER & "" & VbCrLf ' Show link for TODAY if blVIEWTODAY then strHEADER = strHEADER & "" & VbCrLf end if strHEADER = strHEADER & "" & VbCrLf strHEADER = strHEADER & "" & VbCrLf strHEADER = strHEADER & "
" & VbCrLf 'if day view is enabled if blView6 then strHEADER = strHEADER & "" & application(session("LANG") & "_wcal95") & "" & VbCrLf else strHEADER = strHEADER & "" & application(session("LANG") & "_wcal95") & "" & VbCrLf end if strHEADER = strHEADER & "" & VbCrLf ' Show previous month arrow if blSHOWARROWS then strHEADER = strHEADER & " " & VbCrLf end if ' display Month in header strHEADER = strHEADER & " " if blCUTMONTHNAMES then strHEADER = strHEADER & left(application(session("LANG") & "_MonthName" & month(DtVMonth1)),intCUTMONTHNAMES) & VbCrLf else strHEADER = strHEADER & application(session("LANG") & "_MonthName" & month(DtVMonth1)) & VbCrLf end if strHEADER = strHEADER & "" & VbCrLf ' cut lenght of month name to specified value if blCUTMONTHNAMES then strHEADER = strHEADER & left(application(session("LANG") & "_MonthName" & j*3+i),intCUTMONTHNAMES) & VbCrLf else strHEADER = strHEADER & application(session("LANG") & "_MonthName" & j*3+i) & VbCrLf end if ' Show year link view if blView1 then strHEADER = strHEADER & " " & year(DtVMonth1) & " " & VbCrLf else strHEADER = strHEADER & " " & year(DtVMonth1) & " " & VbCrLf end if ' Show next month arrow if blSHOWARROWS then strHEADER = strHEADER & "" & VbCrLf end if strHEADER = strHEADER & "
" & VbCrLf ' ------------------------------------------------------------------------------------------------ ' Show daynames in first row sH = sH & "" & VbCrLf ' Header of small month navigation ' ------------------------------------------------------------------------------------------------ sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf For i = 1 To 7 sH = sH & "" & VbCrLf Next sH = sH & "" & VbCrLf For iWeek = 0 To NumOfWeeks sH = sH & "" & VbCrLf For iDay = 0 To 7 If VDay = date() AND iDay>0 Then ' BgColor of today CellBG = "class=""CDT""" else ' standard cell CellBG="class=""CDN""" End If IF iDay =0 then ' Is this week column sH = sH & " " & VbCrLf Else ' this is day column if CellBG = "" then CellBG = "class=""CDN""" If Month(VDay) <> Month(DtVMonth1) then CellBG="class=""CDO""" sH = sH & " " & VbCrLf End If ' next day of week Next sH = sH & "" & VbCrLf ' next week of month Next set Amount = Nothing sH = sH & "
 " & Left(WeekDayName(i,ShortDayNames,session("FirstDayOfWeek")),1) & "
" If month(vday) = month(DtVMonth1) or month(DateAdd("d", +6, VDay)) = month(DtVMonth1) then X = dateadd("y", +6,VDay) X = DatePart("WW", x, session("FirstDayOfWeek"), FirstWeekOfYear) Y = DatePart("WW", VDay, session("FirstDayOfWeek"), FirstWeekOfYear) ' Display link for week view ' ======================================================================================================================================================================== if blView4 then sH = sH & "" & VbCrLf end if if blView5 then sH = sH & "" & VbCrLf end if ' ======================================================================================================================================================================== else sH = sH & " " End if sH = sH & " " & vbcrlf ' dtDate = VDay 'We need to count events for this day ' ======================================================================================= strSQL = "SELECT wcal_eventrec.IDEvent AS ID, wcal_events.UserPrivate "&_ "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 (wcal_events.UserPrivate=0 OR wcal_events.UserPrivate=" & session("WCAL_USERID") & ") AND wcal_events.Client=" & session("Client") & " and wcal_events.Lang=" & session("LANG") & " and wcal_eventcat.CatType<>0 AND EventDate = " & funcs.VDate(VDay) 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") & "%'" intCOUNTEVENTS = 0 set CountEventSET = Server.CreateObject("ADODB.Recordset") CountEventSET.CursorLocation = 3 CountEventSET.Open strSql, my_conn CountEventSET.CacheSize = 100 ' for future use, testings GROUPS EVENT do until CountEventSET.EOF if CAL_Wcal_CheckGroupAccess(CountEventSET("ID")) then intCOUNTEVENTS = intCOUNTEVENTS + 1 CountEventSET.MoveNext Loop ' intCOUNTEVENTS = CountEventSET.RecordCount CountEventSET.Close set CountEventSET = Nothing ' ======================================================================================= if intCOUNTEVENTS= 0 then ' no events ' If Day view is enabled if blView6 then strLINK = "" & Day(VDay) & "" & vbcrlf else strLINK = "" & Day(VDay) & "" & vbcrlf end if else dim EventTitle select case intCOUNTEVENTS case 1 EventTitle = "Title='There is an event in this day.'" case else EventTitle = "Title='There are " & intCOUNTEVENTS & " events in this day.'" end select ' If Day view is enabled if blView6 then strLINK = "" & Day(VDay) & "" & vbcrlf else strLINK = "" & Day(VDay) & "" & vbcrlf end if end if sH = sH & strLINK VDay = DateAdd("d", 1, VDay) ' Increment of day pointer sH = sH & "
" & VbCrLf sH = funcs.BOXCreator(strHEADER, sH, strDEFTHEME, "", "100%") CAL_CalendarSmall= sH end function %>