%option explicit%> <% '**************************************************************** ' Display shop categories ' displays a list of categories from Shopping Database ' Support images for each category and multiple columns per listing ' Now allows product displays or subcategory displays '**************************************************************** ' dim colcount Dim strcatImage Dim Mylink ShopPageHeader ' Page header for shop CategoryHeader ' category header on this page Showcategories ' format categories on this page ShopPageTrailer ' shop page trailer ' ' Show Categories Sub ShowCategories() Dim rs dim lngcatid dim strcategory Dim dbc colcount=0 ShopOpenDatabase dbc SQL="Select * from categories order by " & xsortcategories OpenRecordSet dbc, rs, sql While Not rs.EOF lngcatid=rs("categoryid") strcategory=rs("catdescription") strsubcategory=rs("hassubcategory") strcatimage=rs("catimage") ' image if isNull(strcatimage) then strcatimage="" end if if isNULL(strsubcategory) then strsubcategory="" end if FormatCategory lngcatid, strcategory rs.MoveNext Wend if colcount> 0 then FillRemainingcolumns end if response.write "" CloseRecordSet rs ShopCloseDatabase dbc end sub '************************************* Sub CategoryHeader ' displays header for categories %> <%=catHeader%><%=LangCat01%>
<% response.write "
<%
end if
end sub
Sub FillRemainingColumns
Do While Colcount