")
Set rsListEvents = server.CreateObject("ADODB.Recordset")
sqlListEvents = "SELECT rdlp.id, rdlp.idEmpl, rdlp.CustInt, year(rdlp.DateInt), week(rdlp.DateInt), rdlp.DateInt, rdlp.FullDay, rdlp.BeginTime, rdlp.EndTime," & _
" rdlp.JobDescription, te.TypeEvent, tp.TypePrestation, e.Initiales " & _
"FROM reldatelieupers_2 as rdlp " & _
"LEFT JOIN employees as e on rdlp.idEmpl=e.IdEmpl " & _
"LEFT JOIN typeevent as te on rdlp.idTypeEvent=te.idType " & _
"LEFT JOIN typeprestation as tp on rdlp.idTypePrestation=tp.idPrestation " & _
"WHERE rdlp.DateInt>='" & firstlundiSQL & "' AND rdlp.DateInt<='" & lastdimancheSQL & "' " & _
"ORDER BY year(rdlp.DateInt),week(rdlp.DateInt),e.Initiales,rdlp.DateInt,rdlp.BeginTime Asc"
openStaticRS rsListEvents, sqlListEvents
'Response.Write("| " & sqlListEvents & " | ")
'''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''
' Boucle première semaine à dernière semaine'
'''''''''''''''''''''''''''''''''''''''''''''
diffyear = yearlastlundi - yearfirstlundi
If diffyear > 0 then
diffsem = 52 * diffyear
lastsem = lastsem + diffsem
end if
For Sem = firstsem to lastsem
lastmonth = month(firstlundi)
lastday = day(firstlundi)
lastyear = year(firstlundi)
currentlundi = firstlundi
Currsem = DatePart("ww",currentlundi,2,3)
If Currsem = 53 then
Currsem = 1
end if
%>
<%
If Currsem = thisnumerosemaine and year(Date()) = year(currentlundi) then
%>
<%
else
Response.Write("")
end if
%>
|
<%
''''''''''''''''''''''''''''''''''''''''''''''
' Boucle d'affichage des jours de la semaine '
''''''''''''''''''''''''''''''''''''''''''''''
For wd = 0 to 6
tmpmonth = month(firstlundi)
tmpday = day(firstlundi)
tmpyear = year(firstlundi)
currentday = Dateserial(tmpyear,tmpmonth,tmpday+wd)
dayname = WeekdayName(Weekday(currentday))
currentday = DateToHtml(currentday)
If currentday = TodayBE then
Response.Write("" & dayname & " " & currentday & " | ")
else
%>
<%=dayname%> <%=currentday%> |
<%
end if
next
%>
<%
'''''''''''''''''''''''''''''''''''
' Boucle d'affichage des employés '
'''''''''''''''''''''''''''''''''''
IDEmployee = 0
ChangeColor = 0
InitEmployee = ""
openrs rsidEmpl, "select IdEmpl, Initiales from employees where DisableEmpl=0 order by 2"
while not rsidEmpl.EOF
IDEmployee = GetValue(rsidEmpl, 0)
InitEmployee = GetValue(rsidEmpl, 1)
rsidEmpl.MoveNext
If Session("Empl" & IDEmployee) = "on" and IDEmployee <> 0 then
ChangeColor = ChangeColor + 1
If Round(ChangeColor/2) = ChangeColor/2 then
trcolor = "CCCCCC"
else
trcolor = "99CCFF"
end if
%>
<%=InitEmployee%> |
<%
For wd = 0 to 6
tmpmonth = month(firstlundi)
tmpday = day(firstlundi)
tmpyear = year(firstlundi)
currentday = Dateserial(tmpyear,tmpmonth,tmpday+wd)
tosqlmonth = month(currentday)
tosqlday = day(currentday)
tosqlyear = year(currentday)
tosqldate = tosqlyear & "-" & tosqlmonth & "-" & tosqlday
ShowToday = ""
If tosqldate = TodayBEsql then
ShowToday = " bordercolor='#0000FF' bgcolor='#CCFFFF'"
End if
%>
>
<%
ClientFull = ""
AddEvent = "Edit Day"
AddEvent2 = "Add Event"
If wd = 5 or wd=6 then
AddEvent = "W-E"
end if
rsListEvents.Filter = "(Initiales='" & InitEmployee & "' AND DateInt=#" & currentday & "#) OR (Initiales=' All' AND DateInt=#" & currentday & "#)"
If not rsListEvents.eof then
While not rsListEvents.eof
ClientFull = rsListEvents("CustInt")
idFull = rsListEvents("id")
If rsListEvents("FullDay") = 1 then
Response.Write("" & ClientFull & "")
'Response.Write("" & ClientFull & "")
else
EventBeginTime = rsListEvents("BeginTime")
EventEndTime = rsListEvents("EndTime")
EventBeginHour = Hour(EventBeginTime)
If EventBeginHour < 10 then
EventBeginHour = "0" & EventBeginHour
end if
EventBeginMinute = Minute(EventBeginTime)
If EventBeginMinute < 10 then
EventBeginMinute = "0" & EventBeginMinute
end if
EventBeginHour = EventBeginHour & ":" & EventBeginMinute
EventEndHour = Hour(EventEndTime)
If EventEndHour < 10 then
EventEndHour = "0" & EventEndHour
end if
EventEndMinute = Minute(EventEndTime)
If EventEndMinute < 10 then
EventEndMinute = "0" & EventEndMinute
end if
EventEndHour = EventEndHour & ":" & EventEndMinute
If EventEndHour = "23:59" then
EventEndHour = "24:00"
end if
Response.Write("" & EventBeginHour & " - " & EventEndHour & " - " & ClientFull & "")
'Response.Write("" & EventBeginHour & " - " & EventEndHour & " - " & ClientFull & "")
end if
rsListEvents.movenext
Response.Write(" ")
Wend
else
rsListEvents.Filter = adFilterNone
End if
Response.Write("" & AddEvent & "")
Response.Write(" / " & AddEvent2 & "")
%>
|
<%
next
%>
<%
end if
wend
set rsidEmpl = nothing
%>
<%
firstlundi = Dateserial(tmpyear,lastmonth,lastday+7)
next
%>
<%
EndCode = Now()
TimeCode = DateDiff("s",BeginCode,EndCode)
Response.Write("Temps d'affichage : " & TimeCode)
rsListEvents.close
%>
| |