%@ LANGUAGE = "VBScript" %>
<%
'-----------------------------------------------------------
' ASPilot.com - Category Listing
' ------------------------------
' Copyright © 2004 Spliethof Inc
'
' This file lists all the customer category interface with bread crumbs
'-----------------------------------------------------------
' FindGroupName
'------------------
' This will find the name of the group or return a blank
'-----------------------------------------------------------
Function FindGroupName(intGroupID)
Dim strSQL, rsPN
FindGroupName = ""
If intGroupID&"x" <> "x" Then
strSQL = "SELECT tg.Name AS Name FROM TBLGROUPS tg WHERE tg.GroupID="&Cint(intGroupID)&" AND SHOWIT <> 0"
Set rsPN = OpenFastRS(strSQL)
If NOT rsPN.EOF Then FindGroupName = ""&rsPN("Name")&""
rsPN.Close : Set rsPN = Nothing
End If
End Function
PilotInitialize
GetCurrentCustomer
MarkCurrentCustomerActive
If Not PilotPageBegin("category", Empty) Then Response.Redirect g.HomePageURL & "pilot.asp"
B2BCheckLogin "category"
Dim strSQL, rsG, theDescrip, ttl2, count, showIMG, i, strParentName, strBreadCrumb
DIm strParentGroupIDS
grp = Trim(Request.QueryString("grp"))
ParentGroup = NULL
strParentName = ""
If grp&"X" <> "X" and IsNumeric(grp) Then ParentGroup = Clng(grp)
strSQL = "SELECT tgrp.GroupID, tgrp.Name, tgrp.Descrip, tgrp.Img, tpar.GroupID AS ParentID, tpar.Name AS ParentName FROM (tblGroups tgrp LEFT JOIN tblGroupsParents tgp ON tgrp.GroupID = tgp.GroupID) LEFT JOIN tblGroups tpar ON tgp.ParentID = tpar.GroupID WHERE tpar.GroupID "&CSQLEq(ELng(ParentGroup))&" AND tgrp.ShowIt <> 0 ORDER BY tgrp.Name"
Set rsG = OpenFastRS(strSQL)
If NOT rsG.EOF Then arrG = rsG.GetRows
rsG.Close : Set rsG = Nothing
pgrp = Request.QueryString("pgrp")
strParentGroupIDS = pgrp & grp & ","
If Not IsEmpty(arrG) Then
x=0
strBreadCrumb = ""
arrGID = Split(Left(strParentGroupIDS, Len(strParentGroupIDS)-1), ",")
Do Until x > UBound(arrGID)
strParentName = FindGroupName(arrGID(x))
strBreadCrumb = strBreadCrumb & strParentName & " > "
x=x+1
Loop
Response.Write img1 & pc & "
" count = 0 i = 0 If strBreadCrumb <> "" Then Response.Write "" &strBreadCrumb& "" Else Response.Redirect g.HomePageURL&"group.asp?grp="&ParentGroup End If TemplateAfterPC PilotPageEnd %>
" Do Until i > UBound(arrG, 2) If strParentGroupIDS <> "," Then strPGList = "&pgrp="&strParentGroupIDS thedescrip = arrG(2,i) If Trim("X"&thedescrip) <> "X" Then ttl2 = " title="""&thedescrip&"""" If IsNull(arrG(3,i)) Or Trim("X"&arrG(3,i)) = "X" Then showIMG = "" Else showIMG = "" If parentCount <> 0 Or count > 0 Then Response.Write"
" Response.Write ""&showIMG&""&arrG(1,i)&"" count = count + 1 i=i+1 CheckConnection Loop Response.Write"