%@ LANGUAGE = VBScript %> <% Response.Expires = -1 %> <% Const adOpenKeyset = 1 Const adLockOptimistic = 3 Dim strItemNumber strItemNumber = trim(Request.Form("ItemNumber")) fieldValue = strItemNumber Call ValidateFieldValue() If strItemNumber = "" Then Response.Redirect "error.asp?Error=You must enter an Item Number for this item." End If Dim strDescription strDescription = trim(Request.Form("Description")) fieldValue = strDescription Call ValidateFieldValue() If strDescription = "" Then Response.Redirect "error.asp?Error=You must enter a Description for this item." End If Dim strShowNotes strShowNotes = Request.Form("ShowNotes") Dim strNotesDescript strNotesDescript = trim(Request.Form("NotesDescript")) fieldValue = strNotesDescript Call ValidateFieldValue() Dim strCat1Id strCat1Id = Request.Form("Cat1Id") Dim strCat1Name strCat1Name = Request("Cat1Name") Dim strCat2Id strCat2Id = Request.Form("Cat2Id") Dim strCat2Name strCat2Name = Request("Cat2Name") Dim strCat3Id strCat3Id = Request.Form("Cat3Id") Dim strCat3Name strCat3Name = Request("Cat3Name") Dim strCat4Id strCat4Id = Request.Form("Cat4Id") Dim strCat4Name strCat4Name = Request("Cat4Name") Dim strOpt1 strOpt1 = Request.Form("Opt1") Dim strOpt2 strOpt2 = Request.Form("Opt2") Dim strOpt3 strOpt3 = Request.Form("Opt3") Dim strPrice strPrice = trim(Request.Form("Price")) If NOT IsNumeric(strPrice) Then strPrice = 0 End If Dim strArrayVal, strPriceSet, strPriceSetId, strPriceSetName strPriceSet = Request("PriceSet") If (strPriceSet <> "None") Then strArrayVal = split(strPriceSet, ",", -1) strPriceSetId = strArrayVal(0) strPriceSetName = strArrayVal(1) Else strPriceSetId = "None" strPriceSetName = "None" End If Dim strSalePrice strSalePrice = trim(Request.Form("SalePrice")) If NOT IsNumeric(strSalePrice) Then strSalePrice = 0 End If Dim strOnSale strOnSale = Request.Form("OnSale") Dim strFeatured strFeatured = Request.Form("Featured") Dim strDisplayOnShop strDisplayOnShop = Request.Form("DisplayOnShop") Dim strDownload strDownload = Request.Form("Download") Dim strFileName strFileName = trim(Request.Form("FileName")) Dim strTaxable strTaxable = Request.Form("Taxable") Dim strHide strHide = Request.Form("Hide") Dim strImageURL strImageURL = trim(Request.Form("ImageURL")) Dim strSmallImageURL strSmallImgURL = trim(Request.Form("SmallImgURL")) Dim strStock strStock = trim(Request.Form("Stock")) If NOT IsNumeric(strStock) Then strStock = 100 End If Dim strHandling strHandling = trim(Request.Form("Handling")) If NOT isNumeric(strHandling) Then strHandling = 0 End If Dim strShipping strShipping = trim(Request.Form("Shipping")) If NOT IsNumeric(strShipping) Then strShipping = 0 End If Dim strWeight strWeight = trim(Request.Form("Weight")) If NOT IsNumeric(strWeight) Then strWeight = 0 End If Dim strDetails strDetails = Request.Form("Details") Dim strFeatures strFeatures = Request.Form("Features") DIM objRS1, mySql1 Set objRS1 = Server.CreateObject("ADODB.Recordset") mySql1= "Select * From Products Where ItemNumber='"& strItemNumber &"'" objRS1.Open mySql1, objConn, 1, 3 If objRS1.EOF Then DIM objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "Products", objConn, 1, 3 objRS.AddNew objRS("ItemNumber") = strItemNumber objRS("Description") = strDescription objRS("ShowNotes") = strShowNotes objRS("NotesDescript") = strNotesDescript objRS("Cat1Id") = strCat1Id objRS("Cat2Id") = strCat2Id objRS("Cat3Id") = strCat3Id objRS("Cat4Id") = strCat4Id objRS("Opt1") = strOpt1 objRS("Opt2") = strOpt2 objRS("Opt3") = strOpt3 objRS("Price") = strPrice objRS("PriceSet") = strPriceSetId objRS("PriceSetName") = strPriceSetName objRS("SalePrice") = strSalePrice objRS("OnSale") = strOnSale objRS("Featured") = strFeatured objRS("DisplayOnShop") = strDisplayOnShop objRS("Download") = strDownload objRS("FileName") = strFileName objRS("Taxable") = strTaxable objRS("Hide") = strHide objRS("ImageURL") = strImageURL objRS("SmallImgURL") = strSmallImgURL objRS("Stock") = strStock objRS("Handling") = strHandling objRS("Shipping") = strShipping objRS("Weight") = strWeight objRS("Details") = strDetails objRS("Features") = strFeatures objRS.Update Else Response.Redirect "error.asp?Error=Item "& strItemNumber &" is already in the database." Response.End End If %> <% DIM objRSProducts, mySqlProducts Set objRSProducts = Server.CreateObject("ADODB.Recordset") mySqlProducts= "Select * From Products Where ItemNumber='"& strItemNumber &"'" objRSProducts.Open mySqlProducts, objConn, 1, 3 %>
| Item: <%= strItemNumber %> Has been successfully added to the database. | |||||
| In Category: <%= strCat1Name %> > <%= strCat2Name %> > <%= strCat3Name %> > <%= strCat4Name %> | |||||
| Show Notes: <%= strShowNotes %> | Downloadable: <%= strDownload %> | Stock: <%= strStock %> | Weight: <%= strWeight %> | Featured Item: <%= strFeatured %> | |
| Download File Name: <%= strFileName %> | Display this item on the main shopping page: <%= strDisplayOnShop %> | ||||
| Notes Box Title: <%= strNotesDescript %> | |||||
| <%= strDescription %> | |||||||||||
|
Item: <%= strItemNumber %> |
Quantity: | Price: <%= strCurrencySymbol %><%= strPrice %> <%= strCurrencyCode %> | |||||||||
|
<% If (strOnSale = "Yes") Then %>
On Sale! Sale Price: <%= strCurrencySymbol %><%= strSalePrice %> <%= strCurrencyCode %> <% Else End If %>
|
|||||||||||
|
|||||||||||
Preview Item in "Details Page" View
|
|
<%= objRS("NotesDescript") %> <% Else Response.Write "" End If %>
|
||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||
|
Features: |
|||||||||||||||||||||||||