<% ' Comersus 4.2x Sophisticated Cart ' Developed by Rodrigo S. Alhadeff ' Dic-2002 ' Open Source License can be found at License.txt ' http://www.comersus.com ' Details: list all suppliers items %> <% on error resume next dim mySQL, connTemp, rsTemp, pIdSupplier, pIdProduct, pDescription, pPrice, curPage, totalPages, count ' get settings pDefaultLanguage = getSettingKey("pDefaultLanguage") pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode") pCurrencySign = getSettingKey("pCurrencySign") pDecimalSign = getSettingKey("pDecimalSign") pCompany = getSettingKey("pCompany") pCompanyLogo = getSettingKey("pCompanyLogo") pAuctions = getSettingKey("pAuctions") pListBestSellers = getSettingKey("pListBestSellers") pNewsLetter = getSettingKey("pNewsLetter") pPriceList = getSettingKey("pPriceList") pStoreNews = getSettingKey("pStoreNews") pOneStepCheckout = getSettingKey("pOneStepCheckout") ' defines 10 records per page const numPerPage = 10 if request.queryString("curPage") = "" then curPage = 1 else curPage = request.queryString("curPage") end if pIdSupplier = request.QueryString("idSupplier") if trim(pIdSupplier)="" then response.redirect "message.asp?message="&Server.Urlencode(dictLanguage.Item(Session("language")&"_listproductsbysupplier_1") ) end if ' get items for that supplier mySQL="SELECT idproduct, products.idsupplier, supplierName, smallImageUrl, description, price, details, listPrice, stock FROM products, suppliers WHERE products.idsupplier=suppliers.idsupplier and suppliers.idSupplier=" &pIdSupplier &" AND listhidden=0 AND active=-1 ORDER BY description" call getFromDatabasePerPage(mySql, rstemp,"listProductsBySupplier") if rstemp.eof then response.redirect "message.asp?message="&Server.Urlencode(dictLanguage.Item(Session("language")&"_listproductsbysupplier_2") ) end if rstemp.moveFirst rstemp.pageSize = numPerPage totalPages = rstemp.PageCount rstemp.absolutePage = curPage pSupplierName = rstemp("supplierName") %>

<%=dictLanguage.Item(Session("language")&"_listproductsbysupplier_3")%> <%=pSupplierName%>

<% ' set count equal to zero count = 0 do while not rstemp.eof and count < rstemp.pageSize pIdProduct = rstemp("idproduct") pDescription = rstemp("description") pPrice = rstemp("price") pDetails = rstemp("details") pListPrice = rstemp("listPrice") pSmallImageUrl = rstemp("smallImageUrl") pStock = rstemp("stock") switchProductsLanguage session("language"), pIdProduct, pDetails, pDescription %><% count = count + 1 rstemp.moveNext loop %>
<%response.write(dictLanguage.Item(Session("language")&"_listproductsbysupplier_4") & curPage & dictLanguage.Item(Session("language")&"_listproductsbysupplier_5") & TotalPages & "

")%> <% ' prints > and < buttons if curPage > 1 then response.write("") end if if CInt(curPage) <> CInt(TotalPages) then response.write("") end if %>

<% set pIdSupplier = nothing set pIdProduct = nothing set pDescription = nothing set pDetails = nothing set pListPrice = nothing set curPage = nothing call closeDb() %>