<!--#include file="conn.asp"-->
<!--#include file=cookies.asp-->

<%
dim rs,sql,del_username,sql1,sql2,rs1,id,str2,i,all_id,str1,k,username,sql4,str4,a,sql3
all_id=trim(request("selectedid"))
set rs=server.createobject("adodb.recordset")
str1=split(all_id,",")
for k=0 to ubound(str1)

'sql="select id,username from [xinxi] where username='"&trim(str1(k))&"'"
'rs.open sql,conn,1,1
'if rs.eof or rs.bof then
'rs.close
'     str4=split(all_id,",")
'     for a=0 to ubound(str4)
'     sql4="delete from [com] where username='"&trim(str4(a))&"' "
'     rs.open sql4,conn,1,3
'     response.write "<li>用户"&trim(str4(a))&"删除成功！"
'     next
'else
'On Error Resume Next
'rs.close

sql="select id from [xinxi] where username='"&trim(str1(k))&"'"
rs.open sql,conn,1,1
do while not rs.eof
id=id +","&rs("id")&""
rs.movenext
loop
rs.close

str2=split(id,",")
     for i=1 to ubound(str2)
     sql="delete from [xinxi] where username='"&trim(str1(k))&"'"
     rs.open sql,conn,1,3
     sql1="delete from [shoucang] where scid='"&cstr(str2(i))&"' or username='"&trim(str1(k))&"' "
     rs.open sql1,conn,1,3
     sql2="delete from [hf] where xxid='"&cstr(str2(i))&"' or username='"&trim(str1(k))&"' "
     rs.open sql2,conn,1,3
     next
sql3="delete from [gbook] where username='"&trim(str1(k))&"' "
rs.open sql3,conn,1,3
sql2="delete from [com] where username='"&trim(str1(k))&"' "
rs.open sql2,conn,1,3
response.write "<li>用户"&trim(str1(k))&"删除成功！"

'end if

next
set rs=nothing
closedb
%>