<%
 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
 
 if markct  then
 else
 Response.Write ("<script>alert('对不起，该功能未开通! 请在基本设置里开启积分功能');history.back();</script>")
 end if

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>COAD System</title>
<SCRIPT LANGUAGE="JavaScript">
function delad(){
if (confirm("确定要删除这则广告么?删除后不可以再恢复哦!?")){return true;}
return false;
}
</SCRIPT>
<link href="COAD.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>
<table width="98%" height="31" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#7EC1FE" bgcolor="#DEEEFE" class="border">
  <tr>
    <td width="445"><form name="formss" method="post" action="glist.asp" style="margin:0">
      &nbsp;<select name="modid" size="1" id="modid">
	   <option value="">所有模版</option>
      <%
		  set rst1=server.CreateObject("adodb.recordset")
		  rst1.open "select yx_tempname,id from [Websen_worldec_Temp] order by yx_selected desc,id desc",conn,1,1
		  Do While not rst1.eof
		  	if cstr(rst1("id"))=request("modid") then
		  		Response.Write "<option value="&rst1("id")&" selected>"&rst1("yx_tempname")&"</option>"
			else
				Response.Write "<option value="&rst1("id")&">"&rst1("yx_tempname")&"</option>"
			end if
		  	rst1.movenext
		  Loop
		  rst1.close
		  set rst1=nothing
		  %>
    </select>
      <label>
      <select name="pagename" id="pagename">
	  <option value="">所有页面</option>
        <option value="网站首页" <%if request("pagename")="网站首页" then response.write "selected"%>>网站首页</option>
        <option value="我要采购" <%if request("pagename")="我要采购" then response.write "selected"%>>我要采购</option>
        <option value="我要销售" <%if request("pagename")="我要销售" then response.write "selected"%>>我要销售</option>
        <option value="公司库" <%if request("pagename")="公司库" then response.write "selected"%>>公司库</option>
        <option value="产品库" <%if request("pagename")="产品库" then response.write "selected"%>>产品库</option>
        <option value="展会服务" <%if request("pagename")="展会服务" then response.write "selected"%>>展会服务</option>
        <option value="人才招聘" <%if request("pagename")="人才招聘" then response.write "selected"%>>人才招聘</option>
     <option value="商业资讯" <%if request("pagename")="商业资讯" then response.write "selected"%>>商业资讯</option> </select>
      </label>
      
        <label>
          <input name="isstop" type="checkbox" value="stop">
          未审核&nbsp;
        <input type="submit" name="Submit" value="查 询">
        </label>
      </form>
    </td>
   
  </tr>
</table>

<%
'Dim pagesize,rs,sql,curpage,strcate,i
'Dim id,ADID,ADViews,ADHits,ADType,ADSrc,ADLink,ADAlt,ADWidth,ADHeight,ADNote,ADStopViews,ADStopHits,ADStopDate

pagesize=10		'设置每页显示广告树目

If Request.QueryString("page")="" Then
  	curpage = 1
Else
	curpage = cint(Request.QueryString("page"))
End If

Set rs = Server.CreateObject("ADODB.Recordset")
dim adnote_a
adnote_a=request("adnote_a")
sql="SELECT * FROM [Websen_advertisement] Where id>0 "
if request("pagename")<>"" then sql=sql&" and which_page='"&request("pagename")&"'"
if Request("isstop")="stop" then sql=sql&" and isok='0'"
sql=sql&" ORDER BY id DESC"
'response.write sql
'response.end

rs.open sql, conn, 1, 1



If rs.bof or rs.eof Then
  
	rs.Close
	if Request.QueryString("action")="stop" Then
	%><br>
	<table width="98%" height="200" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
  <tr>
    <td align="center" bgcolor="f1f1f1"><font color="#990000">暂时没有用户兑换该广告位！</font></td>
  </tr>
</table>
	
	<br>
	<%
	End If

	Response.End
End If

rs.pagesize = pagesize
rs.absolutepage = curpage
%>
 <table width='98%' height="22" border=0 align=center cellpadding=0 cellspacing=0 bgcolor="#999999">
<tr>
  <td width="60" height="24" align="center" bgcolor="#7EC1FE"><a href="?page=<%=cstr(curpage)%>&pagesize=<%=pagesize%>&adnote_a=<%=adnote_a%>">[刷新]</a></td>
  <td width="700" height="22" align=right bgcolor="#7EC1FE">
      
      <%If curpage = 1 Then%>
      　    [首页] [上一页]                              
      <%Else%>
      [<a href='?page=1'>首页</a>] [<a href='?page=<%=cstr(curpage-1)%>'>上一页</a>]                              
      <%End If
      If  curpage = rs.pagecount Then%>
      [下一页] [尾页]                              
      <%Else%>
      [<a href='?page=<%=cstr(curpage+1)%>'>下一页</a>] [<a href='?page=<%=cstr(rs.pagecount)%>'>尾页</a>]&nbsp;                    
    <%End If%>  </td>
