<%@ Language=VBScript %><% '************************************************************ '* * '* By Downloading or using this software, you agree to * '* the terms and conditions as stated in the Software * '* License Agreement. An updated copy of this agreement * '* can be seen at http://www.pagedowntech.com/terms. * '* * '* NOTICE: We do not recommend changing the code below * '* as it may interfere with future updates/upgrades. * '* * '* PageDown Technology, LLC., Copyright 2005. * '* www.pagedowntech.com * '* * '************************************************************ itemid=request("itemid") error=request("error") wlistrec=request.querystring("wlistrec") 'newaddqty=request.form("qty") newaddqty=request("qty") task=request.form("task") edititemid=request("edititemid") chgcartitem=request("chgcartitem") %> <% if error="y" then errormessage=geterrtext("err47") end if if itemid="" or isnull(itemid) or not isnumeric(itemid) then pdredirect("features.asp") end if 'Open database get Item details. set rs=openrs("SELECT * FROM items WHERE active='Yes' AND id=" & itemid) if rs.EOF then pdredirect("features.asp") end if name=rs("name") imgresize=rs("imgresize") if imgresize="ON" then width="width=150" else width="" end if price=rs("price") saleprice=rs("saleprice") onsale=rs("onsale") 'Determine price to show. if onsale="Yes" then theprice=saleprice else theprice=price end if itemno=rs("itemno") hideprice=rs("hideprice") if hideprice="ON" then hideprice=1 else hideprice=0 end if hidehead=rs("hidehead") if hidehead="ON" then hidehead=1 else hidehead=0 end if if newaddqty="" or isnumeric(newaddqty)=False then addqty=rs("addqty") if addqty>1 then else addqty=1 end if else addqty=newaddqty end if largeimage=rs("largeimage") 'If no picture. if largeimage="" or isnull(largeimage) then imagefound="no" else popimgfile=replace(largeimage, "&",":::") end if description=rs("description") 'Determine if item is out of stock. hidecobutt=0 if rs("qty")<=oosthresh then if showoos="ON" then showoosmess="YES" end if if stopoos="ON" then hidecobutt=1 end if end if pgvisitson=rs("pgvisitson") pgvisits=rs("pgvisits") shortdesc=rs("shortdesc") custom1=rs("custom1") custom2=rs("custom2") custom3=rs("custom3") imgwrap=rs("imgwrap") rs.close set rs=nothing if pgvisitson="1" then itemvisits=request.cookies("itemvisits") if instr(itemvisits,":" & itemid & ":")>0 then else Set rsmod = Server.CreateObject("ADODB.Recordset") on error resume next rsmod.Open "Select pgvisits From items WHERE id=" & itemid, DB, 1, 3 rsmod("pgvisits") = fixNum(pgvisits) + 1 rsmod.update rsmod.close on error goto 0 response.cookies("itemvisits")=itemvisits & ":" & itemid & ":" set rsmod=nothing end if end if 'check to see if item has options. 'Get category info on the item. set rs=openrs("SELECT id FROM optioncat WHERE itemid=" & itemid) if not rs.eof then hasoptions="yes" end if rs.close set rs=nothing 'Set Metatags for this item. Primary storefront keywords are used. if shortdesc="" or isnull(shortdesc) then else sitedesc=server.htmlencode(shortdesc) end if if name="" or isnull(name) then else title=server.htmlencode(name) keywords=replace(server.htmlencode(name), " ", ", ") & ", " & keywords if right(keywords,2)=", " then keywords=left(keywords,len(keywords)-2) end if end if 'Get Cart options/text for this item if editing. wlist=request("wlist") if isnumeric(edititemid) and edititemid<>"" then 'Editing Wlist if wlist="Y" then cartid=Request.Cookies("customerid") if cartid="" then pdredirect("wlistreg.asp") end if sqltable="wlistdetail" 'Viewing List elseif wlist="V" then cartid=request.querystring("wlistcustid") sqltable="wlistdetail" else cartid=request.querystring("cartid") sqltable="orderdetail" end if set rs=openrs("SELECT * FROM " & sqltable & " WHERE cartid='" & cartid & "' AND subof=" & edititemid) if cartid<>"" and not rs.eof then editcartopt="Y" cartoptid=Array(optid) cartopttxt=Array(optiontext) rs.movefirst while not rs.eof Addarray cartoptid,rs("optid") Addarray cartopttxt,rs("optiontext") rs.movenext wend end if rs.close set rs=nothing 'If Error was detected while adding or updating item, delete it from cart. if error="y" then Set rsmod = Server.CreateObject("ADODB.Recordset") rsmod.Open "Select * From " & sqltable & " WHERE cartid='" & cartid & "' AND id=" & edititemid, DB, 1, 3 if not rsmod.eof then rsmod.Delete end if rsmod.Close set rsmod=nothing Set rs5 = db.Execute("DELETE FROM " & sqltable & " WHERE cartid='" & cartid & "' AND subof=" & edititemid) set rs5 = nothing end if end if 'Define Post URL if wlist="Y" then nextposturl=shopurl & "shop/wlistcart.asp" else nextposturl=shopcarturl end if 'function for displaying Item Price Discounts. function getitemprice() set rs=openrs("SELECT * FROM itemprices WHERE itemid=" & itemid & " ORDER BY fromqty") if not rs.eof then rs.movefirst while not rs.eof recid=rs("id") if rs("method")=0 then if onsale="Yes" then showitemprice=rs("saleprice") else showitemprice=rs("price") end if else temppct=rs("discpct") tempper=(theprice * (temppct*.01)) showitemprice=theprice-tempper end if tempmessage=rs("message") if tempmessage="" or isnull(tempmessage) then tempmessage=rs("fromqty") & " - " & rs("toqty") else end if %> <%=showCurr(showitemprice) & " (" & tempmessage & ")
"%> <% rs.movenext wend end if rs.close set rs=nothing end function zpage=pg6 %>
<% if leftcolw>0 then%> <%end if%> <% if rightcolw>0 then%> <%end if%>
<% if instr(zpage,"1Q")>0 then %> <% getsecspace ()%> <% getHeading "hdcat", hdcat, "", 1 %> cellpadding="5" cellspacing="0" width="100%"> <% 'Display all categories for this item. set rs2=openrs2("SELECT catlinks.id as linkid, catlinks.itemid, category.name, category.shortdesc, category.id as catid FROM catlinks INNER JOIN category on category.id=catlinks.catid WHERE itemid=" & itemid & " ORDER BY " & ord1) if not rs2.eof then rs2.movefirst while not rs2.eof catlinkid=rs2("linkid") catname=rs2("name") catdesc=rs2("shortdesc") catid=rs2("catid") %> <% rs2.movenext wend end if rs2.close set rs2=nothing %>
<%=showlevels(catid, shopurl & "shop/category.asp")%>
<% 'To display sub category, uncomment the line below. 'showsubcatsitem="Y" if showsubcatsitem="Y" then 'Open database get sub categories. set rs=openrs("SELECT * FROM category WHERE subof=" & catid & " ORDER BY " & ord1) if not rs.eof then %> <%=titheada%><% rs.movefirst while not rs.eof subcatname=rs("name") subcatid=rs("id") %> category.asp?catid=<%=subcatid%>"> <%=subcatname%> <% rs.movenext if not rs.eof then response.write (" | ") end if wend end if rs.close set rs=nothing end if %>
<%=catdesc%>
<%=titmessa%> category.asp?catid=<%=catid%>"><%=titlinka%>
<% end if%> <% if instr(zpage,"1P")>0 then %> <% getsecspace ()%>
<%end if%>
<% getcoldata zpage,"1" %>
<% getsecspace ()%> <% getHeading "hditem", hditem, "", 2 %> cellpadding="5" cellspacing="0" width="100%"> <% if imgwrap="OFF" and imagefound<>"no" then%> <% end if %> <% if hideprice<>1 and hidecobutt<>1 then %> <% if chgcartitem="Y" then %> "> <% end if %> <% if editcartopt="Y" then %> <% end if %> <% if hasoptions="yes" then %> <% else catcount=0 %> <% end if%> <% if showoosmess="YES" then %> <% end if %> <% if wlist="V" then chgcartitem="" editcartopt="" end if %> <% if hidecobutt=0 then %> <%else%> <% end if %> <% end if %> <% if showoosmess="YES" and hidecobutt=1 then %> <% end if %>
<%=fixERR(errormessage)%>
vspace="8" hspace="8" alt="<%=name%>">
<% if hidehead<>1 then %> <% if imagefound<>"no" and (imgwrap<>"OFF" or isnull(imgwrap)) then %> align="right" vspace="8" hspace="8" alt="<%=name%>"> <%end if%><%=getsystext("sys13")%>
<%=name%>
<%=getsystext("sys14")%>
<%=itemno%>
<% if instr(cfconfig,"A")>0 and custom1<>"" and isnull(custom1)=false then %> <%=getsystext("sys112")%>
<%=custom1%>
<% end if%> <% if instr(cfconfig,"B")>0 and custom2<>"" and isnull(custom2)=false then %> <%=getsystext("sys113")%>
<%=custom2%>
<% end if%> <% if instr(cfconfig,"C")>0 and custom3<>"" and isnull(custom3)=false then %> <%=getsystext("sys114")%>
<%=custom3%>
<% end if%> <% if hideprice<>1 and hasoptions<>"yes" then %><%=getsystext("sys16")%>
<% if onsale="Yes" then %> <% =showCurr(price)%>
<% end if response.write(showCurr(theprice)) %>
<% if disc2en=1 then %><% getitemprice()%><%end if%> <% end if %>

