<%@ 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 %>

<% objRecordSet.Move ((pagestart - 1) * DISPLAYNUM) i = 0 do while (not objRecordSet.eof and i < DISPLAYNUM) %> <% i = i +1 objRecordSet.MoveNext Loop objRecordSet.Close set objRecordSet = Nothing %>

<%if not IsNull(objRecordset("Brand")) then Response.Write ""%>

<%if not IsNull(objRecordset("picture")) then Response.Write ""%>

<% if objRecordset("Symbol1") <> "blank" and Not IsNull(objRecordset("Symbol1")) and objRecordset("Symbol1")<>"" then Response.Write "" else Response.Write "" end if if objRecordset("Symbol2") <> "blank" and Not IsNull(objRecordset("Symbol2")) and objRecordset("Symbol2")<>"" then Response.Write "" else Response.Write "" end if%> <%if IsWholesaler then%> "> "> "> <%end if%>

View Color chart

View Size Chart

Size: <% DropDown "Size", objRecordset("Item"), 1 %>
Color: <% DropDown "Color", objRecordset("Item"), 2 %>
Qty:  <%= objRecordset("packed") %> per pack
<%= Price(objRecordSet("Item"), true) %>

<%= objRecordSet("Details") %>
<%Response.Write "Style " & objRecordSet("Item") & " - " & objRecordSet("ItemName") %>



<% 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 %>


<% objConn.Close set objConn = Nothing End Sub '============== END MAIN SUB =========================================================================== '------------------------------------------------------------------------------ Function Price(intPrdID, format) Price = Null dim strSQL, rsDetail, i dim aryConcat() strSQL = "SELECT DISTINCT(Details.DozPrice) FROM Details INNER JOIN Products ON Details.ID = Products.Item " &_ "WHERE Products.Item='" & intPrdID & "' AND Details.DozPrice IS NOT NULL;" Set rsDetail = objConn.Execute(strSQL,,adCmdText) if not rsDetail.EOF then If format Then Price = FormatCurrency(rsDetail("DozPrice"), 2) Else Price = rsDetail("DozPrice") End If End If rsDetail.Close set rsDetail = Nothing End Function '------------------------------------------------------------------------------ Sub DropDown(strDetailType, intPrdID, j) dim strSQL, rsDetail, i dim aryConcat() if strDetailType = "Size" then strSQL = "SELECT [" & strDetailType & "] FROM SizeOrder WHERE ID='" & intPrdID & "' ORDER BY [Display];" else strSQL = "SELECT DISTINCT(Details.[" & strDetailType & "]) FROM Details INNER JOIN Products ON Details.ID = Products.Item " &_ "WHERE Products.Item='" & intPrdID & "' AND Details.[" & strDetailType & "] IS NOT NULL;" end if 'Response.Write strSQL 'Response.end Set rsDetail = objConn.Execute(strSQL) if not rsDetail.EOF then %> "> <% end if rsDetail.Close set rsDetail = Nothing End Sub '------------------------------------------------------------------------------ Sub DisplayProducts(CategoryID) Dim strSQL if Not IsNull(CategoryID) then strSQL = "SELECT * FROM Products WHERE Products.CategoryID=" & CategoryID & " ORDER BY Item;" else strSQL = "SELECT * FROM Products ORDER BY Item;" end if Set objRecordSet = Server.CreateObject("ADODB.Recordset") objRecordSet.CursorLocation = adUseClient objRecordSet.Open strSQL, objConn, adOpenDynamic, adLockPessimistic, adCmdText 'global recordset Reccount = objRecordSet.RecordCount End Sub '-------------------------------------------------------------------------------- Sub DisplayAllProducts( CategoryID ) Dim strSQL, rsTmp, strCategoryIDTree strSQL = "SELECT [Category].[CategoryIDTree] FROM Category WHERE (([Category].[CategoryID])=" & CategoryID & ");" Set rsTmp = objConn.Execute(strSQL,,adCmdText) if not rsTmp.EOF then strCategoryIDTree = rsTmp("CategoryIDTree") end if rsTmp.Close set rsTmp = nothing strSQL ="SELECT Products.* FROM Category INNER JOIN Products ON Category.CategoryID = Products.CategoryID " &_ "WHERE INSTR(CategoryIDTree,'" & strCategoryIDTree & "')<>False ORDER BY Item;" Set objRecordSet = Server.CreateObject("ADODB.Recordset") objRecordSet.CursorLocation = adUseClient objRecordSet.Open strSQL, objConn, adOpenDynamic, adLockPessimistic, adCmdText 'global recordset Reccount = objRecordSet.RecordCount End Sub '-------------------------------------------------------------------------------- %>