% 'This file is part of e-Merchant Pro 1.0, an ecommerce application developed and sold by GWS(Global Web Solutions) LLC. e-Merchant Pro 1.0, its source code, the e-Merchant Pro 1.0 name and logo are property of GWS(Global Web Solutions), LLC. Copyright 2001-2003. All rights reserved. You are not allowed to use, alter, distribute and/or resell any parts of e-Merchant Pro 1.0's source code without the written consent of GWS(Global Web Solutions). To contact GWS(Global Web Solutions), please visit www.globalwsolutions.com. %> <% response.Buffer=true %> <%Dim iAddDefaultPrice, iAddDefaultWPrice%> <% on error resume next Dim query, conntemp, rsProducts, rsDisc, pDiscountPerQuantity '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' START: Check store on/off, start PC session, check affiliate ID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %> <% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' END: Check store on/off, start PC session, check affiliate ID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '******************************* ' LOAD SETTINGS (same as home page) '******************************* call opendb() query="SELECT pcHPS_Style,pcHPS_ShowSKU,pcHPS_ShowImg FROM pcHomePageSettings;" set rs=server.CreateObject("ADODB.RecordSet") set rs=connTemp.execute(query) if not rs.eof then pcStrHPStyle=rs("pcHPS_Style") pcIntHPShowSKU=rs("pcHPS_ShowSKU") pcIntHPShowImg=rs("pcHPS_ShowImg") end if set rs=nothing call closedb() pShowSKU = pcIntHPShowSKU if pShowSKU = "" or isNull(pShowSKU) then pShowSKU = -1 ' If 0, then the SKU is hidden end if pShowSmallImg = pcIntHPShowImg if pShowSmallImg = "" or isNull(pShowSmallImg) then pShowSmallImg = -1 ' If 0, then the Image is hidden end if ' This variable controls whether NOT FOR SALE items should be shown Dim pcIntFeaturedNFS, queryNFS pcIntFeaturedNFS = 0 ' Not for sale items are shown pcIntFeaturedNFS = -1 ' Not for sale items are not shown if pcIntFeaturedNFS <> 0 then queryNFS = " AND formQuantity = 0 " else queryNFS = " " end if '******************************* ' END LOAD HOMEPAGE SETTINGS '******************************* '******************************* ' GET page style '******************************* ' Load the page style: check to see if a querystring ' or a form is sending the page style. Dim pcPageStyle pcPageStyle = LCase(Request.QueryString("pageStyle")) if pcPageStyle = "" then pcPageStyle = LCase(Request.Form("pageStyle")) end if if pcPageStyle = "" then pcPageStyle = pcStrHPStyle end if if pcPageStyle <> "h" and pcPageStyle <> "l" and pcPageStyle <> "m" and pcPageStyle <> "p" then pcPageStyle = LCase(bType) end if '******************************* ' GET page size '******************************* Dim iPageSize iPageSize=(scPrdRow*scPrdRowsPerPage) if request.queryString("iPageCurrent")="" then if request.queryString("page")="" then iPageCurrent=1 else iPageCurrent=server.HTMLEncode(request.queryString("page")) end if else iPageCurrent=server.HTMLEncode(request.queryString("iPageCurrent")) end if '******************************* ' GET sorting criteria '******************************* Dim ProdSort, querySort ProdSort="" & request("prodsort") if ProdSort="" then ProdSort="0" end if select case ProdSort Case "0": querySort = " ORDER BY pcprod_OrdInHome asc" Case "1": querySort = " ORDER BY products.description Asc" Case "2": If Session("customerType")=1 then querySort = " ORDER BY products.btoBprice desc, products.price Desc" else querySort = " ORDER BY products.price Desc" End if Case "3": If Session("customerType")=1 then querySort = " ORDER BY products.bToBprice Asc, products.price Asc" else querySort = " ORDER BY products.price Asc" end if end select '******************************* ' GET featured items from DB '******************************* call openDb() if session("CustomerType")<>"1" then query1= " AND categories.pccats_RetailHide=0" else query1="" end if query="SELECT distinct products.idProduct,products.sku,products.description,products.price,products.listPrice,products.listHidden,products.serviceSpec,products.listPrice,products.bToBPrice,products.smallImageUrl, products.pcprod_HideBTOPrice,products.noprices,products.stock,products.noStock,products.formQuantity,products.pcProd_BackOrder,products.pcprod_OrdInHome FROM products,categories_products,categories WHERE products.active=-1 AND products.showInHome=-1 AND products.configOnly=0 AND products.removed=0 " & queryNFS & " AND categories_products.idProduct=products.idProduct AND categories.idCategory=categories_products.idCategory AND categories.iBTOhide=0 " & query1 & querySort set rsProducts=Server.CreateObject("ADODB.Recordset") rsProducts.CursorLocation=adUseClient rsProducts.CacheSize=iPageSize rsProducts.Open query, conntemp ' Create additional recordset for M display if pcPageStyle = "m" then set rsCount=server.CreateObject("ADODB.Recordset") set rsCount=conntemp.execute(query) end if if err.number<>0 then call LogErrorToDatabase() set rsProducts=nothing call closedb() response.redirect "techErr.asp?err="&pcStrCustRefID end if '******************************* ' Check for EMPTY recordset '******************************* if rsProducts.eof then call closeDb() response.redirect "msg.asp?message=89" end if '******************************* ' Set variables for "M" display '******************************* if pcPageStyle = "m" then 'Check if customers are allowed to order products dim iShow iShow=0 If scOrderlevel=0 then ' Anybody can order iShow=1 end if If scOrderlevel=1 AND session("customerType")="1" then ' Only wholesale customers can order iShow=1 End if Dim pCnt,pBTOCnt,pOptCnt,pAddtoCart 'reset count variables pCnt=Cint(0) pBTOCnt=Cint(0) pOptCnt=Cint(0) 'Run through the products to count all products, products with options, and BTO products do while not rsCount.eof and count < rsProducts.PageSize pCnt=pCnt+1 pidrelation=rsCount("idProduct") pserviceSpec=rsCount("serviceSpec") '// CHECK FOR OPTIONS pcv_intOptionsExist=pcf_CheckForOptions(pidrelation) '// check options function (1=YES, 2=NO) 'response.write pidrelation if pserviceSpec=true or (pcv_intOptionsExist = 1) then If pcv_intOptionsExist = 1 Then pOptCnt=pOptCnt+1 Else pBTOCnt=pBTOCnt+1 End If End If rsCount.moveNext loop set rsCount = nothing ' If all items on the page are either BTO or have options, ' do not show the quantity column or the Add to Cart button. if cint(pOptCnt) + cint(pBTOCnt) <> cint(pCnt) then pAddtoCart = 1 end if end if '******************************* ' Build the page '******************************* %>
<%response.write dictLanguage.Item(Session("language")&"_mainIndex_7")%><%if HideSortPro<>"1" then%> |
| <% if pcPageStyle = "m" then %> <% end if %> <% set rsProducts=Nothing set iPageCurrent=Nothing call closeDb() %> |