<% '************************************************************************* '************************************************************************* lCatID = FVal(RequestValue("CATID")) OpenDBConn If lCatID > 0 Then sRootNav = "" sBaseName = "" lParentID = lCatID sSQL = "Select catParentID, catDescription FROM tblIBCategories WHERE catID = " & SQLVal(lCatID) Set rsCat = gobjConn.Execute(sSQL) lParentID = FVal(rsCat.Fields("catParentID")) sBaseName = "" & rsCat.Fields("catDescription") & " " rsCat.Close sSQL = "Select catParentID, catDescription FROM tblIBCategories WHERE catID = " & SQLVal(lParentID) Do While lParentID > 0 Set rsCat = gobjConn.Execute(sSQL) If Not rsCat.Eof Then If Len(Trim("" & rsCat.Fields("catDescription"))) > 0 Then sRootNav = " > " & rsCat.Fields("catDescription") & "" & sRootNav End If lParentID = FVal(rsCat.Fields("catParentID")) sSQL = "Select catParentID, catDescription FROM tblIBCategories WHERE catID = " & SQLVal(lParentID) Else lParentID = 0 End If rsCat.Close Loop sRootNav = "
Top" & sRootNav Else 'sRootNav = "
Top
" sRootNav = "" sBaseName = "" End If DoPageHeader If lCatID > 0 Then sSQL = "Select * FROM tblIBCategories WHERE catParentID =" & SQLVal(lCatID) & " ORDER BY catDescription" Else sSQL = "Select * FROM tblIBCategories WHERE catParentID Is Null ORDER BY catDescription" End If Set rsCat = gobjConn.Execute(sSQL) Response.Write("") Response.Write("

" & sBaseName & gsInfoBaseName & " Category

") Response.Write("
") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") lCatCount = 0 If rsCat.eof Then If lCatID > 0 Then Response.Write "" Else Response.Write "" End If Else Do While Not rsCat.eof If EvalBool(rsCat.Fields("catRootable")) And giShowCatCounts Then Response.Write("") rsCat.MoveNext lCatCount = lCatCount + 1 If rsCat.eof Then Response.Write("") Else If EvalBool(rsCat.Fields("catRootable")) And giShowCatCounts Then Response.Write("") rsCat.MoveNext lCatCount = lCatCount + 1 End If Loop End If rsCat.Close Set rsCat = Nothing sSQL = "SELECT basID, basTitle, basLastUpdated FROM tblIBInfoBase " & _ "WHERE basCatID = " & SQLVal(lCatID) & " AND basAvailable = 'Y' ORDER BY basLastUpdated DESC" Set rsIB = gobjConn.Execute(sSQL) If Not rsIB.Eof Then Response.Write("") iLineFlag = True lItemCount = 0 Do While Not rsIB.Eof sLineTag = AlternateTag(iLineFlag, gsLineColorEven, gsLineColorOdd) Response.Write "" rsIB.MoveNext lItemCount = lItemCount + 1 Loop End If rsIB.Close Set rsIB = Nothing If (lCatCount = 0) And (lItemCount = 0) Then Response.Write "" End If Response.Write("") Response.Write("") Response.Write("") Response.Write("
" & sRootNav & "
") Response.Write("Search:") Response.Write("") Response.Write("
") Response.Write("" & sBaseName & gsInfoBaseName & "") '*** Response.Write("
 
No Categories
" & gsMainCatTagOpen & "
" & Trim("" & rsCat.Fields("catDescription") ) & " (" & rsCat.Fields("catCount") & ")" ) If FVal(rsCat.Fields("catSubCount")) > 0 Then Response.Write("+") End If Response.Write( gsMainCatTagClose & "
") Else Response.Write("
" & gsMainCatTagOpen & "") End If sSubCats = Trim("" & rsCat.Fields("catSubCats1") & rsCat.Fields("catSubCats2")) If Len(sSubCats) > 0 Then Response.Write( gsSubCatTagOpen & "" & gsSubCatTagClose ) End If Response.Write(" 
" & gsMainCatTagOpen & "
" & Trim("" & rsCat.Fields("catDescription") ) & " (" & rsCat.Fields("catCount") & ")" ) If FVal(rsCat.Fields("catSubCount")) > 0 Then Response.Write("+") End If Response.Write( gsMainCatTagClose & "
") Else Response.Write("
" & gsMainCatTagOpen & "") End If sSubCats = Trim("" & rsCat.Fields("catSubCats1") & rsCat.Fields("catSubCats2")) If Len(sSubCats) > 0 Then Response.Write( gsSubCatTagOpen & "" & gsSubCatTagClose ) End If 'GetSCategories Response.Write("
" & gsTableLineOpen & "" & gsTableLineClose & "" & gsTableLineOpen & "
" & gsTableLineOpen & "" & gsTableLineClose & "
") ShowNavigationBar Response.Write("
") DoPageFooter CloseDBConn Sub GetSCategories sSQL = "Select ID, CategoryID, SubCategoryName FROM subcategories WHERE CategoryID = " & rsCat.Fields("ID") Set rsSub = gobjConn.Execute(sSQL) If Not rsSub.eof Then count=1 Do While count < 4 AND Not rsSub.eof Response.Write("" & rsSub.Fields("SubCategoryName") & "") rsSub.MoveNext If count < 3 AND NOT rsSub.eof Then Response.Write(",  ") Else Response.Write(" ... ") End If count = count + 1 Loop End if End Sub Function ShowCategoryCounts(pvCatID,pbRootable) Dim rsSCC Dim sSQL If pbRootable And giShowCatCounts Then sSQL = "SELECT COUNT(*) As TotalCount FROM tblIBInfoBase WHERE basAvailable = 'Y' AND basCatID =" & FVal(pvCatID) Set rsSCC = gobjConn.Execute(sSQL) If Not rsSCC.Eof Then ShowCategoryCounts = " (" & FVal(rsSCC.Fields("TotalCount")) & ")" Else ShowCategoryCounts = " (0)" End If rsSCC.Close Set rsSCC = Nothing Else ShowCategoryCounts = "" End If End Function %>