<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../inc/conn.asp"-->
<%
op=Request("op")
del_count=request.form("checkbox1").count
returnURL=Request("returnURL")

PiLiangZhuanZheng
'Response.Redirect returnURL

Sub PiLiangZhuanZheng

select case op
case "选择删除"
	idList=Trim(Request.Form("checkbox1"))
	if idList="" then
		exit sub
	end if
	'sql="delete from bbstitle where id=" & replace(idList, ", ", " or id=") & ""
	'conn.execute sql
	'Response.Redirect returnURL
	for i=1 to del_count
		bbsid=request.form("checkbox1")(i)
	    sql2="select bbs_img,htmfilename from bbstitle where id="&bbsid
	    Set rs= Server.CreateObject("ADODB.Recordset")
        rs.open sql2,conn,1,1
	  if not rs.eof then
        FiLePaTh = Server.MapPath("../")& "\html\" &rs("htmfilename")
        Set fso = CreateObject("Scripting.FileSystemObject")
        fso.DeleteFile(FiLePaTh)
        Set fso = nothing
        if rs("bbs_img")<>"" then
        '以下是删除图片文件
        FiLePaTh = Server.MapPath("../")& "\html\upfile\" &rs("bbs_img")
        Set fso = CreateObject("Scripting.FileSystemObject")
        fso.DeleteFile(filepath)
        Set fso = nothing   
        end if
		rs.close
		sql="delete from bbstitle where id="&bbsid
		conn.execute(sql)
        sql="delete from bbsmenu where pid="&bbsid
        conn.execute sql
	  end if
	next
	conn.close
	Response.Redirect returnURL
case else
	'***
end select

End Sub

%>