<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<%
'*********************************************
'软件名称：博科企业网站内容管理系统（BOKECMS）
'软件开发：博科网络科技工作室
'网    址：http://www.bokew.net
'服务  QQ：530051328
'服务邮箱：bbfhq@163.com
'微信公众号：bokewlkj
'*********************************************
%>
<%
Call SiteInfo()
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%=Bokecms_Lang_Copyright(13)%>">
<meta name="author" content="<%=Bokecms_Lang_Copyright(3)%>">
<title><%=Bokecms_Lang_Copyright(1)%> <%=Soft_Version%></title>

<SCRIPT LANGUAGE="JavaScript">
function delad(){
if (confirm("删除广告将同时删除相关图片和JS代码，不可以恢复，确认删除吗？")){return true;}
return false;
}
</SCRIPT>

<!--#Include file="BokeCMS_Css.Asp"-->
</head>
<body>
<!--#Include file="BokeCMS_Top.Asp"-->
<!--#Include file="BokeCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|15,") = 0 Then
		response.Write ("<br /><br /><div style='height:100%; text-align:center' class='main'><font style=""color:red; font-size:14px;"")>"&Bokecms_Lang_System(26)&"</font></div>")
		response.End
	End If
	%>
    <div class="main">
        <div class="row ">
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i> 当前位置</li>
             	<li>标准广告</li>
                <li class="active">标准广告列表</li>
            </ol>	
        </div>
        <div class="row">
            <div class="col-lg-12 hideInIE8">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2><i class="fa fa-edit"></i><span class="break"></span>标准广告管理</h2> 
                    </div>
                    <div class="panel-body">
                       <a class="ShortCut2" href="BokeCMS_ad_list.asp">  
                            <i class="fa fa-list"></i>
                            <div class="title">标准广告列表</div>
                        </a>
                           <a class="ShortCut2" href="BokeCMS_ad_ad.Asp">  
                            <i class="fa fa-list"></i>
                            <div class="title">默认广告列表</div> 
							</a>
                       <a class="ShortCut2" href="BokeCMS_ad_list.asp?action=stop&all=ok">  
                            <i class="fa fa-list"></i>
                            <div class="title">到期广告列表</div>
                        </a>
                       <a class="ShortCut2" href="BokeCMS_ad_createjs_all.asp">  
                            <i class="fa fa-list"></i>
                            <div class="title">一键生成所有广告代码</div>
                        </a>							
 			              <a class="ShortCut2" href="BokeCMS_ad_inout.asp">  
                            <i class="fa fa-list"></i>
                            <div class="title">导出广告</div>
                        </a>
                       <a class="ShortCut2" href="BokeCMS_ad_inout.asp">  
                            <i class="fa fa-list"></i>
                            <div class="title">导入广告</div>
                        </a>
                    </div>
                </div>
            </div>
        </div>	
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div data-original-title="" class="panel-heading">
                        <h2><i class="fa fa-user"></i><span class="break"></span>标准广告列表</h2>
                    </div>
                    <div class="panel-body">
                        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline no-footer">
                        	<input type="hidden" name="Result" value="About">
                            <table id="datatable" class="table table-striped table-bordered bootstrap-datatable" cellspacing="0" width="100%">
                            <thead>
                            <tr role="row">                                
                                <th>广告ID</th>
                                <th>状态</th>
                                <th>投放位置</th>
                                <th>规格</th>                                
								<th>类型</th>
								<th>修改</th>
								<th>效果</th>
                            </tr>
                            </thead>
                            <tbody>
								<%Call AboutList()%>
                            </tbody>
                            </table>
                        </div>            
                    </div>
                </div>
            </div>
        </div>
    </div>

	<!--#Include file="BokeCMS_End.Asp"-->
</div>

</body>



