<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->

<%call head()
dim TP,ids,Action
Action=Request.QueryString("Action")
del2009=Request.QueryString("del2009")
TP=trim(request("TP"))
PIC=trim(request("PIC"))
ids=trim(request("ids"))
id=trim(request("id"))
IF  Action="f" Then
	call friend
elseif Action="save" Then

	call photopic

elseif Action="h" Then

	call hait
elseif Action="pv" Then

	call photoview
elseif del2009="del2009" Then

	call del2009

elseif Action="zone" Then

	call zoneout
elseif Action="key" Then

	call keyout
else
	call photodel
end if



sub photopic
Call saycarda("相片设置")

dim pic
pic=Request.QueryString("pic")
conn.Execute("update users set photo='"&pic&"' where id="&myid)

 Response.Write "设置头像成功！"
 Response.Write "<br/><a href=""uinfo.asp?id="&myid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">查看头像</a>"
 Response.Write "<br/>========"
if tp=1 then
 Response.Write "<br/><a href=""photoview.asp?id="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回相片</a>"
 Response.Write "<br/><a href=""myphoto.asp?saytk="&saytk&"&amp;sid="&sid&""">我的相册</a>"
else
response.write "<br/><a href=""show.asp?saytk="&saytk&"&amp;sid="&sid&""">我的空间</a>"
end if
response.write "<br/><a href=""show.asp?saytk="&saytk&"&amp;sid="&sid&""">我的空间</a>"

end  sub

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 & " and cid="&myid)
 Response.Write "好友解除成功！"
 Response.Write "<br/><a href=""myfriend.asp?saytk="&saytk&"&amp;sid="&sid&""">好友列表</a>"
else
 Response.Write "删除该好友？<br/>"
 Response.Write "<a href=""getsave.asp?action=f&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""myfriend.asp?saytk="&saytk&"&amp;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 & " and jid="&myid)
 Response.Write "黑名单解除成功！"
 Response.Write "<br/><a href=""myhait.asp?saytk="&saytk&"&amp;sid="&sid&""">黑名单列表</a>"
else
 Response.Write "解除该黑名单？<br/>"
 Response.Write "<a href=""getsave.asp?action=h&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""myhait.asp?saytk="&saytk&"&amp;sid="&sid&""">取消</a>"
end if

end  sub




sub del2009
 Response.Write "<card title=""删除相片""><p>"
  conn.Execute("delete from Upfile Where id=" & ids)
 Response.Write "相片删除成功！"
 Response.Write "<br/><a href=""photo.asp?saytk="&saytk&"&amp;sid="&sid&""">我的相册</a>"

end  sub


sub del2009
 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
  conn.Execute("delete from Upfile Where id=" & ids)
 Response.Write "相片删除成功！"
 Response.Write "<br/><a href=""photo.asp?saytk="&saytk&"&amp;sid="&sid&""">我的相册</a>"
end if
  rs.close
  set rs=Nothing
  conn.Execute("delete from Upfile Where id=" & ids)
 Response.Write "相片删除成功！"
 Response.Write "<br/><a href=""photo.asp?saytk="&saytk&"&amp;sid="&sid&""">我的相册</a>"
else
 Response.Write "删除该相片？<br/>"
 Response.Write "<a href=""getsave.asp?action=p&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""photo.asp?saytk="&saytk&"&amp;sid="&sid&""">取消</a>"
end if

end  sub



sub zoneout
Call saycarda("踢出帮派")

 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) or keys=2 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;saytk="&saytk&"&amp;sid="&sid&""">返回上级</a>"
else
 Response.Write "把该会员踢出帮派？<br/>"
 Response.Write "<a href=""getsave.asp?action=zone&amp;id="&id&"&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""zoneman.asp?id="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&""">取消</a>"
end if

end  sub

sub keyout
bbsid=trim(request.querystring("bbsid"))
    if keys=1 or keys=2 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;saytk="&saytk&"&amp;sid="&sid&""">返回版务</a><br/>"
else
Response.write "<br/><a href=""managers.asp?saytk="&saytk&"&amp;sid="&sid&""">管理团队</a><br/>"
end if
Response.write "<a href=""index.asp?saytk="&saytk&"&amp;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;saytk="&saytk&"&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;saytk="&saytk&"&amp;sid="&sid&""">查看相片</a>"
 Response.Write "<br/><a href=""photo.asp?saytk="&saytk&"&amp;sid="&sid&""">我的相册</a>"
end  sub
conn.close
set conn=nothing%>
</p></card>
</wml>