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 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
|
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!-- #INCLUDE FILE = "ParamCRA.inc" -->
<%
dim objConnect, objConnect2
dim objRecordset
dim sql
' ---- CHRISTOPHE ----
'dim Compte
'dim pos
'pos =instr(1,Request.ServerVariables("LOGON_USER"), "\")
'if (pos > 0) then
' Compte = mid(Request.ServerVariables("LOGON_USER"), pos+1)
'else
' Compte = Request.ServerVariables("LOGON_USER")
'end if
set objConnect = Server.CreateObject("ADODB.Connection")
objConnect.Open (ChaineConnexion01)
set objConnect2= Server.CreateObject("ADODB.Connection")
objConnect2.Open (ChaineConnexion02)
%>
<html>
<head>
<script language=Javascript src="./RechNom.js"></script>
<script language="JavaScript">
function controlForm()
{
if(checkDate())
{
document.Go.submit();
parent.frames['corps'].window.location='insertion.asp';
}
}
function checkDate()
{
var top=true;
if (document.Go.elements["types"].value == 0) {alert("Saisissez un types !"); top = false;}
if (document.Go.elements["Urgence"].value == 0) {alert("Saisissez une urgence !"); top = false;}
if (document.Go.elements["descriptif"].value == 0) {alert("Saisissez un déscriptif !"); top = false;}
if (document.Go.elements["nom"].value == 0 and document.Go.elements("autre") ) {alert("Saisissez un nom !"); top = false;}
if (document.Go.elements["createur"].value == 0) {alert("Saisissez un createur !"); top = false;}
return top;
}
function setSelectionRange(input, selectionStart, selectionEnd) {
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}
}
function setCaretToEnd (input) {
setSelectionRange(input, input.value.length, input.value.length);
}
</script>
<script language="javascript">
function Griser(Action,valeur)
{
if (Action == "nomG")
{
var taille =0;
taille= document.getElementById('AutreG').value.length;
if (taille == 0){
document.getElementById('myTextbox').disabled = false; }
else
{
document.getElementById('myTextbox').disabled = true; }
else if (Action =="autreG")
// '{
//'if (document.Go.elements['myTextbox'].value != 0)
{
document.getElementById('AutreG').disabled = true; }
// 'else if (document.Go.elements['myTextbox'].value == 0)
// '{
// 'document.getElementById('AutreG').disabled = False; }
}
</script>
<style>
body
{
width:700px;
margin-top:5px;
background-color: rgb(192,192,192);
}
fieldset
{
width:100%;
height:140px;
overflow="hidden";
}
legend
{
font-family: Arial, "Arial Black", "Times New Roman", Times, serif;
font-weight: bold;
}
table
{
padding-left: 5px;
padding-right: 5px;
width:100%;
}
th
{
font-family: Arial, "Arial Black", "Times New Roman", Times, serif;
font-size: x-small;
font-weight:normal;
text-align:left;
}
.ti
{
font-family: Arial, "Arial Black", "Times New Roman", Times, serif;
font-size: x-small;
font-weight:normal;
text-align:left;
}
a
{
font-size: x-small;
font-family: Arial, "Arial Black", "Times New Roman", Times, serif;
}
a:visited
{
color:blue;
}
select
{
width:145px;
}
</style>
</head>
<body onload="setCaretToEnd(document.getElementById('myTextbox'));">
<span style="width:100%;">
<a style="float:left;" href="./Liste.asp" title="Titre du lien" target="entete"> Incident en cours</a>
<a style="float:right;padding-right:5px;" href="./Parm.asp" title="Titre du lien" target="corps"> Parametres</a>
<a style="float:right;padding-right:5px;" href="./stat.asp" title="Titre du lien" target="corps"> Statistique</a>
<a style="float:right; padding-right:5px;" href="./recherche.asp" title="Titre du lien" target="corps"> Recherche</a>
<a style="float:right; padding-right:5px;color:white;" href="./insertion.asp" title="Titre du lien" target="corps"> Ajout incident</a>
</span>
<FORM NAME="Go" METHOD="post" ACTION="./Insertion.asp" TARGET="corps">
<INPUT TYPE="hidden" NAME="flag" >
<INPUT TYPE="hidden" NAME="pass" >
<fieldset>
<legend>Insertion</legend>
<table cellpadding="0" cellspacing="0" >
<tr>
<th>Type d'incident :</th>
<td>
<select name="types">
<%
if request.form("types") <> "" then
Response.Write ("<OPTION VALUE=""" &request.form("types")& """>Champ rempli</OPTION>")
else
response.write("<option value="""">Choisir un type</option>")
set objRecordset = objConnect.execute("SELECT IdTypesIncident, TypeIncident FROM TypeIncident;")
Do While not objRecordset.eof
Response.Write ("<OPTION VALUE=""" & objRecordset("IdTypesIncident") & """>" &objRecordset("TypeIncident")& "</OPTION>")
objRecordset.MoveNext
loop
end if
%>
</select>
</td>
<td class="ti">
Degré d'urgence :
</td>
<td>
<select name="Urgence">
<%
if request.form("Urgence") <> "" then
response.write("<option value=""" &request.form("Urgence")& """>Champ rempli</option>")
else
response.write("<option value="""">Choisir une urgence</option>")
set objRecordset = objConnect.execute("SELECT IdUrgence, DegUrgence FROM DegUrgence;")
Do While not objRecordset.eof
Response.Write (" <OPTION value="" " & objRecordset("IdUrgence") & " ""> " & objRecordset("DegUrgence") & "</OPTION>" )
objRecordset.MoveNext
loop
end if
%>
</select>
</td>
<td colspan=2 rowspan=2 >
<%
if request.form("pass") = "1" then
sql = " SELECT ann.nOpID, ann.tOpNom + ' ' + isnull(ann.tOpPren,'') AS NomPre " & _
" FROM Annuaire_TP ann " & _
" WHERE (ann.nOpID > 1000 And ann.tOpNom is not Null And (ann.ddatclo > getdate() or ann.ddatclo is null) " & _
" and ((ann.nOpTyp/2) % 2 = 1 or (ann.nOpTyp/1) % 2 = 1 ) AND ann.nOpID<>0) and tOpNom not like 'coffre%' " & _
" and ann.nOpID="&Request.Form("nOpID")& ""
set objRecordset = objConnect2.execute(sql)
response.write("<input type=""hidden"" name=""pass"" value=""0"">")
response.write("<select style=""width:200px"" size=""5"" name="""" >")
response.write("<input type=""hidden"" name=""nOpID"" value=""" & objRecordset("nOpID") & """>")
else
%>
<div id="nOpID" ><select style="width:200px" size="5" name="" ></div>
<%end if %>
</select>
</td>
</tr>
<tr>
<th>
Descriptif de l'incident :
</th>
<td >
<%
if request.form("descriptif") <> "" then
response.write("<TEXTAREA NAME=""descriptif"" ROWS=3 COLS=25>" &request.form("descriptif")& "</TEXTAREA>")
else
response.write("<TEXTAREA NAME=""descriptif"" ROWS=3 COLS=25></TEXTAREA>")
end if
%>
</td>
<td class="ti">
Nom de la personne :<br>
Numéro de Tel :<br>
Autre :
</td>
<td >
<%
if request.form("pass") ="1" then
sql = " SELECT ann.nOpID, ann.tOpNom + ' ' + isnull(ann.tOpPren,'') AS NomPre " & _
" FROM Annuaire_TP ann " & _
" WHERE (ann.nOpID > 1000 And ann.tOpNom is not Null And (ann.ddatclo > getdate() or ann.ddatclo is null) " & _
" and ((ann.nOpTyp/2) % 2 = 1 or (ann.nOpTyp/1) % 2 = 1 ) AND ann.nOpID<>0) and tOpNom not like 'coffre%' " & _
" and ann.nOpID =" & Request.Form("nOpID") & " "
set objRecordset = objConnect2.execute(sql)
Response.Write (" <input type=""text"" id=""myTextbox"" name=""nom"" onkeyup=""document.Go.action='./Insertion.asp';document.Go.target='corps';document.Go.flag.value='2';document.Go.submit();"" VALUE=""" &objRecordset("NomPre")& """ >")
else
Response.Write (" <input type=""text"" id=""myTextbox"" name=""nom"" onkeyup=""RechNom(this.value)"" value="""" ></input> ")
end if
%>
<br>
<%
if request.form("pass") ="1" then
sql = " SELECT telephone " & _
" FROM Telephone " & _
" WHERE idpersonne = " & Request.Form("nOpID")& ""
set objRecordset = objConnect.execute(sql)
if not objRecordset.eof then
Response.Write (" <INPUT TYPE=""text"" NAME=""Tel"" VALUE=""0" &objRecordset("telephone")& """>")
else
Response.Write (" <INPUT TYPE=""text"" NAME=""Tel"" VALUE="""">")
Response.Write (" <INPUT TYPE=""hidden"" NAME=""NouvTel"" VALUE=""1"">")
end if
else
Response.Write (" <INPUT TYPE=""text"" NAME=""Tel"" VALUE="""">")
end if
%>
<br>
<input name="autre" type="text" id="AutreG" OnKeyPress=Griser("nomG") >
</td>
<td>
</td>
</tr>
<tr>
<th>
Enregistré par :
</th>
<td>
<select name="createur">
<%
if request.form("createur") <> "" then
set objRecordset =objConnect.execute("SELECT IdUser, TxtUser FROM Utilisateur ORDER BY TxtUser")
do while not objRecordset.eof
if cstr(objRecordset("IdUser")) = request.form("createur") then
Response.Write ("<OPTION VALUE=""" &objRecordset("IdUser")& """>" &objRecordset("TxtUser")& "</OPTION>")
end if
objRecordset.MoveNext
loop
else
response.write("<option value="""">Choisir un createur</option>")
end if
sql = "SELECT IdUser, Nom + ' ' + Prenom AS TxtUser "&_
"FROM Utilisateur2 "&_
"ORDER BY TxtUser "
set objRecordset = objConnect.execute(sql)
Do While not objRecordset.eof
Response.Write ("<OPTION VALUE=""" & objRecordset("IdUser")& """>" & objRecordset("TxtUser") & "</OPTION>")
objRecordset.MoveNext
loop
%>
</select>
</td>
<td class="ti">Date :
</td>
<td>
<input name="date" type="text" value="<%Response.Write(date)%>" >
</td>
<TD style="text-align:right;">
<INPUT TYPE="hidden" NAME="passage" VALUE="1">
<INPUT TYPE="hidden" NAME="typeIns" VALUE="1">
<input style="height:20px;margin-top:5px;"type="button" value="Ok!" onClick="document.Go.action='./Liste.asp';document.Go.target='entete';controlForm();" /> </TD>
</tr>
<%
objConnect.close
objConnect2.close
%>
</TABLE>
</FORM>
</HTML> |
Partager