<% userPageRights="{member}" %>
<!--#include file="check.asp"-->
<%
'Define Variable 
dim i
dim rs,rst
dim mTypeName,mGrade,mSql,mFlag,mBgColor
Set rs=Server.CreateObject("Adodb.RecordSet")

  m_DeleteID=Request.QueryString("DeleteID")
  '删除记录及相应文件
   
   mSql = "select f_photo,f_id FROM t_club WHERE F_ID=" &m_DeleteID
   Set rs_del=conn.execute(mSql)
   '删除图片文件
   del_id=rs_del("f_id")
   strUploadFiles=rs_del("f_photo")
	     if strUploadFiles<>"" then
				Set fso = CreateObject("Scripting.FileSystemObject")				
					if fso.FileExists(server.MapPath("../member/" & strUploadfiles)) then
						fso.DeleteFile(server.MapPath("../member/" & strUploadfiles))
					end if				
				Set fso = nothing
			end if
	'删除文件夹
			strUploadFiles=del_id
			  if strUploadFiles<>"" then
				Set fso = CreateObject("Scripting.FileSystemObject")				
				    if fso.FolderExists(server.MapPath("../member/ClubImages/" & strUploadfiles)) then
						fso.DeleteFolder(server.MapPath("../member/ClubImages/" & strUploadfiles))
				      end if				
				Set fso = nothing
			end if
   rs_del.close
   set rs_del=nothing
   
  mSql = "DELETE FROM t_club WHERE F_ID=" &m_DeleteID  '删除俱乐部
  conn.execute mSql
  mSql = "DELETE FROM t_club_member WHERE F_club_ID=" &m_DeleteID  '删除俱乐部下会员
  conn.execute mSql
    mSql = "DELETE FROM t_club_photo WHERE F_club_ID=" &m_DeleteID  '删除俱乐部下照片
  conn.execute mSql
    mSql = "DELETE FROM t_club_photobook WHERE F_club_ID=" &m_DeleteID  '删除俱乐部下照片评论
  conn.execute mSql
   mSql = "DELETE FROM t_club_book WHERE F_club_ID=" &m_DeleteID  '删除俱乐部留言
  conn.execute mSql
   mSql = "DELETE FROM t_club_board WHERE F_club_ID=" &m_DeleteID  '删除俱乐部公告
  conn.execute mSql
    mSql = "DELETE FROM t_club_meet WHERE F_club_ID=" &m_DeleteID  '删除俱乐部活动
  conn.execute mSql 
    mSql = "DELETE FROM T_club_meetmember WHERE F_club_ID=" &m_DeleteID  '删除俱乐部参加活动会员表
  conn.execute mSql
    mSql = "DELETE FROM t_club_meetbook WHERE F_club_ID=" &m_DeleteID  '删除俱乐部活动咨询留言表
  conn.execute mSql
  Response.write "<script>location.replace('admin_club.asp?action=IsDelete&pageno="&Request.Querystring("pageno")&"')</script>"
%>