<%
Function AboutList()
Dim Rsgg,Data,dbpath,rsc,ADhost,ADhost1,ADhost2,ADhost3,ADhost4,ADhost5,ADhost6,ADhost7,ADhost8,ADhost9
Dim pagesize,curpage,strcate,skin
Dim ADID,ADViews,ADHits,ADType,ADSrc,ADLink,ADAlt,ADWidth,ADHeight,ADNote,ADStopViews,ADStopHits,ADStopDate,IsSys,adkg
   dim i
   i=0 
	datafrom = "BokeCMS_ad"
	taxis = "Order by ID"
	if Request.QueryString("action")="stop" then
		sql = "SELECT * FROM ["& datafrom &"] where ( ADStopViews <> 0 and ADViews > ADStopViews) or ( ADStopHits <> 0 and ADHits > ADStopHits) or ( DateDiff("&bk_DatePart_D&","&bk_Now&",ADStopDate)<1 ) "&taxis
	Else
	sql = "select * from ["& datafrom &"] where ADID<>'' "&taxis
	End if
	set rs = server.createobject("adodb.recordset")
	rs.open sql,conn,1,2
	if rs.eof And rs.bof then
    response.write "<p align='center'>数据库中暂时无数据</p>"
    end if
	do until rs.eof

		id=rs("id")
		ADID=rs("ADID")
		ADViews=rs("ADViews")
		ADHits=rs("ADHits")
		ADType=rs("ADType")
		ADSrc=rs("ADSrc")
		ADLink=rs("ADLink")
		ADAlt=rs("ADAlt")		
		ADWidth=rs("ADWidth")
		ADHeight=rs("ADHeight")
		ADNote=rs("ADNote") 
		ADStopViews=rs("ADStopViews")
		ADStopHits=rs("ADStopHits")
		ADStopDate=rs("ADStopDate")
		IsSys=rs("IsSys")
		adkg=rs("adkg")
ADhost=rs("Advertisement_host")
ADhost=split(ADhost,"|")
ADhost1=ADhost(0)
ADhost2=ADhost(1)
ADhost3=ADhost(2)
ADhost4=ADhost(3)
ADhost5=ADhost(4)
ADhost6=ADhost(5)
ADhost7=ADhost(6)
ADhost8=ADhost(7)
ADhost9=ADhost(8)

		Response.Write "<tr role='row'>" & vbCrLf			
		Response.Write "<td>"&ADID&"</td>" & vbCrLf	
		If rs("adkg") Then
			Response.Write "<td><a href='BokeCMS_ad_createjs.asp?ad=zt&ADID="&ADID&"&url=BokeCMS_ad_ad.Asp&page="&request("page")&"'><span class='label label-success'>显 示</span></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='BokeCMS_ad_createjs.asp?ad=hd&ADID="&ADID&"&url=BokeCMS_ad_ad.Asp&page="&request("page")&"'><span class='label label-warning'>不显示</span></a></td>" & vbCrLf
		End If
		Response.Write "<td width='250'>"&ADNote&"</td>" & vbCrLf
        Response.Write "<td>"&ADWidth&"×"&ADHeight&"</td>" & vbCrLf
		Response.Write "<td>"&ShowAdType(ADType,5)&"</td>" & vbCrLf
		Response.Write "<td width='100'><a href='BokeCMS_ad_edit.asp?adid="&adid&"&Result=Modify'>修改</a></td>" & vbCrLf		
		Response.Write "<td> <script src='/ads/JS/"&rs("ADID")&".js'></script></td>" & vbCrLf
	
		rs.movenext
	Loop
	Response.Write "</table>"
End Function
%>
<%'检测是否过期
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 11 
			ShowAdType="对联式广告（浮动）"	
        Case 12 
			ShowAdType="走马灯文字广告"
        Case 13 
			ShowAdType="普通文字广告"
        Case 14 
			ShowAdType="自写代码广告"
        Case 15 
			ShowAdType="Flash图片广告"
        Case 16 
			ShowAdType="视频广告"				
		Case else
			ShowAdType="<font color=red><b>错误!将不能正确显示</b>"
	End Select
end function
%>