<!--#include file="../include/Conn.jsp"-->
<!--#include file="../Include/char.jsp" -->
<!--#include file="Admin_IsLogin.jsp" -->
<%

dim i
dim rsdel,rsdel1




	admin_flag=",4|4|0,"
	if instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true then
	Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
	Response.end
	end if
 
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.jsp"

	

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/" & strUploadfiles)) then
						fso.DeleteFile(server.MapPath("../member/" & 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.jsp"



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

%>
