%@ Language=VBScript %>
<% 'ON ERROR RESUME NEXT %>
<%
' --- GLOBAL ------------------------------------------------------------
dim IsWholesaler
IsWholesaler = CBool(Session("IsWholesaler"))
' Use this for the entire page because of access
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = DBCONN
objConn.Open
const ITEMS_PER_ROW = 1
const DISPLAYNUM = 6
Dim pagestart, numpages, StartingItem, EndingItem, i, blnShowAll
Dim CategoryName
Dim objRecordSet
Dim Reccount 'Global
Reccount = 0
Dim CategoryID, rsCategoryPath
CategoryID = CINT(Request("CID"))
If CategoryID = "" OR Not IsNumeric(CategoryID) Or CategoryID = "0" Then
Response.Redirect("Category.asp")
End If
blnShowAll = CStr(Request.QueryString("sa").Item)
if (blnShowAll = "") Or (blnShowAll = "0") Or (blnShowAll = "False") then
blnShowAll = False
else
blnShowAll = True
end if
if blnShowAll then
'show all in this category and children categories
DisplayAllProducts CategoryID
'GetAllItemCount CategoryID
else
DisplayProducts CategoryID
'GetItemCount CategoryID
end if
' --- GLOBAL ------------------------------------------------------------
If Reccount <= 0 Then
Response.Write "No Products found."
Response.Write " Go back and try another category."
%>
<%
Response.End
Else
DisplaySiblingCategoryPath CategoryID
DisplayParentCategory CategoryID
Call makePage
End If
%>
<%
'============== BEGIN MAIN SUB ===========================================================================
Sub makePage
pagestart = CINT(Request("pagenum"))
if (IsNumeric(pagestart)) then
if pagestart < 1 then pagestart = 1
else
pagestart = 1
end if
numpages = CInt(Reccount/DISPLAYNUM)
if numpages < (Reccount/DISPLAYNUM) then numpages = numpages + 1
StartingItem = ((pagestart - 1) * DISPLAYNUM) + 1
if pagestart < numpages then
EndingItem = (StartingItem + (DISPLAYNUM - 1))
else
EndingItem = Reccount
end if
%>
<% If pagestart > 1 Then %> ?pagenum=<%=(pagestart - 1)%>&CID=<%=CategoryID%>&sa=<%=blnShowAll%>"> class="small" style="text-transform:uppercase;font-size:9pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> < BACK <% Else Response.Write " " End If %> | class="small" style="text-transform:uppercase;font-size:7pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> Please scroll down to view our products. | <% If pagestart < numpages Then %> ?pagenum=<%=(pagestart + 1)%>&CID=<%=CategoryID%>&sa=<%=blnShowAll%>"> class="small" style="text-transform:uppercase;font-size:7pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> NEXT > <% Else Response.Write " " End If %> |
|
<% If pagestart > 1 Then %> ?pagenum=<%=(pagestart - 1)%>&CID=<%=CategoryID%>&sa=<%=blnShowAll%>"> class="small" style="text-transform:uppercase;font-size:9pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> < BACK <% Else Response.Write " " End If %> | class="small" style="text-transform:uppercase;font-size:9pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> Items <%= StartingItem %> - <%= EndingItem %> of <%= Reccount %> total | <% If pagestart < numpages Then %> ?pagenum=<%=(pagestart + 1)%>&CID=<%=CategoryID%>&sa=<%=blnShowAll%>"> class="small" style="text-transform:uppercase;font-size:9pt;color:#ffffff" <%else%> class="verd11" style="text-transform:uppercase;color:#ffffff" <%end if%>> NEXT > <% Else Response.Write " " End If %> |