<% end if %> <%=description%>
<%=geterrtext("err60")%>
<% if chgcartitem="" and editcartopt="" then %> <% else %> <% end if %>
<% if email5en="ON" then %><% 'showbutton "butts20",butts20,shopurl & "shop/emailafriend.asp?itemid=" & itemid,"" %><% end if %> <% if wishen=1 then %><% 'showbutton "butts27",butts27,"javascript:addtowishlist()","" %><%end if%> <% if hasoptions="yes" then %><% showbutton "butts9", butts9,"javascript:updateprice()","" %><%end if%> <% showbutton "butts30",butts30,"","form" %>  <%=getsystext("sys15")%>  <% showbutton "butts28",butts28,"","form" %>  <%=getsystext("sys15")%> 
<% if chgcartitem="" and editcartopt="" then %>
<% if email5en="ON" then %><% showbutton "butts20",butts20,shopurl & "shop/emailafriend.asp?itemid=" & itemid,"" %><% end if %> <% if wishen=1 then %><% showbutton "butts27",butts27,"javascript:addtowishlist()","" %><%end if%>
<% end if %>
<% if email5en="ON" then %> <% showbutton "butts20",butts20,shopurl & "shop/emailafriend.asp?itemid=" & itemid,"" %><% end if %>
">
<%=geterrtext("err60")%>
<% getsecspace ()%>
<% getcoldata zpage,"3" %>