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
| <%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/TarifPRO.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_TarifPRO_STRING
MM_editTable = "Intitule"
MM_editColumn = "N°"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = ""
MM_fieldsStr = "capcong|value"
MM_columnsStr = "capacite_congelée_(froid)|none,none,NULL"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim modif_pda__MMColParam
modif_pda__MMColParam = "1"
If (Request.QueryString("N°") <> "") Then
modif_pda__MMColParam = Request.QueryString("N°")
End If
%>
<%
Dim modif_pda
Dim modif_pda_numRows
Set modif_pda = Server.CreateObject("ADODB.Recordset")
modif_pda.ActiveConnection = MM_TarifPRO_STRING
modif_pda.Source = "SELECT * FROM pda_compl_froid WHERE N° = " + Replace(modif_pda__MMColParam, "'", "''") + ""
modif_pda.CursorType = 0
modif_pda.CursorLocation = 2
modif_pda.LockType = 1
modif_pda.Open()
modif_pda_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Style5 {
background-color: #0099CC;
color: #000000;
font-size: x-small;
}
.Style6 {
font-size: x-small;
background-color: #990099;
}
.Style7 {font-size: small}
.Style8 {background-color: #0099CC; color: #000000; font-size: small; }
.Style10 {
font-size: small;
font-weight: bold;
text-align: justify;
}
.Style11 {font-size: x-small}
.Style12 {
font-size: small;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div align="left"></div>
<table width="350" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="412"><form method="POST" action="<%=MM_editAction%>" name="form1">
<div align="center">
<table width="346" align="center">
<tr valign="baseline">
<td colspan="2" align="right" nowrap><span class="Style12"><%=(modif_pda.Fields.Item("Réference").Value)%></span></td>
<td width="3" rowspan="2"> </td>
<td colspan="3" rowspan="2"><span class="Style7"><strong></strong></span> </td>
<td width="92"> </td>
</tr>
<tr valign="baseline">
<td colspan="2" align="right" nowrap> €</td>
<td> </td>
</tr>
<tr valign="baseline">
<td colspan="7" align="right" nowrap><div align="center">intitulé:
</div></td>
</tr>
<tr valign="baseline">
<td colspan="7" align="right" nowrap><div align="center">
<input name="capcong" type="text" id="appareil4" value="<%=(modif_pda.Fields.Item("capacite_congelée_(froid)").Value)%>" size="15">
</div></td>
</tr>
<tr valign="baseline">
<td width="78" align="right" nowrap> </td>
<td width="42" align="right" nowrap> </td>
<td> </td>
<td width="40"><span class="Style11">Haut</span></td>
<td width="3"> </td>
<td width="57"><span class="Style11">Larg.</span></td>
<td><span class="Style11">Prof.</span></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap> </td>
<td align="right" nowrap> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td colspan="2" align="right" nowrap><span class="Style5 Style7">€</span></td>
<td> </td>
<td colspan="4"><span class="Style8"></span></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap>:</td>
<td align="right" nowrap> </td>
<td> </td>
<td colspan="4"><span class="Style10"></span></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap> </td>
<td colspan="6" align="right" nowrap>
<div align="center">
<input type="submit" value="Mettre à jour l'enregistrement">
</div></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= modif_pda.Fields.Item("N°").Value %>">
</div>
</form>
<p align="left"> </p></td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"></div> <div align="center"></div></td>
</tr>
</table>
<div align="center"></div>
<div align="left"></div>
</body>
</html>
<%
modif_pda.Close()
Set modif_pda = Nothing
%> |
Partager