1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
<table border="4" width="100%">
<tr>
<td nowrap rowspan="2" bgcolor="white">
<font face="arial" color="black" size="2">
<strong>
Noms
</strong>
</font>
</td>
<%
' Entête des colonnes (jours)
Deb1 = Str_Debut
Fin1 = Str_Fin
Do while DateDiff("d", Deb1, Fin1) >= 0
%>
<td nowrap align="center" bgcolor="white">
<font face="arial" color="black" size="2">
<strong>
<%=WeekDayName(WeekDay(Deb1, vbMonday), True, vbmonday)%>
</strong>
</font>
</td>
<%
Deb1 = DateAdd("d", 1, Deb1)
Loop
%>
</tr>
<tr>
<%
' Entête des colonnes (dates)
Deb1 = Str_Debut
Fin1 = Str_Fin
set rs1 = Server.CreateObject("ADODB.Recordset")
Do while DateDiff("d", Deb1, Fin1) >= 0
' La date est-elle en congé scolaire ?
JourSco = Month(Deb1) & "/" & Day(Deb1) & "/" & Year(Deb1)
SQLtemp = ""
SQLtemp = SQLtemp & "select * from TBL_CONGSCOL "
SQLtemp = SQLtemp & "where SCO_DEBUT <= #" & JourSco & "# "
SQLtemp = SQLtemp & " and SCO_FIN >= #" & JourSco & "# "
rs1.open SQLtemp, Application("DsnODBC")
if rs1.EOF then
NewColor = "white"
else
NewColor = "PaleGreen"
end if
rs1.Close
%>
<td nowrap align="center" bgcolor="<%=NewColor%>">
<font face="arial" color="black" size="2">
<strong>
<%=Day(Deb1) & "-" & Month(Deb1)%>
</strong>
</font>
</td>
<%
Deb1 = DateAdd("d", 1, Deb1)
Loop
set rs1 = Nothing
%>
</tr>
<%
set rsConges = Server.CreateObject("ADODB.Recordset")
do while not rstemp.EOF
' Récupération du semainier de l'agent
Str_Agent = rstemp("AGT_NOM") & " " & rstemp("AGT_PRENOM")
Str_Lundi = rstemp("SEM_LUNDI")
Str_Mardi = rstemp("SEM_MARDI")
Str_Mercredi = rstemp("SEM_MERCREDI")
Str_Jeudi = rstemp("SEM_JEUDI")
Str_Vendredi = rstemp("SEM_VENDREDI")
Str_Samedi = rstemp("SEM_SAMEDI")
Str_Dimanche = rstemp("SEM_DIMANCHE")
%>
<td align="left" bgcolor="white" nowrap>
<font face="arial" color="black" size="2">
<strong>
<%=Str_Agent%>
</strong>
</font>
</td>
<%
Deb = Str_Debut
Fin = Str_Fin
Do while DateDiff("d", Deb, Fin) >= 0
if WeekDay(Deb, vbMonday) = 1 and Str_Lundi = "N" then
Str_Color = "green"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 2 and Str_Mardi = "N" then
Str_Color = "green"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 3 and Str_Mercredi = "N" then
Str_Color = "green"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 4 and Str_Jeudi = "N" then
Str_Color = "green"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 5 and Str_Vendredi = "N" then
Str_Color = "green"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 6 and Str_Samedi = "N" then
Str_Color = "black"
NbChomes = NbChomes + 1
elseif WeekDay(Deb, vbMonday) = 7 and Str_Dimanche = "N" then
Str_Color = "black"
NbChomes = NbChomes + 1
elseif IsFerie(Deb) then 'and WeekDay(Deb, vbMonday) <> 6 and WeekDay(Deb, vbMonday) <> 7 then
Str_Color = "black"
NbFeries = NbFeries + 1
else
' L'agent est-il en congé ce jour là ?
Str_Jour = Month(Deb) & "/" & Day(Deb) & "/" & Year(Deb)
SQLtemp = ""
SQLtemp = SQLtemp & "select DEM_STATUT, DEM_ID from TBL_DEMANDES "
SQLtemp = SQLtemp & "where DEM_DEBUT <= #" & Str_Jour & "# "
SQLtemp = SQLtemp & " and DEM_FIN >= #" & Str_Jour & "# "
SQLtemp = SQLtemp & " and AGT_MATRICULE = '" & rstemp("AGT_MATRICULE") & "' "
rsConges.cursorlocation = aduseclient
rsConges.cachesize = 5
rsConges.open SQLtemp, Application("DsnODBC")
if rsConges.RecordCount > 0 then
Str_Id = rsConges("DEM_ID")
if rsConges("DEM_STATUT") = "O" then
Str_Color = "Yellow"
else
Str_Color = "Silver"
end if
else
Str_Id = ""
Str_Color = "white"
end if
rsConges.close
NbOuvres = NbOuvres + 1
end if
%>
<%
if Len(Trim(Str_Id)) > 0 then
%>
<td title="Détail" onclick="Fiche(<%=Str_Id%>)" style="cursor:hand;" align="center" bgcolor="<%=Str_Color%>" nowrap>
<%
else
%>
<td align="center" bgcolor="<%=Str_Color%>" nowrap>
<%
end if
%>
<font face="arial" color="white" size="2">
<strong>
<%'=Day(Deb) & "-" & Month(Deb)%>
</strong>
</font>
</td>
<%
Deb = DateAdd("d", 1, Deb)
Loop
rstemp.MoveNext
%>
</tr>
<%
Loop
%>
</table> |
Partager