% if request.form <> "" then Dim mode, strSQL, objRS, objCon, allData, hasSearch dim firstCheck dim firstBox dim secondCheck dim secondBox dim thirdCheck dim thirdBox dim fourthCheck mode = request.queryString("mode") strSQL = _ "SELECT top 50 P.Mem, login, totalposts, (SELECT count(messageID) FROM pgd_messages m WHERE parent=0 and P.Mem = m.Mem) as Threads, "&_ "(SELECT count(messageID) FROM pgd_messages n WHERE parent >0 and P.Mem = n.Mem) as Replies, lastLogin, dateSignUp, banned, "&_ "(SELECT max(dateCreated) FROM pgd_messages K WHERE P.Mem = K.Mem) as LastPost " &_ "FROM pgd_members P WHERE P.mem > 0 " SELECT Case mode Case "1" firstCheck = request.form("1_r_c") firstBox = ""&request.form("1_r_t") secondCheck = request.form("1_b_c") hasSearch = false strSQL = strSQL & "AND totalposts = 0 " if firstCheck = "on" and firstBox <> "" and isNumeric(firstBox) then strSQL = strSQL & "AND regStatus > 0 AND dateSignUp < DateADD (dd, "&-Clng(firstBox)&", GetDate())" hasSearch = true end if if secondCheck = "on" then strSQL = strSQL & "AND banned=1 " hasSearch = true else strSQL = strSQL & "AND banned=0 " hasSearch = true end if if hasSearch = false then response.redirect ("admin_u_delete.asp") response.end end if Case "2" firstCheck = request.form("2_p_c") firstBox = ""&request.form("2_p_t") secondCheck = request.form("2_l_c") secondBox = ""&request.form("2_l_t") thirdCheck = request.form("2_s_c") thirdBox = ""&request.form("2_s_t") fourthCheck = request.form("2_b_c") hasSearch = false 'strSQL = strSQL & "AND totalposts > 0 " if firstCheck = "on" and firstBox <> "" and isNumeric(firstBox) then strSQL = strSQL & "AND (SELECT max(dateCreated) FROM pgd_messages S WHERE P.Mem = S.Mem) < DateADD (dd, "&-Clng(firstBox)&", GetDate()) " hasSearch = true end if if secondCheck = "on" and secondBox <> "" and isNumeric(secondBox) then strSQL = strSQL & "AND lastLogin < DateADD (dd, "&-Clng(secondBox)&", GetDate())" hasSearch = true end if if thirdCheck = "on" and thirdBox <> "" and isNumeric(thirdBox) then strSQL = strSQL & "AND totalposts < "&Clng(thirdBox)&" " hasSearch = true end if if fourthCheck = "on" then strSQL = strSQL & "AND banned=1 " hasSearch = true else strSQL = strSQL & "AND banned=0 " hasSearch = true end if if hasSearch = false then response.redirect ("admin_u_delete.asp") response.end end if Case "3" dim delName:delName = SQLStrip(trim(""&request.form("3_n"))) if delName = "" then response.redirect ("admin_u_delete.asp") response.end end if strSQL = strSQL & "AND login='"&delName&"' " END SELECT ' response.write(strSQL) ' response.end set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 50 .open strSQL, datastore, , , adCmdText If not (.EOF or .BOF) then allData = .getrows Else response.redirect ("admin_u_delete.asp?done=no") End if .close end with set objRS=nothing dim i, memIDs %>
<% response.end end if %>