<%
 data_path="../" 'ACC连接数据库路径，对SQL无效 
  numid="06"
 dir="err.asp"
%>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
   <%
if issession=0 then
%>
<!--#include file="inc.asp"-->

<%
	If boollogin=false then
              Response.write "<script language='javascript'>"
              Response.write"alert('对不起！请重新登陆！');parent.location.href='"&HOPE_InstallDir&"';</SCRIPT>" 
              Response.End
   End If
  else
	  if session("globalecmaster")="" and  session("masterflag")="" then
              Response.write "<script language='javascript'>"
              Response.write"alert('对不起！请重新登陆！');parent.location.href='"&HOPE_InstallDir&"';</SCRIPT>" 
              Response.End
   End If
  if   session("masterflag")<>"" then 
  
  if numid<>"no" then 
  	
	 dim ishavegantadmin
	 ishavegantadmin=false
	 in_str=split(session("masterflag"),",")
	 for each ins in in_str 
	 if trim(ins)=numid  then 
	 ishavegantadmin=true 
	 end if
	 next 
	 if ishavegantadmin=false then 
	 if dir<>"no" then 
	 response.redirect dir
	 response.end
	 end if
	 end if
  end if
   
 end if
 
 end if

 ction=Replace_Text(request("Action"))
 UID=Replace_Text(Request("ID"))

Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM Websen_advertisement  where id=" & uid 
rs.open sql, conn, 1, 3
	if ction="Check" then
	 rs("isok")=0
   else
      rs("isok")=1
	end if
flog=rs("isok")
username=rs("user")	
adname=rs("adname")
rs.update
rs.close
set rs=nothing


Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="SELECT * FROM Websen_ad where ADID='"&adname &"'"
rs1.open sql1, conn, 1, 3
mark=rs1("ADMark")
rs1.update
rs1.close
set rs1=nothing

Set rs2 = Server.CreateObject("ADODB.Recordset")
sql2="SELECT * FROM Websen_corporation where [User]='"&username&"'"
rs2.open sql2, conn, 1, 3
rs2("mark")=rs2("mark")-mark
sd=rs2("mark")
rs2.update
rs2.close
set rs2=nothing

conn.Close
set conn=nothing

Response.Redirect "glist.asp"        
%>
