%
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
%>
<%= objRS2("Total") %> Items found. Displaying <%= strPageSize %> per page.
<% 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) %> |