<% Session("PriorPage") = Session("CurrentPage") Session("CurrentPage") = "admin.asp" ' ***** Initialize Query ***** Dim ConnStr Dim Conn Dim rs Dim SQL Dim ID Dim UserID Dim Name Dim UserType Dim Active Dim PriorType Dim HeadName ' *************************************** ' Connect to Database ' *************************************** connectdb If Err.number <> 0 Then strErrorMsg = strErrorMsg & "305. Error Unable to connect to database.
" Err.Clear End If ' *************************************** ' Select Table Information ' *************************************** SQL = "SELECT ID, " SQL = SQL & "Name, " SQL = SQL & "UserID, " SQL = SQL & "UserType, " SQL = SQL & "Active " SQL = SQL & "FROM User " SQL = SQL & "ORDER BY UserType, Name " ' ***** Start Page ***** %> Site Administration

Site Administration

<% ' ***** Run Query ***** Set rs = Conn.Execute(SQL) priorType = 0 While Not rs.EOF ID = rs.fields("ID") UserID = rs.fields("UserID") Name = rs.fields("Name") Active = rs.fields("Active") UserType = rs.fields("UserType") if (UserType > PriorType) then ' ***** Close prior section ***** if priorType > 0 then %>

 

<% ' ***** Case Variables ***** end if if UserType = 1 then HeadName = "Administrator" elseif UserType = 2 then HeadName = "Clients" else Headname = "Agents" end if ' ***** Format new Section ***** %>

<%=HeadName%>

(new)
<% end if ' ***** Format Detail Line ***** %> <% priorType = UserType rs.MoveNext Wend rs.close set rs = nothing conn.close set conn = nothing %>
ID Name Login Active
<%=ID%> <%=Name%> <%=UserID%>    checked> <% else %> ><% end if %>