<% 'This code is copyright (c) Internet Business Solutions SL, all rights reserved. 'The contents of this file are protect under law as the intellectual property 'of Internet Business Solutions SL. Any use, reproduction, disclosure or copying 'of any kind without the express and written permission of Internet Business 'Solutions SL is forbidden. 'Author: Vince Reid, vince@virtualred.net if storesessionvalue="" then storesessionvalue="virtualstore" if Session("loggedon") <> storesessionvalue OR disallowlogin=TRUE then response.end Dim sSQL,rs,alldata,success,cnn,rowcounter,allsections,alloptions,errmsg,prodoptions,lasttsid,dorefresh success=true Set rs = Server.CreateObject("ADODB.RecordSet") Set rs2 = Server.CreateObject("ADODB.RecordSet") Set cnn=Server.CreateObject("ADODB.Connection") cnn.open sDSN alreadygotadmin = getadminsettings() Session.LCID=1033 simpleOptions = (adminTweaks AND 2)=2 simpleSections = (adminTweaks AND 4)=4 if maxprodsects="" then maxprodsects=20 dorefresh=FALSE if request.form("posted")="1" then pExemptions=0 if Trim(request.form("pExemptions"))<>"" then pExemptArray=Split(request.form("pExemptions"), ",") for each pExemptObj in pExemptArray pExemptions = pExemptions + pExemptObj next end if if request.form("act")="delete" then sSQL = "DELETE FROM pricebreaks WHERE pbProdID='"&request.form("id")&"'" cnn.Execute(sSQL) sSQL = "DELETE FROM cpnassign WHERE cpaType=2 AND cpaAssignment='"&request.form("id")&"'" cnn.Execute(sSQL) sSQL = "DELETE FROM products WHERE pID='" & request.form("id")&"'" cnn.Execute(sSQL) sSQL = "DELETE FROM prodoptions WHERE poProdID='" & request.form("id")&"'" cnn.Execute(sSQL) sSQL = "DELETE FROM multisections WHERE pID='" & request.form("id")&"'" cnn.Execute(sSQL) dorefresh=TRUE elseif request.form("act")="domodify" then if Trim(Request.Form("newid")) <> Trim(Request.Form("id")) then sSQL = "SELECT * FROM products WHERE pID='"&Trim(request.form("newID"))&"'" rs.Open sSQL,cnn,0,1 success = rs.EOF rs.Close if success then cnn.Execute("UPDATE pricebreaks SET pbProdID='"&request.form("newid")&"' WHERE pbProdID='"&request.form("id")&"'") cnn.Execute("UPDATE cpnassign SET cpaAssignment='"&request.form("newid")&"' WHERE cpaType=2 AND cpaAssignment='"&request.form("id")&"'") end if end if if success then sSQL = "UPDATE products SET " & _ "pID='"& Trim(Request.Form("newid")) &"', " & _ "pName='"& Replace(Trim(Request.Form("pName")),"'","''") &"', " & _ "pSection="& Trim(Request.Form("pSection")) &", " & _ "pDropship="& Trim(Request.Form("pDropship")) &", " & _ "pExemptions="& pExemptions &", " & _ "pDescription='"& Replace(Trim(Request.Form("pDescription")),"'","''") &"', " & _ "pImage='"& Replace(Trim(Request.Form("pImage")),"'","''") &"', " & _ "pLongDescription='"& Replace(Trim(Request.Form("pLongDescription")),"'","''") &"', " for index=2 to adminlanguages+1 if (adminlangsettings AND 1)=1 then sSQL = sSQL & "pName"&index&"='"& Replace(Trim(Request.Form("pName"&index)),"'","''") &"', " if (adminlangsettings AND 2)=2 then sSQL = sSQL & "pDescription"&index&"='"& Replace(Trim(Request.Form("pDescription"&index)),"'","''") &"', " if (adminlangsettings AND 4)=4 then sSQL = sSQL & "pLongDescription"&index&"='"& Replace(Trim(Request.Form("pLongDescription"&index)),"'","''") &"', " next sSQL = sSQL & "pLargeImage='"& Replace(Trim(Request.Form("pLargeImage")),"'","''") &"', " if Trim(Request.Form("pDisplay")) = "ON" then sSQL = sSQL & "pDisplay=1," else sSQL = sSQL & "pDisplay=0," end if if perproducttaxrate=true then sSQL = sSQL & "pTax=" & Trim(Request.Form("pTax")) & "," end if if stockManage<>0 AND IsNumeric(Trim(request.form("inStock"))) then sSQL = sSQL & "pInStock=" & Trim(request.form("inStock"))&"," end if if Trim(Request.Form("pSell")) = "ON" then pSell=1 else pSell=0 if Trim(Request.Form("stockOptions")) = "1" then pSell=pSell+2 if Trim(Request.Form("staticpage")) = "1" then pSell=pSell+4 sSQL = sSQL & "pSell=" & pSell & "," if productdimensions=true then sSQL = sSQL & "pDims='" & Trim(request.form("plen")) & "x" & Trim(request.form("pwid")) & "x" & Trim(request.form("phei")) & "'," end if if digidownloads=true then sSQL = sSQL & "pDownload='" & trim(replace(request.form("pDownload"),"'","''")) & "'," end if if shipType=1 then if NOT IsNumeric(Trim(request.form("pShipping"))) then sSQL = sSQL & "pShipping=0," else sSQL = sSQL & "pShipping="&Trim(request.form("pShipping"))&"," end if if NOT IsNumeric(Trim(request.form("pShipping2"))) then sSQL = sSQL & "pShipping2=0," else sSQL = sSQL & "pShipping2="&Trim(request.form("pShipping2"))&"," end if elseif shipType=2 OR shipType=3 OR shipType=4 OR shipType=6 then if NOT IsNumeric(Trim(request.form("pShipping"))) then sSQL = sSQL & "pWeight=0," else sSQL = sSQL & "pWeight="&Trim(request.form("pShipping"))&"," end if end if if Trim(Request.Form("pWholesalePrice"))<>"" then sSQL = sSQL & "pWholesalePrice="& Trim(Request.Form("pWholesalePrice")) &"," else sSQL = sSQL & "pWholesalePrice=0," end if if Trim(Request.Form("pListPrice"))<>"" then sSQL = sSQL & "pListPrice="& Trim(Request.Form("pListPrice")) &"," else sSQL = sSQL & "pListPrice=0," end if sSQL = sSQL & "pPrice="& Trim(Request.Form("pPrice")) &" " & _ "WHERE pID='"&Request.Form("id")&"'" on error resume next cnn.Execute(sSQL) sSQL = "DELETE FROM prodoptions WHERE poProdID='"&Request.Form("id")&"'" cnn.Execute(sSQL) for rowcounter=0 to maxprodopts-1 if request.form("pOption"&rowcounter)<>"" AND request.form("pOption"&rowcounter)<>0 then sSQL = "INSERT INTO prodoptions (poProdID,poOptionGroup) VALUES ('"&Request.Form("newid")&"',"&request.form("pOption"&rowcounter)&")" cnn.Execute(sSQL) end if next sSQL = "DELETE FROM multisections WHERE pID='"&Request.Form("id")&"'" cnn.Execute(sSQL) for rowcounter=0 to maxprodsects-1 if request.form("pSection"&rowcounter)<>"" AND request.form("pSection"&rowcounter)<>0 AND Request.Form("pSection")<>request.form("pSection"&rowcounter) then sSQL = "SELECT pID FROM multisections WHERE pID='" & Request.Form("newid") & "' AND pSection="&request.form("pSection"&rowcounter) rs.Open sSQL,cnn,0,1 if rs.EOF then sSQL = "INSERT INTO multisections (pID,pSection) VALUES ('"&Request.Form("newid")&"',"&request.form("pSection"&rowcounter)&")" cnn.Execute(sSQL) end if rs.Close end if next if err.number<>0 then success=false errmsg = "There was an error writing to the database.
" & err.description else dorefresh=TRUE end if on error goto 0 else errmsg = yyPrDup end if elseif request.form("act")="doaddnew" then sSQL = "SELECT * FROM products WHERE pID='"&Trim(request.form("newID"))&"'" rs.Open sSQL,cnn,0,1 success = rs.EOF rs.Close if success then sSQL = "INSERT INTO products (pID,pName,pSection,pDropship,pExemptions,pDescription,pImage,pLongDescription," for index=2 to adminlanguages+1 if (adminlangsettings AND 1)=1 then sSQL = sSQL & "pName" & index & "," if (adminlangsettings AND 2)=2 then sSQL = sSQL & "pDescription" & index & "," if (adminlangsettings AND 4)=4 then sSQL = sSQL & "pLongDescription" & index & "," next sSQL = sSQL & "pLargeImage,pPrice,pWholesalePrice,pListPrice," if shipType=1 then sSQL = sSQL & "pShipping,pShipping2," sSQL = sSQL & "pDisplay," if perproducttaxrate=true then sSQL = sSQL & "pTax," if stockManage<>0 AND IsNumeric(Trim(request.form("inStock"))) then sSQL = sSQL & "pInStock," if productdimensions=true then sSQL = sSQL & "pDims," if digidownloads=true then sSQL = sSQL & "pDownload," sSQL = sSQL & "pSell,pWeight) VALUES (" & _ "'"&Trim(request.form("newID"))&"'," & _ "'"&replace(request.form("pName"),"'","''")&"'," & _ request.form("pSection")&"," & _ request.form("pDropship")&"," & _ pExemptions &"," & _ "'"&replace(request.form("pDescription"),"'","''")&"'," & _ "'"&replace(request.form("pImage"),"'","''")&"'," & _ "'"&replace(request.form("pLongDescription"),"'","''")&"'," for index=2 to adminlanguages+1 if (adminlangsettings AND 1)=1 then sSQL = sSQL & "'"& Replace(Trim(Request.Form("pName"&index)),"'","''") &"'," if (adminlangsettings AND 2)=2 then sSQL = sSQL & "'"& Replace(Trim(Request.Form("pDescription"&index)),"'","''") &"'," if (adminlangsettings AND 4)=4 then sSQL = sSQL & "'"& Replace(Trim(Request.Form("pLongDescription"&index)),"'","''") &"'," next sSQL = sSQL & "'"&replace(request.form("pLargeImage"),"'","''")&"'," & _ Trim(request.form("pPrice"))&"," if Trim(request.form("pWholesalePrice"))<>"" then sSQL = sSQL & Trim(request.form("pWholesalePrice")) & "," else sSQL = sSQL & "0," end if if Trim(request.form("pListPrice"))<>"" then sSQL = sSQL & Trim(request.form("pListPrice")) & "," else sSQL = sSQL & "0," end if if shipType=1 then if NOT IsNumeric(Trim(request.form("pShipping"))) then sSQL = sSQL & "0," else sSQL = sSQL & Trim(request.form("pShipping"))&"," end if if NOT IsNumeric(Trim(request.form("pShipping2"))) then sSQL = sSQL & "0," else sSQL = sSQL & Trim(request.form("pShipping2"))&"," end if end if if Trim(Request.Form("pDisplay")) = "ON" then sSQL = sSQL & "1," else sSQL = sSQL & "0," end if if perproducttaxrate=true then sSQL = sSQL & request.form("pTax") & "," if stockManage<>0 AND IsNumeric(Trim(request.form("inStock"))) then sSQL = sSQL & Trim(request.form("inStock"))&"," end if if productdimensions=true then sSQL = sSQL & "'" & Trim(request.form("plen")) & "x" & Trim(request.form("pwid")) & "x" & Trim(request.form("phei")) & "'," end if if digidownloads=true then sSQL = sSQL & "'" & trim(replace(request.form("pDownload"),"'","''")) & "'," end if if Trim(Request.Form("pSell")) = "ON" then pSell=1 else pSell=0 if Trim(Request.Form("stockOptions")) = "1" then pSell=pSell+2 if Trim(Request.Form("staticpage")) = "1" then pSell=pSell+4 sSQL = sSQL & pSell & "," if shipType <= 1 OR NOT IsNumeric(Trim(request.form("pShipping"))) then sSQL = sSQL & "0" elseif shipType=2 OR shipType=3 OR shipType=4 OR shipType=6 then sSQL = sSQL & Trim(request.form("pShipping"))&"" else sSQL = sSQL & Trim(request.form("pShipping"))&"." if Int(Trim(request.form("pShipping2"))) < 10 then sSQL = sSQL & "0" sSQL = sSQL & Trim(request.form("pShipping2")) end if sSQL = sSQL & ")" on error resume next cnn.Execute(sSQL) for rowcounter=0 to maxprodopts-1 if request.form("pOption"&rowcounter)<>"" AND request.form("pOption"&rowcounter)<>0 then sSQL = "INSERT INTO prodoptions (poProdID,poOptionGroup) VALUES ('"&Request.Form("newid")&"',"&request.form("pOption"&rowcounter)&")" cnn.Execute(sSQL) end if next sSQL = "DELETE FROM multisections WHERE pID='"&Request.Form("newid")&"'" cnn.Execute(sSQL) for rowcounter=0 to maxprodsects-1 if request.form("pSection"&rowcounter)<>"" AND request.form("pSection"&rowcounter)<>0 AND Request.Form("pSection")<>request.form("pSection"&rowcounter) then sSQL = "SELECT pID FROM multisections WHERE pID='" & Request.Form("newid") & "' AND pSection="&request.form("pSection"&rowcounter) rs.Open sSQL,cnn,0,1 if rs.EOF then sSQL = "INSERT INTO multisections (pID,pSection) VALUES ('"&Request.Form("newid")&"',"&request.form("pSection"&rowcounter)&")" cnn.Execute(sSQL) end if rs.Close end if next if err.number<>0 then success=false errmsg = errmsg & err.description else dorefresh=TRUE end if on error goto 0 else errmsg = yyPrDup end if elseif request.form("act")="dodiscounts" then sSQL = "INSERT INTO cpnassign (cpaCpnID,cpaType,cpaAssignment) VALUES ("&request.form("assdisc")&",2,'"&request.form("id")&"')" cnn.Execute(sSQL) dorefresh=TRUE elseif request.form("act")="deletedisc" then sSQL = "DELETE FROM cpnassign WHERE cpaID="&request.form("id") cnn.Execute(sSQL) dorefresh=TRUE end if if request.form("act")="modify" OR request.form("act")="clone" OR request.form("act")="addnew" then sSQL = "SELECT optGrpID, optGrpWorkingName FROM optiongroup ORDER BY optGrpWorkingName" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alloptions=rs.getrows rs.Close if request.form("act")="modify" OR request.form("act")="clone" then sSQL = "SELECT poID, poOptionGroup FROM prodoptions WHERE poProdID='"&Trim(Request.Form("id"))&"'" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then prodoptions=rs.getrows rs.Close sSQL = "SELECT pSection FROM multisections WHERE pID='"&Trim(Request.Form("id"))&"'" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then prodsections=rs.getrows rs.Close end if sSQL = "SELECT sectionID,sectionWorkingName FROM sections WHERE rootSection=1 ORDER BY sectionWorkingName" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then allsections=rs.getrows rs.Close sSQL = "SELECT dsID,dsName FROM dropshipper ORDER BY dsName" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldropship=rs.getrows rs.Close end if end if if dorefresh then response.write """ then response.write "?ts=" & Trim(request.form("ts")) elseif Trim(request.form("tt"))<>"" then response.write "?tt=" & Trim(request.form("tt")) end if response.write """>" end if %> <% sub show_info() %>

<% end sub if request.form("posted")="1" AND (request.form("act")="modify" OR request.form("act")="clone" OR request.form("act")="addnew") then Dim pNames(10) if request.form("act")="modify" OR request.form("act")="clone" then doaddnew = false sSQL = "SELECT pId,pName,pName2,pName3,pSection,pImage,pPrice,pWholesalePrice,pListPrice,pDisplay,pSell,pShipping,pShipping2,pLargeImage,pWeight,pExemptions,pInStock,pDims,pTax,pDropship," if digidownloads=true then sSQL = sSQL & "pDownload," sSQL = sSQL & "pDescription,pLongDescription FROM products WHERE pId='"&Request.Form("id")&"'" rs.Open sSQL,cnn,0,1 pName = rs("pName") for index=2 to adminlanguages+1 pNames(index)=rs("pName" & index) next pID = rs("pID") pSection = rs("pSection") pImage = rs("pImage")&"" pPrice = rs("pPrice") pWholesalePrice = rs("pWholesalePrice") pListPrice = rs("pListPrice") pDisplay = rs("pDisplay") pSell = rs("pSell") pShipping = rs("pShipping") pShipping2 = rs("pShipping2") pLargeImage = rs("pLargeImage")&"" pWeight = rs("pWeight") pExemptions = rs("pExemptions") pInStock = rs("pInStock") pDims = rs("pDims") if digidownloads=true then pDownload = rs("pDownload") pTax = rs("pTax") pDropship = rs("pDropship") pDescription = rs("pDescription") pLongDescription = rs("pLongDescription") rs.Close else doaddnew = true pID = "" if Trim(request.form("ts"))<>"" then pSection=Int(Trim(request.form("ts"))) else pSection = 0 pImage = "prodimages/" pPrice = "" pWholesalePrice = "" pListPrice = 0 pDisplay = 1 pSell = 1 pShipping = "" pShipping2 = "" pLargeImage = "prodimages/" pWeight = "" pExemptions = 0 pInStock = "" pDims = "" pDownload = "" pTax=0 pDropship = 0 pDescription = "" pLongDescription = "" end if %>
<% if request.form("act")="modify" then %> <% else %> <% end if %> " /> " /> <% for index=2 to adminlanguages+1 if (adminlangsettings AND 1)=1 then %><% end if next %> <% if useStockManagement then %> <% else %> " /> <% end if %> <% if productdimensions=true then proddims = split(pDims&"", "x") %> <% else %> <% end if %> <% if simpleOptions then %> <% else %> <% end if %> <% if simpleOptions then for index=0 to maxprodopts-1 if index MOD 2=0 then response.write "" response.write "" if index MOD 2<>0 then response.write "" & vbCrLf next if index MOD 2=0 then response.write "" & vbCrLf else response.write "" & vbCrLf end if else %>
<% if request.form("act")="modify" then response.write yyYouMod & " "" & pName & """ elseif request.form("act")="addnew" then response.write yyPrUpd else response.write yyYouCln & " "" & pName & """ end if %>
 
*<%=yyPrRef%>: *<%=yySection%>:
*<%=yyPrNam%>:" /> *<%=yyPrPri%>:
*<%=yyPrNam & " " & index%>:" />
" /> <%=yySellBut%>: /><%=yyWhoPri%> (info):
<%=yyDisPro%>: 0 then response.write "checked" %> /> <%=yyListPr%> (info):
<%=yyImage%>:" />*<%=yyDims%>: X X <% if shipType=1 OR shipType=2 OR shipType=3 OR shipType=4 OR shipType=6 then response.write yyShpInf else response.write " " end if %>
<%=yyLgeImg%>: " /> <% if shipType=1 then response.write yyShip & ":
" & yyFirShi elseif shipType=2 OR shipType=3 OR shipType=4 OR shipType=6 then response.write yyPrWght & ":" else response.write " " end if %>
<% if shipType=1 then response.write "" elseif shipType=2 OR shipType=3 OR shipType=4 OR shipType=6 then response.write "" else response.write " " end if %>
 <%=yyNumOpt%>: <% if shipType=1 then response.write yyShip & ":
" & yySubShi else response.write " " end if %>
<% if shipType=1 then response.write "" else response.write " " end if %>
" & yyPrdOpt & " " & index+1 & ":
 
<% end if if digidownloads=true then %> <% end if %> <% for index=2 to adminlanguages+1 if (adminlangsettings AND 2)=2 then if NOT doaddnew then sSQL = "SELECT pDescription" & index & " FROM products WHERE pId='"&Request.Form("id")&"'" rs2.Open sSQL,cnn,0,1 thedescription = rs2("pDescription" & index) rs2.Close end if %> <% end if next %> <% for index=2 to adminlanguages+1 if (adminlangsettings AND 4)=4 then if NOT doaddnew then sSQL = "SELECT pLongDescription" & index & " FROM products WHERE pId='"&Request.Form("id")&"'" rs2.Open sSQL,cnn,0,1 thedescription = rs2("pLongDescription" & index) rs2.Close end if %> <% end if next %> <% if simpleSections then for index=0 to maxprodsects-1 if index MOD 2=0 then response.write "" response.write "" if index MOD 2<>0 then response.write "" & vbCrLf next if index MOD 2=0 then response.write "" & vbCrLf else response.write "" & vbCrLf end if else %>
<%=yyDownl%>:
<%=yyDesc%>: <%=yyDrSppr%>:

<%=yyExemp%> <Ctrl>+Click

<% if perproducttaxrate=TRUE then %>
<%=yyTax%>: % <% end if %>
<%=yyDesc & " " & index%>:
<%=yyLnDesc%>:
<%=yyLnDesc & " " & index%>:
<%=yyStatPg%>: >
<%=yyAddSec%>: <% if NOT simpleSections then %> <% end if %> 
" & yyPrdSec & " " & index+1 & ":
 
<% end if %>

  

<% show_info() %>
<% if NOT doaddnew then %> <% end if elseif request.form("act")="discounts" then sSQL = "SELECT pName FROM products WHERE pID='"&replace(request.form("id"),"'","''")&"'" rs.Open sSQL,cnn,0,1 thisname=rs("pName") rs.Close alldata="" sSQL = "SELECT cpaID,cpaCpnID,cpnWorkingName,cpnSitewide,cpnEndDate,cpnType FROM cpnassign INNER JOIN coupons ON cpnassign.cpaCpnID=coupons.cpnID WHERE cpaType=2 AND cpaAssignment='" & request.form("id") & "'" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldata=rs.GetRows rs.Close alldata2="" tdt = Date() sSQL = "SELECT cpnID,cpnWorkingName,cpnSitewide FROM coupons WHERE cpnSitewide=0 AND cpnEndDate >="&datedelim&DatePart("m",tdt) & "/" & DatePart("d",tdt) & "/" & DatePart("yyyy",tdt)&datedelim rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldata2=rs.GetRows rs.Close %>
" /> " /> " /> <% gotone=false if IsArray(alldata2) then thestr = "" end if if gotone then response.write thestr else %> <% end if if IsArray(alldata) then %> <% for index=0 to UBOUND(alldata,2) prefont = "" postfont = "" if alldata(3,index)=1 OR alldata(4,index)-Date() < 0 then prefont = "" postfont = "" end if %> <% next else %> <% end if %>
<%=yyAssPrd%> "<%=thisname%>".
 
"&yyAsDsCp&":

<%=yyNoDis%>

<%=yyCurDis%> "<%=thisname%>".
 
<%=yyWrkNam%> <%=yyDisTyp%> <%=yyExpire%> <%=yyDelete%>
<%=prefont & alldata(2,index) & postfont %> <% if alldata(5,index)=0 then response.write prefont & yyFrSShp & postfont elseif alldata(5,index)=1 then response.write prefont & yyFlatDs & postfont elseif alldata(5,index)=2 then response.write prefont & yyPerDis & postfont end if %> <% if alldata(4,index)=DateSerial(3000,1,1) then response.write yyNever elseif alldata(4,index)-Date() < 0 then response.write ""&yyExpird&"" else response.write prefont & alldata(4,index) & postfont end if %>

<%=yyNoAss%>

 

<%=yyAdmHom%>
 
<% elseif request.form("posted")="1" AND success then %>

<%=yyUpdSuc%>

<%=yyNowFrd%>

<%=yyNoAuto%> "" then response.write "?ts=" & Trim(request.form("ts")) elseif Trim(request.form("tt"))<>"" then response.write "?tt=" & Trim(request.form("tt")) end if%>"><%=yyClkHer%>.

<% elseif request.form("posted")="1" then %>

<%=yyOpFai%>

<%=errmsg%>

<%=yyClkBac%>
<% elseif request.querystring("tt")<>"" OR request.querystring("ts")<>"" then %>
" /> " /> <% if stockManage<>0 then sSQL = "SELECT pID,pName,pDisplay,pInStock,rootSection,pSell FROM products LEFT OUTER JOIN sections ON products.pSection=sections.sectionID " else sSQL = "SELECT pID,pName,pDisplay,pSell,rootSection FROM products LEFT OUTER JOIN sections ON products.pSection=sections.sectionID " end if if request.querystring("tt")="ALL" then ' Nothing elseif request.querystring("tt")<>"" then sSQL = sSQL & "WHERE topSection="&request.querystring("tt") else sSQL = sSQL & "WHERE pSection="&request.querystring("ts") end if if adminsortorder<>"" then sSQL = sSQL & " ORDER BY " & adminsortorder else sSQL = sSQL & " ORDER BY pName" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldata=rs.getrows rs.Close allcoupon="" sSQL = "SELECT DISTINCT cpaAssignment FROM cpnassign WHERE cpaType=2" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then allcoupon=rs.getrows rs.Close haveerrprods=false if isArray(alldata) then for rowcounter=0 to UBOUND(alldata,2) if bgcolor="#E7EAEF" then bgcolor="#FFFFFF" else bgcolor="#E7EAEF" %> <% next if haveerrprods then %> <% end if else %> <% end if %>
<%=yyPrUpd%>  
 
<%=yyPrId%> <%=yyPrName%> <%=yyDiscnt%> <%=yyModify%> <%=yyDelete%>
<%=alldata(0,rowcounter)%> <% if IsNull(alldata(4,rowcounter)) OR alldata(4,rowcounter)<>1 then response.write "* " haveerrprods=true end if stockbyoptions=false if stockManage<>0 then if (alldata(5,rowcounter) AND 2)=2 then stockbyoptions=true end if if (Int(alldata(3,rowcounter)) <= 0 OR Int(alldata(2,rowcounter)) = 0) AND NOT stockbyoptions then response.write "" if Int(alldata(2,rowcounter)) = 0 then response.write "" response.write alldata(1,rowcounter) if Int(alldata(2,rowcounter)) = 0 then response.write "" if (Int(alldata(3,rowcounter)) <= 0 OR Int(alldata(2,rowcounter)) = 0) AND NOT stockbyoptions then response.write "" %><% if stockManage>0 then if stockbyoptions then response.write " (-)" else response.write " (" & alldata(3,rowcounter) & ")" end if %> type="button" value="<%=yyAssign%>" onclick="discounts('<%=replace(replace(alldata(0,rowcounter),"\","\\"),"'","\'")%>')" /> ',event)" /> ')" />

