
<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim ID,Action,sqlDel,rsDel,PurviewChecked,ObjInstalled

ID=trim(request("ID"))
Action=Trim(Request("Action"))
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")

if ID="" or Action="" 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 CheckArticle(clng(idarr(i)),Action)
		next
	else
		call CheckArticle(clng(ID),Action)
	end if
end if
if FoundErr=False then
	call CloseConn()
	response.Redirect "Download_Check.asp"
else
	call CloseConn()
	call WriteErrMsg()
end if

sub CheckArticle(ID,CheckAction)
	PurviewChecked=False
	sqlDel="select * from Download where ID=" & CLng(ID)
	Set rsDel= Server.CreateObject("ADODB.Recordset")
	rsDel.open sqlDel,conn,1,3
	if rsDel.bof and rsDel.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到文章：" & rsDel("ID") & " </li>"
	end if
		if CheckAction="Check" then
			rsDel("Passed")=True
		elseif CheckAction="CancelCheck" then
			rsDel("Passed")=False
		end if
		rsDel.update
		set rsDel=nothing
end sub
%>