" & 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 & " "
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
Else
' this is day column
if CellBG = "" then CellBG = "class=""CDN"""
If Month(VDay) <> Month(DtVMonth1) then CellBG="class=""CDO"""
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
End If
' next day of week
Next
sH = sH & "
" & VbCrLf
' next week of month
Next
set Amount = Nothing
sH = sH & "