﻿<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%'============================================================
' Copyright 2007-09 燃点真情. All Rights Reserved.
' Last Update: 2008-3-22  13:28
' ADD:wap.nowtx.cn
' E-Mail: xivn@163.com  QQ:531233814
'============================================================
%>
<%dim TP,ids,Action
Action=Request.QueryString("Action")
TP=trim(request("TP"))
ids=trim(request("ids"))
IF  Action="f" Then
	call friend
elseif Action="h" Then

	call hait
elseif Action="pv" Then

	call photoview
elseif Action="zone" Then

	call zoneout
elseif Action="key" Then

	call keyout
else
	call photodel
end if
sub friend
 Response.Write "<card title=""删除好友""><p>"
if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
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 myfriend Where did=" & ids)
 Response.Write "好友解除成功！"
 Response.Write "<br/><a href=""myfriend.asp?sid="&sid&""">好友列表</a>"
else
 Response.Write "删除该好友？<br/>"
 Response.Write "<a href=""getsave.asp?action=f&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""myfriend.asp?sid="&sid&""">取消</a>"
end if

end  sub

sub hait
 Response.Write "<card title=""解除黑名单""><p>"
if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
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 myhait Where bid=" & ids)
 Response.Write "黑名单解除成功！"
 Response.Write "<br/><a href=""myhait.asp?sid="&sid&""">黑名单列表</a>"
else
 Response.Write "解除该黑名单？<br/>"
 Response.Write "<a href=""getsave.asp?action=h&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""myhait.asp?sid="&sid&""">取消</a>"
end if

end  sub
sub photodel
 Response.Write "<card title=""删除相片""><p>"
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&" and fid="&myid,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?sid="&sid&""">我的相册</a>"
else
 Response.Write "删除该相片？<br/>"
 Response.Write "<a href=""getsave.asp?action=p&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""photo.asp?sid="&sid&""">取消</a>"
end if

end  sub

sub zoneout
 Response.Write "<card title=""踢出群组""><p>"
 dim id
id=trim(request.querystring("id"))
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
end if
    if keys=1 or skey=abs(id) or adminzone=abs(id) then
    else
    Call Error("权限不足！")
end if
if TP<>"" then
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
if myid=clng(ids) then
  Call Error("不能踢自己！")
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 zoneid=0 Where id=" & ids)
 Response.Write "踢出群组成功！"
 Response.Write "<br/><a href=""zoneman.asp?id="&id&"&amp;sid="&sid&""">返回上级</a>"
else
 Response.Write "把该会员踢出群组？<br/>"
 Response.Write "<a href=""getsave.asp?action=zone&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""zoneman.asp?id="&id&"&amp;sid="&sid&""">取消</a>"
end if

end  sub

sub keyout
bbsid=trim(request.querystring("bbsid"))
    if keys=1 then
else
if bbsid="" or Isnumeric(bbsid)=False then
    Call Error("<card title=""出错了""><p>权限不足！")
end if
if bbsid<>"" and adminzone=abs(bbsid) then
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where skey="&bbsid&" and id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("<card title=""出错了""><p>该版主不存在！")
end if
  rs.close
  set rs=Nothing
    else
    Call Error("<card title=""出错了""><p>权限不足！")
end if
end if

if TP<>"" then
if clng(ids)=myid then
  Call Error("<card title=""出错了""><p>你不能撤除自己！")
  end if

if ids="" or Isnumeric(ids)=False then
  Call Error("<card title=""出错了""><p>ID无效！")
  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("<card title=""出错了""><p>ID不存在！")
end if
  rs.close
  set rs=Nothing

 conn.Execute("update users set skey=0 where id=" & ids)
 Response.Write "<card title=""撤销职务""><p>"
 Response.Write "撤销成功"
 if bbsid<>"" then
Response.write "<br/><a href=""bbsadmin.asp?bbsid="&bbsid&"&amp;sid="&sid&""">返回版务</a><br/>"
else
Response.write "<br/><a href=""managers.asp?sid="&sid&""">管理团队</a><br/>"
end if
Response.write "<a href=""index.asp?sid="&sid&""">社区首页</a><br/>"
else
 Response.Write "<card title=""撤销职务""><p>"
 Response.Write "确认撤销该会员的职务？<br/>"
 Response.Write "<a href='getsave.asp?bbsid="&bbsid&"&amp;Action=key&amp;ids="&ids&"&amp;sid="&sid&"&amp;TP=1'>是的</a><br/>"
 Response.Write "<anchor>取消<prev/></anchor>"
end if
end Sub
sub photoview
 Response.Write "<card title=""相片设置""><p>"
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
'检查文件是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id,photoview FROM Upfile where id="&ids&" and fid="&myid,conn,1,2
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("相片不存在！")
end if
if rs("photoview")=1 then
rs("photoview")=0
else
rs("photoview")=1
end if
rs.update
  rs.close
  set rs=Nothing
 Response.Write "相片设置操作成功！"
 Response.Write "<br/><a href=""photoview.asp?id="&ids&"&amp;sid="&sid&""">查看相片</a>"
 Response.Write "<br/><a href=""photo.asp?sid="&sid&""">我的相册</a>"
end  sub
conn.close
set conn=nothing%>
</p></card>
</wml>