<% verify set objDB = OpenDatabase(true) SQL = "Select * from Category1 where Active = 1 order by Category" set rsCategory1 = CreateRecordset(objDB, SQL) SQL = "Select * from Category2 where Active = 1 order by Category" set rsCategory2 = CreateRecordset(objDB, SQL) SQL = "Select * from Category3 where Active = 1 order by Category" set rsCategory3 = CreateRecordset(objDB, SQL) SQL = "Select * from Category4 where Active = 1 order by Category" set rsCategory4 = CreateRecordset(objDB, SQL) SQL = "Select * from Category5 where Active = 1 order by Category" set rsCategory5 = CreateRecordset(objDB, SQL) section = "Categories" %>
:: <%=section%>

Manage Categories

<% while not rsCategory1.eof rsCategory2.filter = "Category1ID = " & rsCategory1("ID") %> <% rsCategory1.movenext wend %>
<%= rsCategory1("Category") %> &level=1">Edit | &level=2">Add New Subcategory
<% while not rsCategory2.eof rsCategory3.filter = "Category2ID = " & rsCategory2("ID") if x mod 2 = 0 then bgcolor = "#e8fed8" else bgcolor = "#FFFFFF" end if %> <% if rsCategory3.recordcount > 0 then %> <% end if rsCategory2.movenext x = x + 1 wend %>
  <%= rsCategory2("Category") %> &level=2">Edit | &level=2" onclick="return confirm('Are you sure you want to delete this category?')">Delete | &level=3">Add New Subcategory
<% while not rsCategory3.eof rsCategory4.filter = "Category3ID = " & rsCategory3("ID") if x mod 2 = 0 then bgcolor = "#e8fed8" else bgcolor = "#FFFFFF" end if %> <% if rsCategory4.recordcount > 0 then %> <% end if %> <% rsCategory3.movenext wend %>
     <%= rsCategory3("Category") %> &level=3">Edit | &level=3" onclick="return confirm('Are you sure you want to delete this category?')">Delete | &level=4">Add New Subcategory
<% while not rsCategory4.eof rsCategory5.filter = "Category4ID = " & rsCategory4("ID") if x mod 2 = 0 then bgcolor = "#e8fed8" else bgcolor = "#FFFFFF" end if %> <% if rsCategory5.recordcount > 0 then %> <% end if rsCategory4.movenext wend %>
        <%= rsCategory4("Category") %> &level=4">Edit | &level=4" onclick="return confirm('Are you sure you want to delete this category?')">Delete | &level=5">Add New Subcategory
<% while not rsCategory5.eof %> <% rsCategory5.movenext wend %>
      <%= rsCategory5("Category") %> &level=5">Edit | &level=5" onclick="return confirm('Are you sure you want to delete this category?')">Delete |


<% rsCategory1.close set rsCategory1 = nothing rsCategory2.close set rsCategory2 = nothing rsCategory3.close set rsCategory3 = nothing rsCategory4.close set rsCategory4 = nothing rsCategory5.close set rsCategory5 = nothing objDB.close set objDB = nothing %>