<%Response.Expires=0
Response.Buffer=true
cwjh_id=Session("cwjh_id")
cwjh_name=Session("cwjh_name")
cwjh_grade=Session("cwjh_grade")
cwjh_jhdj=Session("cwjh_jhdj")
nowinroom=session("nowinroom")
if cwjh_name="" then Response.Redirect "../error.asp?id=440"
if session("cwjh_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if cwjh_grade<>10 or instr(Application("cwjh_admin"),cwjh_name)=0  then Response.Redirect "../error.asp?id=439"
if cwjh_name<>Application("cwjh_user") then Response.Redirect "../error.asp?id=486"
Response.write "正在清理......<br>"
Response.Flush
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("showmdb")
conn.open connstr
Set conn2=Server.CreateObject("ADODB.CONNECTION")
Set rs2=Server.CreateObject("ADODB.RecordSet")
connstr2=Application("cwjh_usermdb")
conn2.open connstr2
%>
<LINK href=../cwjh_admin/css/css.css type=text/css rel=stylesheet>
<body bgColor=#dcdec6 text=#000000 link=#003366 vLink=#006666>
<%
if request("edit")="ok" then
sql="SELECT * FROM [use] order by a"
Set Rs=conn.Execute(sql)
do while not rs.eof and not rs.bof
  	huzhu=rs("a")
	sql2="select * from 用户 where 姓名='" & huzhu & "'"
	Set Rs2=conn2.Execute(sql2)
	if rs2.eof then
		sql2="delete * from use where a='"&huzhu&"'"
		conn.Execute(sql2)
		sql3="delete * from usesp where sa='"&huzhu&"'"
		conn.Execute(sql3)
		sql4="delete * from sai where s_姓名='"&huzhu&"'"
		conn.Execute(sql4)
		sql5="delete * from log where 姓名='"&huzhu&"'"
		conn.Execute(sql5)
                Response.write "×"
	else
        	Response.write "√"
	end if
Rs2.close
rs.movenext 
Response.Flush
loop 
conn.close
says="<font color=black>【清理秀装】</font><font color=red>站长[ " & cwjh_name &" ]对江湖秀装进行了清理，所有无户头的秀装都被清理完毕！</font>"			'聊天数据
says=replace(says,"'","\'")
says=replace(says,chr(34),"\"&chr(34))
act="消息"
towhoway=0
towho="大家"
addwordcolor="660099"
saycolor="008888"
addsays="对"
saystr="<script>parent.sh("& chr(39) & addwordcolor & chr(39) &","& chr(39) & saycolor & chr(39) &","& chr(39) & act & chr(39) &","& chr(39) & cwjh_name & chr(39) &","& chr(39) & addsays & chr(39) &","& chr(39) & towho & chr(39) &"," & chr(39) & says & chr(39) &"," & towhoway &  ","& nowinroom & ");<"&"/script>"
call addmsg(saystr)
Function Yushu(a)
	Yushu=(a and 31)
End Function
Sub AddMsg(Str)
Application.Lock()
Application("SayCount")=Application("SayCount")+1
i="SayStr"&YuShu(Application("SayCount"))
Application(i)=Str
Application.UnLock()
End Sub
response.write "<br>所有无户头秀装清理完毕<br>（改名,被杀或改名导致的无户头秀装全部清理掉）<br>×为找不到户头的秀装"
end if
%>
<hr>
<a href=?edit=ok>点这里将改名,被杀或其它原因导致的无户头秀装全部清理掉</a>