<%= OutputCSS() %>
User Management :       Help <% Dim searchBy, criteria Dim SQL, objRS, perPage, pageNum, upper, lower, order, adesc, totalUsers, totalPages, ex Dim i, banned, usertype perPage = request.queryString("perPage") pageNum = request.queryString("pageNum") order = request.queryString("order") adesc = request.queryString("adesc") usertype = request.queryString("usertype") if perPage = "" then perPage = 20 if pageNum = "" then pageNum = 1 if order = "" then order = "Mem" if adesc <> "" then adesc = " DESC" searchBy = request.queryString("searchBy")&"" criteria = request.queryString("criteria")&"" if len(searchBy)=0 then searchBy = "Login" %>
> >
Search for User
Search User: > (use "%" for wild card)
By : class="radiocheck">Login Name class="radiocheck">E-mail Address class="radiocheck">First Name class="radiocheck">Last Name
class="radiocheck">Member ID class="radiocheck">IP Address
class="radiocheck">Show all banned user class="radiocheck">Show all users who haven't passed the registration
> <% Dim istart, iend set objRS = server.CreateObject("adodb.recordset") with objRS '=========================This is for display user, and construct SQL======================= if ((searchBy="" or criteria="") and (searchBy <> "banned") and (searchBy <> "regStatus")) then totalUsers = Application(dbName&"totalMem") .open "SELECT "&order&" FROM pgd_members WHERE (regStatus=0) ORDER BY "&order&adesc, datastore, adOpendynamic, , adCmdText if pageNum<>1 then .move ((pageNum-1)*perPage) upper = .fields(order) .move (perpage-1) if .EOF then .movelast lower = .fields(order) .close if (totalUsers mod perPage) <> 0 then totalPages = (totalUsers\perPage)+1 else totalpages = (totalUsers\perPage) if order <> "Mem" then lower="'"&lower&"'" upper="'"&upper&"'" end if 'only difference between SQL and ACCESS if adesc="" then ex = lower lower = upper upper = ex end if 'end of difference '==============0=====1======2======3======4======5=== SQL = "SELECT Mem, Login, Fname, Lname, Email, banned FROM pgd_members "&_ "WHERE ((regStatus=0) And "&order&" BETWEEN "&lower&" AND "&upper&" ) ORDER BY "&order&adesc '=========================This is the query for searching user, and construct SQL======================= else Dim SQLcriteria criteria = trim(criteria) if searchBy <> "Mem" and searchBy <> "banned" and searchBy <> "regStatus" then SQLcriteria = "like '"&criteria&"'" elseif searchBy = "banned" then SQLcriteria = "= 1" elseif searchBy = "regStatus" then SQLcriteria = "> 0 AND banned = 0" else if isnumeric(criteria) then SQLcriteria = "= "&criteria _ else SQLcriteria = "= -9" end if SQL = "SELECT Mem, Login, Fname, Lname, Email, banned FROM pgd_members "&_ "WHERE ((Mem > -1) And "&searchBy&" "&SQLcriteria&") ORDER BY "&order&adesc end if .open SQL, datastore, , , adCmdText Dim arrMem, upbound if not .EOF then arrMem = .getrows() upbound = ubound(arrMem,2) end if .close end with set objRS = nothing if ((searchBy="" or criteria="") and (searchBy <> "banned") and (searchBy <> "regStatus")) then istart = 0 iend = upbound else istart = (pageNum-1)*perPage if pageNum*perPage > upbound+1 then iend = upbound else iend = pageNum*perPage-1 if isArray(arrMem) then totalUsers = upbound+1 else totalUsers = 0 pageNum=0 end if if (totalUsers mod perPage) <> 0 then totalPages = (totalUsers\perPage)+1 else totalpages = (totalUsers\perPage) end if if isArray(arrMem) then for i=istart to iend if arrMem(5,i) = 0 then response.write ("") else response.write ("") response.write _ (""&_ ""&_ ""&_ ""&_ ""&_ ""&_ "") response.write ("") next response.write ("
Member List: (click on Member ID field to view detail)
>Members per page : '" name="perPage" value="20" <%= checkedOption(perPage,20) %> class="radiocheck">20 '" name="perPage" value="40" <%= checkedOption(perPage,40) %> class="radiocheck">40 '" name="perPage" value="60" <%= checkedOption(perPage,60) %> class="radiocheck">60 '" name="perPage" value="100" <%= checkedOption(perPage,100) %> class="radiocheck">100     <% Dim strSQL, arrGroups strSQL = "SELECT GName, GID FROM pgd_UserGroup" set objRS = server.createobject("adodb.recordset") With objRS .open strSQL, datastore, , , adCmdText if not (.eof and .bof) then arrGroups = .getrows .close End With set objRS = nothing if isArray(arrGroups) then response.write ("") end if %>
  ">Member ID ">Login ">First Name ">Last Name ">E-mail
"&arrMem(0,i)&""&HTMLEncode(""&arrMem(1,i))&""&HTMLEncode(""&arrMem(2,i))&""&HTMLEncode(""&arrMem(3,i))&""&HTMLEncode(""&arrMem(4,i))&"
") else response.write ("
no such member found !!
") end if %> <% if searchBy = "regStatus" then %> <% end if %>
| Total Members:<%= totalUsers %> | Current page:<%= pageNum %> |Total pages:<%= totalPages %> |
<% if request.queryString("sent") = "yes" then response.write ("Confirmation messages have been sent!") %>
<% if request.queryString("sent") = "dis" then response.write ("Disapproval messages have been sent!") %>
<% for i=1 to totalPages %> "><%= i %> <% next %>