</tr>
</table>
      <table width='98%' border="0" align=center cellpadding=3 cellspacing=1 bgcolor="#CEE0FF">
        <% Do While NOT rs.eof 
		id=rs("id")
		ADID=rs("ADID")
		user=rs("user")
		ADType=rs("ADType")
		ADSrc=rs("ADSrc")
		ADLink=rs("ADLink")
		ADAlt=rs("ADAlt")
		ADSrc=rs("ADSrc")
		which_page=rs("which_page")
		ADwidth=rs("adwidth")
		ADHeight=rs("ADHeight")
		ADNote=rs("ADNote") 
		ADStopViews=rs("ADStopViews")
		ADname=rs("ADname")
		ADStopDate=rs("ADStopDate") %>
        <tr bgcolor="#c0c0c0"> 
          <td width="26%" height="25" bgcolor="#DEEEFE">广告名：<%=adname%> </td>
         
          <td width="24%" bgcolor="#DEEEFE">广告类型:<%=ShowAdType(ADType,rs("ADSrc"))%></td>
          <td width="50%" bgcolor="#DEEEFE">管理：
		  <%
		  If rs("isok")=1Then 
        response.write "<font color=blue>审核通过</font>&nbsp;&nbsp;"
      Else
        response.write "<a href='glistsave.asp?id="& rs("id") & "&action=CancelCheck'"  & "'" & ">未审核</a>&nbsp;&nbsp;"
      End If
	      %>
	  &nbsp;&nbsp;<a href="gdel.asp?id=<%=id%>" onclick='return delad();'>删除</a></td>
        </tr>
        <tr bgcolor="e6e6e6"> 
          <td height="25" colspan=2 bgcolor="#EEF7FF">会员名：<%=user%></td>
          <td colspan=2 bgcolor="#EEF7FF">广告所显示(图片等)地址：
          <%If ADType<>6 Then%><a href=<%=ADSrc%> target=_blank><font color="#000000"><%=ADSrc%></a><%else%>不显示<%end if%></td>
        </tr>
        <tr bgcolor="e6e6e6"> 
          <td colspan=2 height="25" bgcolor="#EEF7FF">所在页面：<a href=<%=which_page%> target=_blank><font color="#000000"><%=which_page%></a></td>
          <td colspan=2 bgcolor="#EEF7FF">广告规格：<%=ADWidth%>×<%=ADHeight%></td>
        </tr>
		<tr bgcolor="e6e6e6"> 
          <td colspan=2 height="25" bgcolor="#EEF7FF">链接地址：<a href=<%=ADLink%> target=_blank><font color="#000000"><%=ADLink%></a></td>
          <td colspan=2 bgcolor="#EEF7FF">提示文字：<%=ADAlt%></td>
        </tr>
		 <tr bgcolor="e6e6e6"> 
          <td colspan=4 height="25" bgcolor="#EEF7FF">备注：<%=ADNote%></td>
        </tr>
       
		<%
		if right(weburl,1)<>"/" then weburl=weburl&"/"
		'weburl2=left(weburl,len(weburl)-1)&HOPE_InstallDir
		%>
		<tr>
		  <td colspan=4 bgcolor="#FFFFFF">&nbsp;</td>
		</tr>
		<tr><td  bgcolor="#666666"  colspan="4" height="1"></td>
        <% 
        i=i+1
		rs.movenext
		If i>=rs.PageSize Then Exit Do     
		Loop
		%>
        <tr align="center" bgcolor="c0c0c0"> 
          <td height="25" colspan=6 bgcolor="#DEEEFE"> <center>  第<%=cstr(curpage)%>页　总<%=cstr(rs.pagecount)%>页　本页<%=cstr(i)%>条　总<%=cstr(rs.recordcount)%>条          
      
            <%If curpage = 1 Then%>
　&nbsp;&nbsp;<span class="STYLE1"><%=ADID%></span>    [首页] [上一页]
<%Else%>
[<a href='?page=1'>首页</a>] [<a href='?page=<%=cstr(curpage-1)%>'>上一页</a>]
<%End If
      If  curpage = rs.pagecount Then%>
[下一页] [尾页]
<%Else%>
[<a href='?page=<%=cstr(curpage+1)%>'>下一页</a>] [<a href='?page=<%=cstr(rs.pagecount)%>'>尾页</a>]&nbsp;
<%End If%></td>
        </tr>
</table>
      <br>
      <p></p>
</body>
</html>
<%
rs.close
set rs=nothing
conn.Close
set conn=nothing

'检测是否过期
function IsStop(ADViews,ADStopViews,ADStopHits,ADHits,ADStopDate)
	IsStop=false
	If ( ADStopViews <> 0 and ADViews > ADStopViews) Then 
		IsStop=true
		Exit function
	ElseIf ( ADStopHits <> 0 and ADHits > ADStopHits) Then
		IsStop=true
		Exit function
	ElseIf ( DateDiff("d",Now(),ADStopDate)<1 ) Then	
		IsStop=true
		Exit function
	End If
end function

'判断广告类型
function ShowAdType(ADType,ADSrc)
	Dim ADExt
	ADExt="图片"
	If InStr(1,ADSrc,".swf",1)>0 Then ADExt="FLASH"
	Select Case ADType
		Case 1
			ShowAdType="普通"&ADExt
		Case 2
			ShowAdType="全屏浮动"&ADExt
		Case 3
			ShowAdType="上下浮动 - 右"&ADExt
		Case 4
			ShowAdType="上下浮动 - 左"&ADExt
		Case 5
			ShowAdType="渐隐消失"&ADExt
		Case 6
			ShowAdType="网页对话框"
		Case 7
			ShowAdType="移动透明对话框"
		Case 8
			ShowAdType="打开新窗口"
		Case 9
			ShowAdType="弹出新窗口"
		Case 10 
			ShowAdType="对联式广告"
		Case else
			ShowAdType="<font color=red><b>错误!将不能正确显示</b>"
	End Select
end function
%>