Modificare il file:
\Nozze\Prodotti_edit.asp
<%@ Language=VBScript %> <html> <link REL="stylesheet" href="include/style.css" type="text/css"> <!--#include file="include/Prodotti_dbconnection.asp"--> <!--#include file="include/Prodotti_variables.asp"--> <!--#include file="include/Prodotti_aspfunctions.asp"--> <body bgcolor=white > <script language="JavaScript" src="include/ts_picker.js"></script> <script language="JavaScript" type="text/javascript" src="include/richtext.js"></script> <form method="POST" action="Prodotti_list.asp" name="frmAdmin"> <input type=hidden id="TargetPageNumber" name="TargetPageNumber" value="<%=Request.Form("TargetPageNumber")%>" > <input type=hidden id="cmdGotoPage" name="cmdGotoPage"> <input type=hidden id=masterkey name=masterkey value="<%=Request.Form("masterkey")%>"> <input type=hidden id=action name=action value="backtolist"> <script language="JavaScript"> <!--#INCLUDE FILE="include/jsfunctions.js"--> function GotoPage(nPageNumber) { document.forms.frmAdmin.cmdGotoPage.value = 'GotoPage'; document.forms.frmAdmin.TargetPageNumber.value = nPageNumber; document.forms.frmAdmin.submit(); } </script> </form> <script language="JavaScript"> //Usage: initRTE(imagesPath, includesPath, cssFile) initRTE("include/images/", "include/", ""); </script> <% On Error Resume Next Dim oCat, strADOXTableName call GetADOXConnection message="" mypage=Request.Form("targetpagenumber") if mypage="" then _ mypage=1 myaction=Request.Form("todo") if myaction="view" or myaction="deleteimage" then _ myaction="edit" ' open database connection Set rs = server.CreateObject ("ADODB.Recordset") set dbConnection = server.CreateObject ("ADODB.Connection") dbConnection.ConnectionString = strConnection dbConnection.Open Call ReportError ' delete image if Request.Form("saveid")<>"" and Request.Form("todo")="deleteimage" then strSQL="update " & strTableName & " set " & AddWrappers(Request.Form("imagefield")) & " = NULL " strSQL = strSQL & " where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(Request.Form("saveid"),"'","''") & gstrQuote if strKeyField2<>"" then _ strSQL = strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(Request.Form("saveid2"),"'","''") & gstrQuote2 if strKeyField3<>"" then _ strSQL = strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(Request.Form("saveid3"),"'","''") & gstrQuote3 LogInfo(strSQL) dbConnection.Execute strSQL Call ReportError message="<div class=message><<< Record was saved >>></div>" end if ' save changes if (Request.Form("saveid")<>"" and Request.Form("todo")="edit") then strSQL="update " & strTableName & " set " For i = 1 to Request.Form("FieldName").Count do while Request.Form("Updatable")(i)<>"True" or _ GetEditFormat(Request.Form("FieldName")(i))=EDIT_FORMAT_READONLY i=i+1 if i>=Request.Form("FieldName").Count then exit do loop if i>Request.Form("FieldName").Count then exit for nType = Request.Form("FieldType")(i) strSQL=strSQL & AddWrappers(Request.Form("FieldName")(i)) & "=" ' boolean if nType="11" or (nType="131" and Left(Request.Form(Request.Form("FieldName")(i)),1)="o") then if Request.Form(Request.Form("FieldName")(i))="on" then strValue="1" else strValue="0" end if else ' not boolean if Request.Form(Request.Form("FieldName")(i))="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then strValue = "NULL" else if (Request.Form("NeedQuotes")(i))="True" then strValue= "'" & Replace( Request.Form(Request.Form("FieldName")(i)) , "'", "''") & "'" else if Request.Form(Request.Form("FieldName")(i))="" then strValue="0" else strValue=Request.Form(Request.Form("FieldName")(i)) end if end if end if end if strSQL = strSQL & strValue if i<>Request.Form("FieldName").Count then _ strSQL = strSQL & ", " Next if Right(strSQL,2)= ", " then strSQL = Left(strSQL, Len(strSQL)-2) '1 strSQL = strSQL & " where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(Request.Form("saveid"),"'","''") & gstrQuote if strKeyField2<>"" then _ strSQL = strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(Request.Form("saveid2"),"'","''") & gstrQuote2 if strKeyField3<>"" then _ strSQL = strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(Request.Form("saveid3"),"'","''") & gstrQuote3 LogInfo(strSQL) dbConnection.Execute strSQL Call ReportError message="<div class=message><<< Record was saved >>></div>" end if sMode = "Edit" strSQL="select " if InStr(1, LCase(strSQL), LCase(AddWrappers(strKeyField)))<1 then strSQL = "select " & AddWrappers(strKeyField) & ", " & Mid(strSQL, 8) if strKeyField2<>"" and InStr(1, LCase(strSQL), LCase(AddWrappers(strKeyField2)))<1 then strSQL = "select " & AddWrappers(strKeyField2) & ", " & Mid(strSQL, 8) if strKeyField3<>"" and InStr(1, LCase(strSQL), LCase(AddWrappers(strKeyField3)))<1 then strSQL = "select " & AddWrappers(strKeyField3) & ", " & Mid(strSQL, 8) if Right(strSQL,2)= ", " then strSQL = Left(strSQL, Len(strSQL)-2) '1 strSQL = strSQL & " from " & strTableName strSQL=strSQL & " where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("editid"),"'","''") & gstrQuote if strKeyField2<>"" then _ strSQL=strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(request.form("editid2"),"'","''") & gstrQuote2 if strKeyField3<>"" then _ strSQL=strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(request.form("editid3"),"'","''") & gstrQuote3 Response.Write "<h1>Edit record [" & strKeyField & ": " & request.form("editid") & "]</h1>" response.write message response.write "<div align=left><hr width=300 noshade size=1></div>" LogInfo(strSQL) rs.open strSQL, dbConnection Call ReportError Response.write " <a href=Prodotti_list.asp onClick=""GotoPage( " & mypage & "); return false;"">Back to list</a><br><br>" Response.Write "<table cellpadding=2>" %> <form name="editform" method="post" action=Prodotti_edit.asp > <input type=hidden id="TargetPageNumber" name="TargetPageNumber" value="<%=Request.Form("TargetPageNumber")%>" > <input type=hidden name=saveid value="<%=HTMLEncode(request.form("editid"))%>"> <input type=hidden name=saveid2 value="<%=HTMLEncode(request.form("editid2"))%>"> <input type=hidden name=saveid3 value="<%=HTMLEncode(request.form("editid3"))%>"> <input type=hidden name=editid value="<%=HTMLEncode(request.form("editid"))%>"> <input type=hidden name=editid2 value="<%=HTMLEncode(request.form("editid2"))%>"> <input type=hidden name=editid3 value="<%=HTMLEncode(request.form("editid3"))%>"> <input type=hidden id=masterkey name=masterkey value="<%=Request.Form("masterkey")%>"> <input type=hidden id=NeedQuotes<%=BuildFieldName(strKeyField)%> name=NeedQuotes<%=BuildFieldName(strKeyField)%> value="<%=Request.Form("NeedQuotes" & BuildFieldName(strKeyField))%>"> <% if strKeyField2<>"" then %> <input type=hidden id=NeedQuotes<%=BuildFieldName(strKeyField2)%> name=NeedQuotes<%=BuildFieldName(strKeyField2)%> value="<%=Request.Form("NeedQuotes" & BuildFieldName(strKeyField2))%>"> <% end if %> <% if strKeyField3<>"" then %> <input type=hidden id=NeedQuotes<%=BuildFieldName(strKeyField3)%> name=NeedQuotes<%=BuildFieldName(strKeyField3)%> value="<%=Request.Form("NeedQuotes" & BuildFieldName(strKeyField3))%>"> <% end if %> <% strPK = AddWrappers(strKeyField) if strKeyField2<>"" then strPK = strPK & "," & AddWrappers(strKeyField2) if strKeyField3<>"" then strPK = strPK & "," & AddWrappers(strKeyField3) if strADOXTableName<>"" then set oCat=Nothing %> <!-- buttons --> <tr height=50><td colspan=2 align=center> <input class=button type=submit value="Salva" id=submit1 name=submit1> <input class=button type=reset value="Cancella"> <input type=hidden name=todo value=<%=myaction%>> <input type=hidden name=imagefield value=""> </td></tr> <!-- legend --> <tr height=50><td colspan=2 align=left> <hr width=300 noshade size=1> <!--<img src=images/icon_key.gif> - key field --> <br><img src=images/icon_required.gif> - campo richiesto </td></tr> </table> </form> </body> </html>
[
Íàçàä
]