
<!--------MetInfo 网站管理系统------->
<!--这是一个免费开源程序，您可以在不用于商业目的的前提下对程序进行修改和再发布-->
<!--版权所有：www.MetInfo.com.cn-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../admin.asp"-->
<!--#include file="../Inc/Function.asp"-->
<!--#include file="../../Inc/Config.asp"-->
<!--#include file="../htm/createproducts.asp"-->
<%
dim ID,Action,sqlDel,rsDel,FoundErr,ErrMsg,ObjInstalled,class1
ID=trim(request("ID"))
Action=Trim(Request("Action"))
class1=trim(request("class1"))
FoundErr=False
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
set rs=server.createobject("adodb.recordset")
sql="select * from lanmu where id="&cint(class1)
		rs.open sql,conn,1,1
		webfile=rs("webname")		
		rs.close
set rs=nothing

if ID="" or Action<>"Del" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>参数不足！</li>"
end if
if FoundErr=False then
	if instr(ID,",")>0 then
		dim idarr,i
		idArr=split(ID)
		for i = 0 to ubound(idArr)
			call DelNews(clng(idarr(i)))
			call deletweb("Shownews",clng(idarr(i)),webfile)
		next
	else
		call DelNews(clng(ID))
	end if
end if
if FoundErr=False then
	call CloseConn()
	call Createindex()
	call deletweb("Shownews",ID,webfile)
	  response.Redirect "News_Manage.asp?id="&clng(class1)
else
	call CloseConn()
	call WriteErrMsg()
end if

sub DelNews(ID)
	sqlDel="select * from News where ID=" & CLng(ID)
	Set rsDel= Server.CreateObject("ADODB.Recordset")
	rsDel.open sqlDel,conn,1,3
		rsDel.delete
		rsDel.update
		set rsDel=nothing		
end sub

%>