<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="../Include/upload_club.inc"-->
<!--#include file="../sql/Neeao_SqlIn.Asp" -->
<!--#include file="IsLogin.asp" -->
<%
 m_ID = session("CurUserID")
 m_username= session("CurUsername")
  m_grade=session("curgrade")

   f_id=clng(checkStr(request("id")))
   g_id=clng(checkStr(request("g_id")))
   if f_id="" or g_id="" or IsNumeric(g_id)=false or IsNumeric(f_id)=false then
   Call Msgbox("对不起，ID号错误！",1)
   Response.end
   end if

  
set rs_a=server.createobject("adodb.recordset")
sql_a="select * from t_club where F_id="&f_id
rs_a.open sql_a,conn,1,3

if rs_a.eof then
 Call Msgbox("对不起，该俱乐部已经不存在！",1)
 Response.end
end if
if rs_a("f_manage_username")<>m_username or m_grade<>1 then
 Call Msgbox("对不起，您无权限管理本俱乐部！",1)
 Response.end
end if

set rs_c=server.createobject("adodb.recordset")
sql_c="select f_id from t_club_book where F_id="&g_id
rs_c.open sql_c,conn,1,3
if rs_c.eof then
 Call Msgbox("对不起，此留言已经不存在！",1)
 Response.end
end if
rs_c.delete
rs_c.update
conn.execute "update T_club set F_clubbook=f_clubbook-1 where F_ID=" &f_id
 url="club_viewsub.asp?id="&f_id
response.redirect url 
rs_c.close
set rs_c=nothing

rs_a.close
set rs_a=nothing
conn.close
set conn=nothing
%>
