% ' ################################# public function CAL_ViewDay1() dim sH : sH = "" dim iFOR dim strSTYLE dim dtPrev: dtPrev = dateadd("D",-1,dtDate) dim dtNext: dtNext = dateadd("D",+1,dtDate) sH = sH & "
| " & VbCrLf
if iFOR<10 then
sH = sH & "0" & iFOR & ":00 " sH = sH & "0" & iFOR & ":30 " else sH = sH & iFOR &":00 " sH = sH & iFOR &":30 " end if sH = sH & " | " & VbCrLf
sH = sH & "
| " & VbCrLf
if iFOR<10 then
sH = sH & "0" & iFOR & ":00 AM " sH = sH & "0" & iFOR & ":30 AM " else if iFOR<12 then sH = sH & iFOR &":00 AM " sH = sH & iFOR &":30 AM " else sH = sH & iFOR &":00 PM " sH = sH & iFOR &":30 PM " end if end if sH = sH & " | " & VbCrLf
sH = sH & "
| " & VbCrLf
if iFOR<10 then
sH = sH & "0" & iFOR & ":00 PM " sH = sH & "0" & iFOR & ":30 PM " else sH = sH & iFOR &":00 PM " sH = sH & iFOR &":30 PM " end if sH = sH & " | " & VbCrLf
sH = sH & "
"
' Sem vložíme události
StrSql = "SELECT wcal_Category.bgColor, wcal_Category.fgColor, 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(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") & "%'"
'if session("wcal_pers") <> "" then strSQL = strSQL & " AND wcal_events.Person = '" & session("wcal_pers") & "'"
if blVIEWHOLIDAYSDAY then StrSql = strSQL & " AND wcal_category.CatType<>3"
'We order records by StartTime
StrSql = strSQL & " ORDER BY wcal_eventrec.StartTime "
dim Sloupec(30), HTML(30), Radek(30), sT, eT
dim setCAT, J, I, T1, T2
set setCAT = Server.CreateObject("ADODB.Recordset")
setCAT.CursorLocation = 3
setCAT.Open strSql, my_conn
setCAT.CacheSize = 100
J=1
Sloupec(1) =0: Radek(1) =0
do until setCAT.EOF
' Pokud Začátek je větší než konec na sloupci
for I=1 to 30
sT = setCAT("StartTime")
eT = setCAT("EndTime")
if sT="23:59:00" or sT="11:59:59 PM" then sT="11:59 PM"
if eT="23:59:00" or eT="11:59:59 PM" then eT="11:59 PM"
T1=clng(left(sT,2))
if MID(sT,4,2)>"00" then T1=T1+0.5
if MID(sT,4,2)>"30" then T1=T1+0.5
T1=T1*2
if right(sT,2)="PM" then T1=T1+24
T1=clng(T1)
if T1>=clng(Sloupec(I)) then
T1=clng(T1)-sloupec(I)
T2=clng(left(eT,2))
if MID(eT,4,2)>"00" then T2=T2+0.5
if MID(eT,4,2)>"30" then T2=T2+0.5
T2=T2*2
if right(eT,2)="PM" then T2=T2+24
T2=clng(T2)
DIM INTsl
INTsl =T2
T2=T2-T1-1-sloupec(I)
Sloupec(I) = INTsl
Radek(I) =T2+T1+1
strSTYLE=""
if setCAT("bgColor")<>"" and setCAT("fgColor")<>"" then
strSTYLE="STYLE=""Background:" & setCAT("bgColor") & "; color:" & setCAT("fgColor") & ";"""
strSTYLE="STYLE=""border:solid 1px " & setCAT("bgColor") & ";"""
end if
' TEST OF REPEATING
dim CountID, imgREC
strSQL="SELECT COUNT(IDEvent) as C from wcal_eventrec where IDEvent=" & setCAT("ID")
CountID = my_conn.execute(strSQL)("C")
imgREC=""
if CountID>1 then
imgREC = " "
end if
HTML(I) = HTML(I) & replace(string(T1,"x"),"x","") &_ " " & _
setCAT("EventName") &_
imgREC &_
replace(string(T2,"x"),"x"," " & VbCrLf
exit for
end if
next
if I>J then J=I
setCAT.MoveNext
Loop
sH = sH & "") &_ "
| " & VbCrLf
sH = sH & "