<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
%>

<%dim TP,ids,Action,tid,bbsid,tzname,id
Action=Request.QueryString("Action")

ids=usb(request("ids"))
id=usb(request("id"))
TP=usb(request("TP"))
IF  Action="sell" Then
	call selldel
elseif  Action="rel" Then

	call reldel

elseif  Action="pho" Then
	call photosdel
elseif  Action="tid" Then
	call tiddel
elseif  Action="msg" Then
	call msgdel
elseif  Action="msgid" Then
	call msgiddel
elseif  Action="ycdel" Then
	call sellycdel

elseif  Action="reid" Then
	call reiddel
elseif  Action="vip" Then
	call vipdel
else
	call photodel
end if

sub selldel

if TP<>"" then
if ids="" or Isnumeric(ids)=False then

if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card title=""出错了""><p>ID无效！")
  end if
end if

'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("ID不存在！")
end if
  rs.close
  set rs=Nothing

  conn.Execute("delete from sell Where fid=" & ids)
call saycardd("清空TA的帖子")
 Response.Write "清空成功"
Response.write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"
Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">[后台首页]</a><br/>"
else
call saycardd("清空TA的帖子")
 Response.Write "确认清空TA的帖子？<br/>"
 Response.Write "<a href='topicdel.asp?Action=sell&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&"'>是的</a><br/>"
 Response.Write "<anchor>取消<prev/></anchor>"
end if
 call headsay()
end Sub
Sub reldel
if TP<>"" then
if ids="" or Isnumeric(ids)=False then
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card title=""出错了""><p>ID无效！")
  end if
end if
  conn.Execute("delete from relist Where fid=" & ids)
  call saycardd("清空TA的回帖")
 Response.Write "清空成功"

Response.write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"

Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">[后台首页]</a><br/>"

else
call saycardd("清空TA的回帖")

 Response.Write "确认清空TA的回帖？<br/>"
 Response.Write "<a href='topicdel.asp?Action=rel&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&"'>是的</a><br/>"
 Response.Write "<anchor>取消<prev/></anchor>"
end if
 call headsay()
end Sub
Sub photosdel
if TP<>"" then
if ids="" or Isnumeric(ids)=False then
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card title=""出错了""><p>ID无效！")
  end if
end if
  conn.Execute("delete from upfile Where smallstr=1 and fid=" & ids)
  call saycardd("清空TA的相册")
 Response.Write "清空成功"

Response.write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"

Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">[后台首页]</a><br/>"

else
call saycardd("清空TA的相册")

 Response.Write "确认清空TA的相册？<br/>"
 Response.Write "<a href='topicdel.asp?Action=pho&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&"'>是的</a><br/>"
 Response.Write "<anchor>取消<prev/></anchor>"
end if
 call headsay()
end Sub


sub photodel
call saycardd("删除相片")
if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
'检查文件是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM Upfile where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("相片不存在！")
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from Upfile Where id=" & ids)
 Response.Write "相片删除成功！"
 Response.Write "<br/><a href=""photo.asp?ids="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""">TA的相册</a>"
else
 Response.Write "删除该相片？<br/>"
 Response.Write "<a href=""topicdel.asp?action=p&amp;ids="&ids&"&amp;id="&id&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&""">是的</a>"
 Response.Write "<br/><a href=""photo.asp?sid="&sid&""">取消</a>"
end if

 call headsay()
end  sub

sub tiddel
call saycardd("删除贴子")

if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
end if
'检查文件是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM sell where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("贴子不存在！")
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from sell Where id=" & ids)
 Response.Write "贴子删除成功！"
 Response.Write "<br/><a href=""alist.asp?ids="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""">TA的贴子</a>"
  Response.Write "<br/><a href=""admingsell.asp?sid="&sid&"&amp;saytk="&saytk&""">贴子管理</a>"
else
 Response.Write "删除该贴子？<br/>"
 Response.Write "<a href=""topicdel.asp?action=tid&amp;ids="&ids&"&amp;id="&id&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&""">是的</a>"
  Response.Write "<br/><anchor>取消<prev/></anchor>"
end if

 call headsay()
end  sub






sub reiddel
call saycardd("删除回复")
if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if

'检查文件是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM relist where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("回复不存在！")
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from relist Where id=" & ids)
 Response.Write "回复删除成功！"
 
 Response.Write "<br/><a href=""relist.asp?id="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""">回复管理</a>"
else
 Response.Write "删除该回复？<br/>"
 Response.Write "<a href=""topicdel.asp?action=reid&amp;ids="&ids&"&amp;id="&id&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&""">是的</a>"
  Response.Write "<br/><anchor>取消<prev/></anchor>"
end if

call headsay()
end  sub

sub msgdel
call saycardd("清空TA的内线")

if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
'检查用户是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("会员不存在！")
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from guest Where fid=" & ids)
 Response.Write "清空TA的内线成功！"
Response.write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"
else
 Response.Write "清空TA的内线？<br/>"
 Response.Write "<a href=""topicdel.asp?action=msg&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&""">是的</a>"
 Response.Write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">取消</a>"
end if

 call headsay()
end  sub

sub msgIDdel
call saycardd("删除内线")
 id=trim(request.Querystring("id"))
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
end if
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
if TP<>"" then
'检查用户是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("会员不存在！")
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from guest Where fid=" & ids &" and id="&id)
 Response.Write "删除该条内线成功！"
Response.write "<br/><a href=""adminguestcl.asp?ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[TA的内线]</a><br/>"
Response.write "<a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"
else
 Response.Write "删除这个内线？<br/>"
 Response.Write "<a href=""topicdel.asp?action=msgid&amp;ids="&ids&"&amp;id="&id&"&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&""">是的</a>"
 Response.Write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">取消</a>"
end if

 call headsay()
end  sub



sub vipdel
  call saycardd("去掉TA的VIP权限")
if TP="" then
if ids="" or Isnumeric(ids)=False then

if saytk="" then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card title=""出错了""><p>ID无效！")
  end if
end if

'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("ID不存在！")
end if
  rs.close
  set rs=Nothing

  conn.Execute("update users set vipface=0,vipdj=0,vipdate=null Where id=" & ids)

 Response.Write "去掉VIP成功"
Response.write "<br/><a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[用户信息]</a><br/>"
Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">[后台首页]</a><br/>"
end if
call headsay()

end Sub

Sub sellycdel
if TP<>"" then
  conn.Execute("delete from sell Where yc=1")
  conn.Execute("delete from relist Where yc=1")
  call saycardd("清空回收站")
 Response.Write "清空回收站成功"

Response.write "<br/><a href=""adminsell.asp?sid="&sid&"&amp;saytk="&saytk&""">[帖子回收]</a><br/>"

Response.write "<a href=""../index.asp?sid="&sid&"&amp;saytk="&saytk&""">[后台首页]</a><br/>"

else

call saycardd("清空回收站")
 Response.Write "确认清空回收站？<br/>"
 Response.Write "<a href='topicdel.asp?Action=ycdel&amp;sid="&sid&"&amp;TP=1&amp;saytk="&saytk&"'>是的</a><br/>"
 Response.Write "<anchor>取消<prev/></anchor>"
end if
call headsay()
end Sub

%>

