<% If Request("PageNo") <> "" Then If Request("PageNo") = 0 Then Response.Redirect "error.asp?Error=You entered page number 0" &_ "

Please go back and enter a valid page number." End IF End If Const adOpenKeyset = 1 Const adLockOptimistic = 3 Dim strCatVals strCatVals = Request("CatVals") Dim strCat1Id Dim strCat1Name Dim strCat2Id Dim strCat2Name Dim strCat3Id Dim strCat3Name Dim strCat4Id Dim strCat4Name Dim strArrayVal strArrayVal = split(strCatVals, ",", -1) strCat1Id = strArrayVal(0) strCat1Name = strArrayVal(1) strCat2Id = strArrayVal(2) strCat2Name = strArrayVal(3) strCat3Id = strArrayVal(4) strCat3Name = strArrayVal(5) strCat4Id = strArrayVal(6) strCat4Name = strArrayVal(7) DIM mySQLProducts, objRSProducts Set objRSProducts = Server.CreateObject("ADODB.Recordset") mySQLProducts = "SELECT * FROM Products Where Cat4Id = '"& strCat4Id &"' Order By ItemNumber" objRSProducts.Open mySQLProducts, objConn, 1, 3 Dim strOpt1Id Dim strOpt2Id Dim strOpt3Id Dim oRs2 Dim Sql2 Dim oRs3 Dim Sql3 Dim oRs4 Dim Sql4 Call AddToCart() ' RS for dropdown sub cat DIM mySQLCat, objRSCat Set objRSCat = Server.CreateObject("ADODB.Recordset") mySQLCat = "SELECT * FROM Cat4 Where Cat3Id = '"& strCat3Id &"'" objRSCat.Open mySQLCat, objConn If objRSProducts.EOF Then Else Dim strPageSize If Request("PageSize") = "" Then strPageSize = Session("PageSize") If (strPageSize = "") Then strPageSize = 5 End If Else strPageSize = Request("PageSize") Session("PageSize") = Request("PageSize") End If objRSProducts.PageSize = strPageSize Dim PageNo Dim c Dim j Dim strPageCount strPageCount = objRSProducts.PageCount If Request("PageNo") = "" Then PageNo = 1 Else PageNo = Request("PageNo") End If objRSProducts.AbsolutePage = PageNo End If 'Make sure page number entered by user is not larger than the last page. If Request("PageNo") <> "" Then Dim strCheckTotal strCheckTotal = Abs(objRSProducts.PageCount) Dim strPageNum strPageNum = Abs(Request("PageNo")) If (strPageNum > strCheckTotal) Then Response.Redirect "error.asp?Error=You entered page number " & PageNo &_ ".

There are only " & strPageCount & " pages of entries." &_ "

Please go back and enter a page number between 1 and " & strPageCount & "." Else End If Else End If ' End Check page number. DIM mySQL2, objRS2 Set objRS2= Server.CreateObject("ADODB.Recordset") mySQL2 = "SELECT Count(ItemNumber) AS Total FROM Products Where Cat4Id = '"& strCat4Id &"'" objRS2.Open mySQL2, objConn, 1, 3 %> <%= strCat4Name %> text="#<%= strText %>" link="#<%= strLink %>" vlink="#<%= strVLink %>" alink="#<%= strALink %>">
 <%= objRS2("Total") %> Items found. Displaying <%= strPageSize %> per page.

Subcategories: <%= "" & strCat1Name & "" & " > " & "" & strCat2Name & "" & " > " & "" & strCat3Name & "" & " > " & strCat4Name %> >


<% If objRSProducts.EOF Then Response.Write"There are no Items in this Category" Response.End Else Dim strPrice, strSalePrice For j = 1 to objRSProducts.PageSize strPrice = FormatNumber(objRSProducts("Price"),2) strSalePrice = FormatNumber(objRSProducts("SalePrice"),2) %>
">"> "><%=objRSProducts("Description")%>

Item: <%=objRSProducts("ItemNumber")%>

Quantity: Price: <%= strCurrencySymbol %><%= strPrice %> <%= strCurrencyCode %>
<% If (objRSProducts("OnSale") = "Yes") Then %>

On Sale! Sale Price: <%= strCurrencySymbol %><%= strSalePrice %> <%= strCurrencyCode %>

<% Else End If %>
<% If (objRSProducts("ShowNotes") = "Yes") Then %>

<%= objRSProducts("NotesDescript") %>

<% Else End If %>

<% Call Opt1Name() %>  

<% Call Opt1Box() %>

 

<% Call Opt2Name() %>  

<% Call Opt2Box() %>

View Cart

<% Call Opt3Name() %>  

<% Call Opt3Box() %>

"> "> "> "> "> "> "> "> "> ">


<% objRSProducts.MoveNext ' Don't try to print the EOF record. If objRSProducts.EOF Then Exit For End If Next %> <% If Abs(strPageCount) > 1 Then %>

There are <%= objRS2("Total") %> Items in <%= strCat4Name %>. To view more Items, enter a page number below or click next.

Page <%= PageNo %> of <%= objRSProducts.PageCount %> Pages

<% If PageNo > 1 Then Dim strBack strBack = Abs(PageNo) - 1 %> <<Back <% End If %> <% If Abs(PageNo) <> Abs(strPageCount) Then Dim strNext strNext = Abs(PageNo) + 1 %>   Next>> <% ElseIf Abs(PageNo) = Abs(strPageCount) And Abs(PageNo) <> 1 Then %>   Start Over <% End If %>

<% End If %>
<% End If %>