<% userPageRights="{member}" %>
<!--#include file="check.asp"-->
<!--#include file="../Include/Char.asp" -->
<%

dim i
dim rsdel,rsdel1


ArticleID=trim(request("ArticleID"))
Action=Trim(Request("Action"))
FoundErr=False
if ArticleId="" then
	FoundErr=True
   Call Msgbox("¶Ô²»Æð,ÇëÑ¡ÔñÕÕÆ¬£¡",1)
    Response.end
end if
'É¾³ýÕÕÆ¬
if Action="del" then 

if instr(ArticleID,",")>0 then
	'	dim idarr,i
		idArr=split(ArticleID)
		for i = 0 to ubound(idArr)
			call DelArticle(clng(idarr(i)))
		next
	else
		call DelArticle(clng(ArticleID))
	end if

	conn.close
	set conn=nothing
	response.Redirect "admin_memberphoto.asp"

	

sub DelArticle(ID)
	'PurviewChecked=False
	sqlDel1="select f_photo from t_member_photo where f_ID=" & CLng(ID)
	Set rsDel1= Server.CreateObject("ADODB.Recordset")
	rsDel1.open sqlDel1,conn,1,3
	if not rsdel1.eof then
	
	 strUploadFiles=rsDel1("f_photo")
	     if strUploadFiles<>"" then
				Set fso = CreateObject("Scripting.FileSystemObject")				
					if fso.FileExists(server.MapPath("../Member/Photo/" & strUploadfiles)) then
						fso.DeleteFile(server.MapPath("../Member/Photo/" & strUploadfiles))
					end if				
				Set fso = nothing
			end if
   rsDel1.delete
   rsdel1.update
	end if	
	'rsdel1.close
	'set rsdel1=nothing	
   	
end sub
  
end if
'////////////////////////////////////////////////
'ÉóºËÕÕÆ¬
if request("action")="acc" then


	if instr(ArticleID,",")>0 then
		'dim idarr,i
		idArr=split(ArticleID)
		for i = 0 to ubound(idArr)
			call pullArticle(clng(idarr(i)))
		next
	else
		call pullArticle(clng(ArticleID))
	end if


	conn.close
	set conn=nothing
	response.Redirect "admin_memberphoto.asp"



sub pullArticle(ID)
	'PurviewChecked=False
	sqlDel="update t_member_photo set f_ischeck='1' where f_ID=" & CLng(ID)
	Set rsDel= Server.CreateObject("ADODB.Recordset")
	rsDel.open sqlDel,conn,1,3	
	'rsdel.close
'	set rsdel=nothing   	
end sub

end if

%>