* <%=yySeePr%>

<%=yyPrNone%>
 

<%=yyANewPr%>  
 

<%=yyAdmHom%>
<% else %>
<% sSQL = "SELECT DISTINCT sectionID,sectionWorkingName FROM sections INNER JOIN products ON sections.sectionID=products.pSection ORDER BY sectionWorkingName" rs.Open sSQL,cnn,0,1 if rs.eof or rs.bof then success=false else alldata=rs.getrows success=true end if rs.Close if IsArray(alldata) then FOR rowcounter=0 TO ubound(alldata,2) if false then if lasttsid <> alldata(2,rowcounter) then lasttsid = alldata(2,rowcounter) response.write "" end if end if response.write "" next end if sSQL = "SELECT payProvEnabled,payProvData1 FROM payprovider WHERE payProvID=2" rs.Open sSQL,cnn,0,1 if rs("payProvEnabled")=1 AND trim(rs("payProvData1")&"")<>"" then %> <% end if rs.Close alldata="" if stockManage<>0 then %> <% sSQL = "SELECT pID,pName,pDisplay,pInStock,pSell FROM products WHERE pInStock<=0" if adminsortorder<>"" then sSQL = sSQL & " ORDER BY " & adminsortorder else sSQL = sSQL & " ORDER BY pName" rs.Open sSQL,cnn,0,1 if NOT rs.EOF then alldata=rs.getrows rs.Close if isArray(alldata) then for rowcounter=0 to UBOUND(alldata,2) if (alldata(4,rowcounter) AND 2)<>2 then %> <% end if if rowcounter>100 then exit for next else %> <% end if end if %>
<%=yyPrClk%>
 
  <%=yyPrAll%>
"&alldata(3,rowcounter)&"
  » "&alldata(1,rowcounter)&"

<%=yyPrOOS%>
 
<%=alldata(0,rowcounter)%> <% if Int(alldata(3,rowcounter)) <= 0 OR Int(alldata(2,rowcounter)) = 0 then response.write "" if Int(alldata(2,rowcounter)) = 0 then response.write "" response.write alldata(1,rowcounter) if Int(alldata(2,rowcounter)) = 0 then response.write "" if Int(alldata(3,rowcounter)) <= 0 OR Int(alldata(2,rowcounter)) = 0 then response.write "" %> ')" /> ')" />

<%=yyPrNoOS%>
 

<%=yyANewPr%>  
 

<%=yyAdmHom%>
<% end if cnn.Close set rs = nothing set cnn = nothing %>