 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="no"
	dir="no" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/filesystem.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->
<%
'*****************************************
'FileName: Integral.asp
'Action: 管理中心会员投搞
'Copyright(c)2004-2008 网胜科技公司技术开发部
'Writer: XYF
'Create Date: 2009-?-?
'*****************************************

idlist=replace_text(request("userid"))
delbtn=replace_text(request("delbtn"))
checkbtn=replace_text(request("checkbtn"))

'response.Write Award

'--执行删除操作 -----------------------------------------------------------------------------------
   if delbtn<>"" then
    if instr(idlist,",")>0 then
  	 idArr=split(idlist,",")
 		for i = 0 to ubound(idArr)
		      call deletePicture(idArr(i))
 	          call deleteannounce(idArr(i))  
 		next
	 else    
	         call deletePicture(idlist)
			 call deleteannounce(idlist) 
			 
 	 end if
	 response.Redirect(request.ServerVariables("HTTP_REFERER"))
   end if
'--审核并进入咨询数据库-----------------------------------------------------------------------------
if checkbtn<>"" then
if instr(idlist,",")>0 then
  	 idArr=split(idlist,",")
 		for i = 0 to ubound(idArr)
 	         '
			 call updateflag(idArr(i))
			
 		next
	 else
			
			 call updateflag(idlist)
			
 	 end if
	'response.Redirect(request.ServerVariables("HTTP_REFERER"))
	response.write"<SCRIPT language=JavaScript>alert('成功审核通过!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
end if 
sub updateflag(newsid)
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from websen_MembersNews where  newsid="&cstr(newsid)
rs1.open sql1,conn,1,3
rs1("flag")=1
rs1.update
Membersid=rs1("Membersid")
Title=rs1("Title")
Content=rs1("Content")
Typeid=rs1("Typeid")
Nfrom=rs1("Nfrom")
Picture=rs1("Picture")
Dateandtime=rs1("Dateandtime")
Membertype=rs1("Membertype")
flag=rs1("flag") 
rs1.close
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from websen_corporation where ID="&Membersid
rs2.open sql2,conn,1,3
Awards=replace("Award"&newsid," ","")
Award=request.Form(Awards)
if Award="" then 
Award=0
end if
rs2("mark")=rs2("mark")+Award
rs2.update
rs2.close
set rs3=server.CreateObject("adodb.recordset")  
sql3="select  * from  websen_news where title='"&Title&"'"
rs3.open sql3,conn,1,3
if not rs3.eof then
response.write"<SCRIPT language=JavaScript>alert('对不起，您已经提交过此信息！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
else
rs3.addnew
rs3("Title")=Title
rs3("Content")=Content
rs3("Typeid")=Typeid
rs3("Nfrom")=Nfrom
rs3("Picture")=Picture
rs3("Dateandtime")=Dateandtime
rs3("Tjnews")="0"
rs3("hits")="0"
rs3("tjhome")="0"
rs3("homepic")="0"
rs3("html_pass")="0"
rs3("homehot")="0"
rs3("pictext")="0"
rs3("qx")="0"
rs3("topnews")="0"
rs3("checkbox")="0"
rs3.update
id1=rs3("NewsID")
id2=rs3("NewsID")
rs3.close
set rs5=server.CreateObject("adodb.recordset")
sql5="select mark from websen_MembersNews where  newsid="&cstr(newsid)
rs5.open sql5,conn,1,3
rs5("mark")=id1
rs5.update
rs5.close
%>
<iframe src="../../manage/makehtml/info/makedetail.asp?all=update&id1=<%=id1%>&id2=<%=id2%>&schtml=开始生成>>" frameborder="0" scrolling="yes" height="0" widht="0"></iframe>
<iframe src="../../manage/makehtml/index/index.asp?act=info" frameborder="0" scrolling="yes" height="0" widht="0"></iframe>
<%

end if
End sub

sub deleteannounce(newsid)
set rs=server.createobject("adodb.recordset")
sql="delete from [websen_MembersNews] where newsid="&cstr(newsid)
conn.execute sql
End sub

sub deletePicture(newsid)
set rsw=server.createobject("adodb.recordset")
sq1="select * from websen_MembersNews where newsid="&cstr(idlist)
rsw.open sq1,conn,1,3
if rsw("Picture")<>"nopicture.gif" then
call FileDel("../../UploadFile/"&rsw("picture")&"")
end if
rs.close
End sub
%>


