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 ("")
response.write ("Assign to Group... ")
for i = 0 to ubound(arrGroups,2)
if not isBMan and arrGroups(1,i) <= 0 then
response.write("")
else
response.write ( _
""&_
HTMLEncode(""&arrGroups(0,i))&_
" "_
)
end if
next
response.write ("___________________________ ")
response.write ("Create a new User Group ")
response.write (" ")
end if
%>
>
">Member ID
">Login
">First Name
">Last Name
">E-mail
<%
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 _
(" "&_
""&arrMem(0,i)&" "&_
""&HTMLEncode(""&arrMem(1,i))&" "&_
""&HTMLEncode(""&arrMem(2,i))&" "&_
""&HTMLEncode(""&arrMem(3,i))&" "&_
""&HTMLEncode(""&arrMem(4,i))&" "&_
" ")
response.write (" ")
next
response.write ("
")
else
response.write ("