<%@ Language=VBScript %> <%Response.Buffer=True%> <% Updated = Request.QueryString("Updated") %> <% PageTitle = "SiteManager - Edit New Product" %> <% PageID=204 %> <% Header %> <% Menu PageID %> <%' Main body of page goes here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <%ProductEdit%> <%' End Of Main body ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> <% Footer %> <% Sub ProductEdit%>

<%= FormatDateTime(Date,1) %>

<% ProdID = Request.QueryString("PID") Response.Buffer=True error = "" OpenConnection1 SET rs=Server.CreateObject("ADODB.Recordset") If Request.Form("hidSave")="true" then If TRIM(Request.Form("txtDescription"))<>"" AND TRIM(Request.Form("txtProduct"))<>"" then nCatID = Request.Form("selCat") txtProduct = dbReplace(Trim(Request.Form("txtProduct"))) txtTeaser=dbReplace(Trim(Request.Form("txtTeaser"))) txtDescription = dbReplace(Trim(Request.Form("txtDescription"))) txtManufacturer = dbReplace(Trim(Request.Form("txtManufacturer"))) txtManURL = dbReplace(Trim(Request.Form("txtManURL"))) SQL="SELECT * FROM Products WHERE ProductID=" & ProdID rs.Open SQL,DB,1,3 If rs.EOF then rs.Close Response.Redirect("Product_Details.asp?PID=" & ProdID) Else rs("nCatID") = nCatID rs("txtProduct") = txtProduct rs("txtTeaser")=txtTeaser rs("txtDescription") = txtDescription rs("txtManufacturer") = txtManufacturer rs("txtManURL") = txtManURL rs.Update rs.Close Response.Redirect("Product_Details.asp?PID=" & ProdID) End If End If If TRIM(Request.Form("txtProduct"))="" then error = "A Product Name is required.
" End If If Trim(txtDescription)="" then error=error & "A Product Description is required.
" End If Else SEL = "SELECT txtProduct,txtTeaser,txtDescription,txtManufacturer,nCatID,txtManURL FROM Products WHERE ProductID="&ProdID rs.Open SEL,DB,1,3 nCatID=rs("nCatID") txtProduct=DisPrepText(rs("txtProduct")) txtTeaser=DisPrepText(rs("txtTeaser")) txtDescription=DisPrepText(rs("txtDescription")) txtManufacturer=DisPrepText(rs("txtManufacturer")) txtManURL=DisPrepText(rs("txtManURL")) rs.Close End If %> <% If error <> "" Then%>

<%=error%>

<% error="" End If %>

Product Category:
Product Name:
Product Teaser:  (Short description to appear on Product List)
Product Description:
Manufacturer:
Manufacturer's Website:



<%End Sub %> <% Function IsSelected(value,data) If value=data then IsSelected="Selected" Else IsSelected="" End If End Function %>