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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<body>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
function fClean(sString)
sString = Replace(sString, "\", "\\")
sString = Replace(sString, "'", "\'")
sString = Replace(sString, """", "\""")
sString = Replace(sString, "&", "\&")
sString = Replace(sString, VbCrLf, "<br />\" & VbCrLf)
fClean = sString
end function
function fCleanREAD(sStringREAD)
sStringREAD = Replace(sStringREAD, "\", "\\")
sStringREAD = Replace(sStringREAD, "'", "\'")
sStringREAD = Replace(sStringREAD, """", "\""")
sStringREAD = Replace(sStringREAD, "&", "\&")
sStringREAD = Replace(sStringREAD, VbCrLf, "\r\" & VbCrLf)
fCleanREAD = sStringREAD
end function
function fWriteScript(sScriptName, sStringWRITE)
Set f = fs.OpenTextFile(Server.MapPath("/scripts/" & sScriptName & ".js"), 2, true)
f.Write("document.write('" & sStringWRITE & "')")
f.Close
fWriteScript = TRUE
end function
function fDateDebutFin(sMM, sJJ, sHH, sNN)
if sMM = "" AND sJJ = "" AND sHH = "" AND sNN = "" then
fDateDebutFin = " "
else
fDateDebutFin = sMM & "/" & sJJ & "-" & sHH & "H" & sNN
end if
end function
function fOption(sCondition, sString1, sString2)
if sCondition = "" then
fOption = sString1
else
fOption = sString2
end if
end function
function fFormatFin(sScript, sEnCours, sIndice)
if sEnCours <> "" then
fFormatFin = sScript & _
"document.form1.FinEnCours" & sIndice & ".checked = true" & vbCrLf & _
"document.form1.FinMM" & sIndice & ".style.backgroundColor='#CCCCCC'" & vbCrLf & _
"document.form1.FinJJ" & sIndice & ".style.backgroundColor='#CCCCCC'" & vbCrLf & _
"document.form1.FinHH" & sIndice & ".style.backgroundColor='#CCCCCC'" & vbCrLf & _
"document.form1.FinNN" & sIndice & ".style.backgroundColor='#CCCCCC'" & vbCrLf & _
"document.form1.FinMM" & sIndice & ".disabled=true" & vbCrLf & _
"document.form1.FinJJ" & sIndice & ".disabled=true" & vbCrLf & _
"document.form1.FinHH" & sIndice & ".disabled=true" & vbCrLf & _
"document.form1.FinNN" & sIndice & ".disabled=true" & vbCrLf
else
fFormatFin = sScript & _
"document.form1.FinEnCours" & sIndice & ".checked = false" & vbCrLf & _
"document.form1.FinMM" & sIndice & ".disabled=false" & vbCrLf & _
"document.form1.FinJJ" & sIndice & ".disabled=false" & vbCrLf & _
"document.form1.FinHH" & sIndice & ".disabled=false" & vbCrLf & _
"document.form1.FinNN" & sIndice & ".disabled=false" & vbCrLf & _
"document.form1.FinMM" & sIndice & ".style.backgroundColor='#FFFFFF'" & vbCrLf & _
"document.form1.FinJJ" & sIndice & ".style.backgroundColor='#FFFFFF'" & vbCrLf & _
"document.form1.FinHH" & sIndice & ".style.backgroundColor='#FFFFFF'" & vbCrLf & _
"document.form1.FinNN" & sIndice & ".style.backgroundColor='#FFFFFF'" & vbCrLf
end if
end function
sValeurCache = request.form("ValeurCache")
sMessagesImportants = fClean(request.form("MessagesImportants"))
sMessagesImportantsREAD = fCleanREAD(request.form("MessagesImportants"))
sActEnCours = fClean(request.form("ActEnCours"))
sActEnCoursREAD = fCleanREAD(request.form("ActEnCours"))
sProchainesAct = fClean(request.form("ProchainesAct"))
sProchainesActREAD = fCleanREAD(request.form("ProchainesAct"))
sCustom4 = fClean(request.form("Custom4"))
sCustom4READ = fCleanREAD(request.form("Custom4"))
sCustom5 = Split(fClean(request.form("Custom5")),"|")(1)
sCustom5READ = Split(fCleanREAD(request.form("Custom5")),"|")(0)
sStatut = request.form("Statut")
sDebut1 = fDateDebutFin(request.form("DebutMM1"), request.form("DebutJJ1"), request.form("DebutHH1"), request.form("DebutNN1"))
sDebut2 = fDateDebutFin(request.form("DebutMM2"), request.form("DebutJJ2"), request.form("DebutHH2"), request.form("DebutNN2"))
sDebut3 = fDateDebutFin(request.form("DebutMM3"), request.form("DebutJJ3"), request.form("DebutHH3"), request.form("DebutNN3"))
sDebut4 = fDateDebutFin(request.form("DebutMM4"), request.form("DebutJJ4"), request.form("DebutHH4"), request.form("DebutNN4"))
sDebut5 = fDateDebutFin(request.form("DebutMM5"), request.form("DebutJJ5"), request.form("DebutHH5"), request.form("DebutNN5"))
sFinEnCours1 = request.form("FinEnCours1")
sFinEnCours2 = request.form("FinEnCours2")
sFinEnCours3 = request.form("FinEnCours3")
sFinEnCours4 = request.form("FinEnCours4")
sFinEnCours5 = request.form("FinEnCours5")
sFin1 = fOption(sFinEnCours1, fDateDebutFin(request.form("FinMM1"), request.form("FinJJ1"), request.form("FinHH1"), request.form("FinNN1")), "En cours")
sFin2 = fOption(sFinEnCours2, fDateDebutFin(request.form("FinMM2"), request.form("FinJJ2"), request.form("FinHH2"), request.form("FinNN2")), "En cours")
sFin3 = fOption(sFinEnCours3, fDateDebutFin(request.form("FinMM3"), request.form("FinJJ3"), request.form("FinHH3"), request.form("FinNN3")), "En cours")
sFin4 = fOption(sFinEnCours4, fDateDebutFin(request.form("FinMM4"), request.form("FinJJ4"), request.form("FinHH4"), request.form("FinNN4")), "En cours")
sFin5 = fOption(sFinEnCours5, fDateDebutFin(request.form("FinMM5"), request.form("FinJJ5"), request.form("FinHH5"), request.form("FinNN5")), "En cours")
'---------------------------------------------------------
'Fichiers pour mettre à jour la page de l'utilisateur
'---------------------------------------------------------
bWriteScript = fWriteScript("ValeurCache", sValeurCache)
bWriteScript = fWriteScript("MessagesImportants", sMessagesImportants)
bWriteScript = fWriteScript("ActEnCours", sActEnCours)
bWriteScript = fWriteScript("ProchainesAct", sProchainesAct)
bWriteScript = fWriteScript("Custom4", sCustom4)
bWriteScript = fWriteScript("Custom5", sCustom5)
bWriteScript = fWriteScript("Debut1", sDebut1)
bWriteScript = fWriteScript("Debut2", sDebut2)
bWriteScript = fWriteScript("Debut3", sDebut3)
bWriteScript = fWriteScript("Debut4", sDebut4)
bWriteScript = fWriteScript("Debut5", sDebut5)
bWriteScript = fWriteScript("Fin1", sFin1)
bWriteScript = fWriteScript("Fin2", sFin2)
bWriteScript = fWriteScript("Fin3", sFin3)
bWriteScript = fWriteScript("Fin4", sFin4)
bWriteScript = fWriteScript("Fin5", sFin5)
'---------------------------------------------------------
'Fin Fichiers pour mettre à jour la page de l'utilisateur
'---------------------------------------------------------
'---------------------------------------------------------
'Fichier pour mettre à jour la page de l'administrateur
'---------------------------------------------------------
sUpdate = sUpdate & "function fUpdate(){" & vbCrLf & _
"var href_new = '' ; " & vbCrLf & _
"if (Right(document.location,15)=='&update_adm=yes') {" & vbCrLf & _
" href_new = Left(document.location,(String(document.location).length)-15) ;" & vbCrLf & _
" location.href=href_new ;" & vbCrLf & _
" var Wndw=window.open('','Update','width=400,height=100,location=no,status=no,toolbar=no,scrollbars=no,left='+((screen.width - 430)/2)+',top='+((screen.height - 100)/2) );" & vbCrLf & _
" Wndw.document.write('<head><title>Update</title></head>');" & vbCrLf & _
" Wndw.document.write('<div style=""text-align: center;"">');" & vbCrLf & _
" Wndw.document.write('<b>Mise à jour effectuée.<b><br><br>');" & vbCrLf & _
" Wndw.document.write('<a href=""#"" onClick=""window.close();"">Fermer</a></div>') ;" & vbCrLf & _
"}" & vbCrLf & vbCrLf & _
"if (document.form1.test_load.value == 'NO') {" & vbCrLf & _
"document.form1.test_load.value = 'YES'" & vbCrLf & _
"document.form1.ValeurCache.value = '" & sValeurCache & "'" & vbCrLf & _
"document.form1.MessagesImportants.value = '" & sMessagesImportantsREAD & "'" & vbCrLf & _
"document.form1.ActEnCours.value = '" & sActEnCoursREAD & "'" & vbCrLf & _
"document.form1.ProchainesAct.value = '" & sProchainesActREAD & "'" & vbCrLf & _
"document.form1.Statut[" & sStatut & "].checked=true" & vbCrLf & _
"document.form1.Custom4.value = '" & sCustom4READ & "'" & vbCrLf & _
"document.form1.Custom5.selectedIndex = '" & sCustom5READ & "'" & vbCrLf & _
"document.form1.DebutMM1.value = '" & request.form("DebutMM1") & "'" & vbCrLf & _
"document.form1.DebutJJ1.value = '" & request.form("DebutJJ1") & "'" & vbCrLf & _
"document.form1.DebutHH1.value = '" & request.form("DebutHH1") & "'" & vbCrLf & _
"document.form1.DebutNN1.value = '" & request.form("DebutNN1") & "'" & vbCrLf & _
"document.form1.DebutMM2.value = '" & request.form("DebutMM2") & "'" & vbCrLf & _
"document.form1.DebutJJ2.value = '" & request.form("DebutJJ2") & "'" & vbCrLf & _
"document.form1.DebutHH2.value = '" & request.form("DebutHH2") & "'" & vbCrLf & _
"document.form1.DebutNN2.value = '" & request.form("DebutNN2") & "'" & vbCrLf & _
"document.form1.DebutMM3.value = '" & request.form("DebutMM3") & "'" & vbCrLf & _
"document.form1.DebutJJ3.value = '" & request.form("DebutJJ3") & "'" & vbCrLf & _
"document.form1.DebutHH3.value = '" & request.form("DebutHH3") & "'" & vbCrLf & _
"document.form1.DebutNN3.value = '" & request.form("DebutNN3") & "'" & vbCrLf & _
"document.form1.DebutMM4.value = '" & request.form("DebutMM4") & "'" & vbCrLf & _
"document.form1.DebutJJ4.value = '" & request.form("DebutJJ4") & "'" & vbCrLf & _
"document.form1.DebutHH4.value = '" & request.form("DebutHH4") & "'" & vbCrLf & _
"document.form1.DebutNN4.value = '" & request.form("DebutNN4") & "'" & vbCrLf & _
"document.form1.DebutMM5.value = '" & request.form("DebutMM5") & "'" & vbCrLf & _
"document.form1.DebutJJ5.value = '" & request.form("DebutJJ5") & "'" & vbCrLf & _
"document.form1.DebutHH5.value = '" & request.form("DebutHH5") & "'" & vbCrLf & _
"document.form1.DebutNN5.value = '" & request.form("DebutNN5") & "'" & vbCrLf & _
"document.form1.FinMM1.value = '" & request.form("FinMM1") & "'" & vbCrLf & _
"document.form1.FinJJ1.value = '" & request.form("FinJJ1") & "'" & vbCrLf & _
"document.form1.FinHH1.value = '" & request.form("FinHH1") & "'" & vbCrLf & _
"document.form1.FinNN1.value = '" & request.form("FinNN1") & "'" & vbCrLf & _
"document.form1.FinMM2.value = '" & request.form("FinMM2") & "'" & vbCrLf & _
"document.form1.FinJJ2.value = '" & request.form("FinJJ2") & "'" & vbCrLf & _
"document.form1.FinHH2.value = '" & request.form("FinHH2") & "'" & vbCrLf & _
"document.form1.FinNN2.value = '" & request.form("FinNN2") & "'" & vbCrLf & _
"document.form1.FinMM3.value = '" & request.form("FinMM3") & "'" & vbCrLf & _
"document.form1.FinJJ3.value = '" & request.form("FinJJ3") & "'" & vbCrLf & _
"document.form1.FinHH3.value = '" & request.form("FinHH3") & "'" & vbCrLf & _
"document.form1.FinNN3.value = '" & request.form("FinNN3") & "'" & vbCrLf & _
"document.form1.FinMM4.value = '" & request.form("FinMM4") & "'" & vbCrLf & _
"document.form1.FinJJ4.value = '" & request.form("FinJJ4") & "'" & vbCrLf & _
"document.form1.FinHH4.value = '" & request.form("FinHH4") & "'" & vbCrLf & _
"document.form1.FinNN4.value = '" & request.form("FinNN4") & "'" & vbCrLf & _
"document.form1.FinMM5.value = '" & request.form("FinMM5") & "'" & vbCrLf & _
"document.form1.FinJJ5.value = '" & request.form("FinJJ5") & "'" & vbCrLf & _
"document.form1.FinHH5.value = '" & request.form("FinHH5") & "'" & vbCrLf & _
"document.form1.FinNN5.value = '" & request.form("FinNN5") & "'" & vbCrLf
sUpdate = fFormatFin(sUpdate, sFinEnCours1, "1")
sUpdate = fFormatFin(sUpdate, sFinEnCours2, "2")
sUpdate = fFormatFin(sUpdate, sFinEnCours3, "3")
sUpdate = fFormatFin(sUpdate, sFinEnCours4, "4")
sUpdate = fFormatFin(sUpdate, sFinEnCours5, "5")
sUpdate = sUpdate & "document.form1.cmdEnvoyer.disabled=false" & vbCrLf & "}}"
Set f = fs.OpenTextFile(Server.MapPath("/scripts/Update.js"), 2, true)
f.Write(sUpdate)
f.Close
'---------------------------------------------------------
'Fin de Fichier pour mettre à jour la page de l'administrateur
'---------------------------------------------------------
'---------------------------------------------------------
'Modification du fichier CSS qui détermine le statut choisi
'---------------------------------------------------------
sColor = "0,0,0"
select case sStatut
case 0
sColor = "0,255,0"
case 1
sColor = "255,0,0"
case 2
sColor = "255,0,0"
end select
Set f=fs.OpenTextFile(Server.MapPath("/scripts/StyleStatut.css"), 2, true)
f.Write(".Status" & vbCrLf & _
"{" & vbCrLf & _
"border-left: thin solid rgb(0,0,0);" & vbCrLf & _
"border-top: thin solid rgb(0,0,0);" & vbCrLf & _
"border-right: thin solid rgb(0,0,0);" & vbCrLf & _
"border-bottom: thin solid rgb(0,0,0);" & vbCrLf & _
"background-color: rgb(" & sColor & ");" & vbCrLf & _
"}")
f.Close
'---------------------------------------------------------
'Fin de modification du fichier CSS qui détermine le statut choisi
'---------------------------------------------------------
Set f=Nothing
Set fs=Nothing
response.redirect (request.form("url_khalix") & "&update_adm=yes" )
%>
<p>La page a été mise à jour</p>
<script type="text/javascript">
//window.close();
</script>
</body>
</html> |
Partager