<!--#include file="conn.asp"-->
<!--#include file=cookies.asp-->
<link rel="stylesheet" type="text/css" href="images/fox.css">
<style type=text/css>
BODY{
	margin:0px;
	FONT-SIZE: 12px;
	FONT-FAMILY: "宋体", "Verdana", "Arial", "Helvetica", "sans-serif";
	background-color: #CCCC99; 
	scrollbar-highlight-color: #CC9933; 
	scrollbar-arrow-color: #FFFFFF; 
	scrollbar-base-color: #CC9933
}
table { border:0px; }
td { font:normal 12px 宋体; }
img { vertical-align:bottom; border:0px; }
a { font:normal 12px 宋体; color:#111111; text-decoration:none; }
a:hover { color:#384780;text-decoration:underline; }
.sec_menu { border-left:2px solid #CC3300; border-right:2px solid #CC3300; border-bottom:2px solid #CC3300; overflow:hidden; background:#ffffff; }
.menu_title {background-color: #335EA8;color: white;font-size: 12px;font-weight:bold;height: 25; }
.menu_title span { position:relative; top:2px; left:8px; color:#FFFF00; font-weight:bold; }
.menu_title2 {background-color: #335EA8;color: white;font-size: 12px;font-weight:bold;height: 25; }
.menu_title2 span { position:relative; top:2px; left:8px; color:#FEFEFE; font-weight:bold; }
input,select,Textarea{
font-family:宋体,Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}
</style>
<%
dim  rsa,sqla,xxxx
xxxx=trim(request("selectedid"))
set rsa=server.createobject("adodb.recordset")
sqla="select shi from [FOX_user] where username='"&xxxx&"'"
rsa.open sqla,conn,1,1
if  rsa("shi")<>session("admin_shi") then
response.Write "<script LANGUAGE='javascript'>alert('您管理的范围超过了您的地区！');history.go(-1);</script>"
response.end
else

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

sql="select id from [FOX_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 [FOX_xinxi] where username='"&trim(str1(k))&"'"
     rs.open sql,conn,1,3
     sql1="delete from [FOX_dian] where username='"&trim(str1(k))&"' "
     rs.open sql1,conn,1,3
     sql4="delete from [FOX_meng] where username='"&trim(str1(k))&"' "
     rs.open sql4,conn,1,3
     sql5="delete from [FOX_shop] where username='"&trim(str1(k))&"' "
     rs.open sql5,conn,1,3
     sql6="delete from [FOX_zixun] where username='"&trim(str1(k))&"' "
     rs.open sql6,conn,1,3
     sql7="delete from [FOX_mp] where username='"&trim(str1(k))&"' "
     rs.open sql7,conn,1,3
     sql2="delete from [FOX_hf] where xxid='"&cstr(str2(i))&"' or username='"&trim(str1(k))&"' "
     rs.open sql2,conn,1,3
     next
sql3="delete from [FOX_gbook] where username='"&trim(str1(k))&"' "
rs.open sql3,conn,1,3
sql2="delete from [FOX_user] where username='"&trim(str1(k))&"' "
rs.open sql2,conn,1,3
response.write "<script language=JavaScript>" & chr(13) & "alert('删除用户成功！');" & "window.location='userlist.asp'" & "</script>"


next
set rs=nothing
set rsa=nothing
closedb
end if
%>