<html>
<head>
<META content=ywnt,云网互动影视管理系统 name=keywords>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>云网互动影视6.0--广告管理</title>
<LINK href="css/css.css" type=text/css rel=stylesheet>
</head>
<BODY leftMargin=0 topMargin=0 scroll=yes MARGINHEIGHT="0" MARGINWIDTH="0">
<script language="JavaScript" src="YWNT_TMS_Inc/YWNT_TMS_Common.js"></script>
<script language="JavaScript" src="YWNT_TMS_Inc/Calendar.js"></script>
<!--#include file="../Conn.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Function.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Page.asp" -->
<%
'===================================================================================================================
'软件名称：云网影视管理系统
'Copyright (C) 2002-2007 ywnt.net  All rights reserved.
'产品咨询QQ：489234,2813712
'程序版权：云网互动科技有限公司
'程序开发：云网互动科技有限公司
'官方网站：http://www.ywnt.net 
'郑重声明:
'    1、免费版本请在程序首页保留版权信息，并做上本站LOGO友情连接,商业版本无此要求;
'    2、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    3、云网互动科技有限公司保留此软件的法律追究权利
'===================================================================================================================
Call CheckLogin("Ad")
sub EditSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Ad where ID="&NoSqlHack(Request.Form("ID"))
		Rs.open sql,Conn,1,3
		RS("AdName")=NoSqlHack(Request.Form("AdName"))
		RS("ADType")=NoSqlHack(Request.Form("ADType"))
		RS("ADSrc")=NoSqlHack(Request.Form("ADSrc"))
		RS("ADWidth")=NoSqlHack(Request.Form("ADWidth"))
		RS("ADHeight")=NoSqlHack(Request.Form("ADHeight"))
		RS("ADLink")=NoSqlHack(Request.Form("ADLink"))
		RS("ADAlt")=NoSqlHack(Request.Form("ADAlt"))
		RS("ADNote")=NoSqlHack(Request.Form("ADNote"))
		RS("ADStopViews")=NoSqlHack(Request.Form("ADStopViews"))
		RS("ADStopHits")=NoSqlHack(Request.Form("ADStopHits"))
		RS("ADStopDate")=NoSqlHack(Request.Form("ADStopDate"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("修改广告"&Request.Form("AdName"),9)
		call Admin_ShowErr("<li>广告修改成功</li>","Admin_Ad.asp",1)
		call connclose()
end sub
sub AddSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Ad"
		Rs.open sql,Conn,1,3
		Rs.addnew
		RS("AdName")=NoSqlHack(Request.Form("AdName"))
		RS("ADType")=NoSqlHack(Request.Form("ADType"))
		RS("ADSrc")=NoSqlHack(Request.Form("ADSrc"))
		RS("ADWidth")=NoSqlHack(Request.Form("ADWidth"))
		RS("ADHeight")=NoSqlHack(Request.Form("ADHeight"))
		RS("ADLink")=NoSqlHack(Request.Form("ADLink"))
		RS("ADAlt")=NoSqlHack(Request.Form("ADAlt"))
		RS("ADNote")=NoSqlHack(Request.Form("ADNote"))
		RS("ADStopViews")=NoSqlHack(Request.Form("ADStopViews"))
		RS("ADStopHits")=NoSqlHack(Request.Form("ADStopHits"))
		RS("ADStopDate")=NoSqlHack(Request.Form("ADStopDate"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("添加广告"&Request.Form("AdName"),9)
		call Admin_ShowErr("<li>广告添加成功</li>","Admin_Ad.asp",1)
		call connclose()
end sub
sub Del()
	conn.execute "delete from YWNT_TMS_Ad WHERE ID="&NoSqlHack(Request.QueryString("ID"))
	Call AddLog("删除广告",9)
	call Admin_ShowErr("<li>广告删除成功！</li>","Admin_Ad.asp",1)
	call connclose()
end sub%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>广告管理</td>
    </tr>
    <tr>
      <td class="hback"><a href="Admin_Ad.asp">管理首页</a> | <a href="Admin_Ad.asp?Action=stop">过期广告</a> | <a href="Admin_Ad.asp?Action=Add">添加广告</a></td>
    </tr>
  </tbody>
</table>
<% Action=Trim(request.QueryString("Action"))
Select Case Action
Case "Add"
	call Add()
Case "AddSave"
	call AddSave()
Case "Edit"
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Ad where ID="&NoSqlHack(Request.QueryString("ID"))
		Rs.open sql,Conn,1,1
		YWNT_TMS_ID=RS("ID")
		YWNT_TMS_AdName=RS("AdName")
		YWNT_TMS_ADType=RS("ADType")
		YWNT_TMS_ADSrc=RS("ADSrc")
		YWNT_TMS_ADWidth=RS("ADWidth")
		YWNT_TMS_ADHeight=RS("ADHeight")
		YWNT_TMS_ADLink=RS("ADLink")
		YWNT_TMS_ADAlt=RS("ADAlt")
		YWNT_TMS_ADNote=RS("ADNote")
		YWNT_TMS_ADStopViews=RS("ADStopViews")
		YWNT_TMS_ADStopHits=RS("ADStopHits")
		YWNT_TMS_ADStopDate=RS("ADStopDate")
		RS.close   
      	set RS=nothing
		call connclose()
	call Edit()
Case "EditSave"
	call EditSave()
Case "Del"
	call Del()
Case else
	call List()
End Select
sub List()
Dim int_RPP
	int_RPP=GetConfig("PageNumber") '设置每页显示数目%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td width="5%" align="center" class=xingmu>ID</td>
      <td align="center" class=xingmu>标题</td>
      <td width="15%" align="center" class=xingmu>广告类型</td>
      <td width="10%" align="center" class=xingmu>显示</td>
      <td width="10%" align="center" class=xingmu>点击</td>
      <td width="12%" align="center" class=xingmu>到期时间</td>
      <td width="10%" align="center" class=xingmu>操作</td>
    </tr>
		<%Set Rs = server.CreateObject(YWNT_TMS_RS)
		sql="SELECT ID,AdName,ADType,ADSrc,ADViews,ADStopViews,ADStopHits,ADHits,ADStopDate FROM YWNT_TMS_Ad"
		if Request.QueryString("action")="stop" then
		sql=sql&" where ( ADStopViews <> 0 and ADViews > ADStopViews) or ( ADStopHits <> 0 and ADHits > ADStopHits) or ( DateDiff("&DayStr&","&SqlNow&",ADStopDate)<1 ) ORDER BY id DESC"
		else
		sql=sql&" ORDER BY id DESC"
		end if
		Rs.open sql,Conn,1,1
		if RS.eof then
		Response.Write"<tr><td colspan=""9"" height=40 class=""hback"">没有广告</td></tr>"
		else
		Rs.PageSize=int_RPP
		cPageNo=NoSqlHack(Request.QueryString("Page"))
		If cPageNo="" Then cPageNo = 1
		If not isnumeric(cPageNo) Then cPageNo = 1
		cPageNo = Clng(cPageNo)
		If cPageNo>Rs.PageCount Then cPageNo=Rs.PageCount 
		If cPageNo<=0 Then cPageNo=1
		Rs.AbsolutePage=cPageNo 
		for i=1 to int_RPP
	 	if Rs.eof Then exit For%>
    <tr>
      <td height=32 align="center" class="hback"><%=RS("ID")%></td>
      <td height=32 class="hback"><%=RS("AdName")%><%if IsStop(RS("ADViews"),RS("ADStopViews"),RS("ADStopHits"),RS("ADHits"),RS("ADStopDate")) Then Response.Write(" <font color=red>(已过期)</font>") End If%></td>
      <td height=32 align="center" class="hback"><%=ShowAdType(RS("ADType"),RS("ADSrc"))%></td>
      <td height=32 align="center" class="hback"><%=RS("ADViews")%></td>
      <td height=32 align="center" class="hback"><%=RS("ADHits")%></td>
      <td height=32 align="center" class="hback"><%=RS("ADStopDate")%></td>
      <td align="center" class="hback"><A href="Admin_Ad.asp?Action=Edit&ID=<%=RS("ID")%>">修改</A>｜<A href="Admin_Ad.asp?Action=Del&ID=<%=RS("ID")%>">删除</A></td>
    </tr>
	<%Rs.MoveNext
	next 
	end if%>
	<tr align="right">
    <td height=32 colspan="9" class="hback"><% response.Write fPageCount(Rs,cPageNo) %></td>
	</tr>
	<%RS.close     
	set RS=nothing%>
  </tbody>
</table>
<%call connclose()
end sub
sub Add()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <form name="form" action="Admin_Ad.asp?Action=AddSave" method="post">
    <tbody>
      <tr>
        <td colspan="2" class=xingmu>广告添加</td>
      </tr>
      <tr>
        <td width="21%" height=32 align="right" class="hback">广告标题：</td>
        <td height=7 class="hback"><input name="ADName" type="text" id="ADName" size="40"></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告类型：</td>
        <td height=7 class="hback"><select size="1" name="ADType" onChange="ChangeType(this.options[this.selectedIndex].value)">
            <option selected value="1">普通显示</option>
            <option value="2">满屏浮动显示</option>
            <option value="3">上下浮动显示-右</option>
            <option value="4">上下浮动显示-左</option>
            <option value="5">全屏幕渐隐消失</option>
            <option value="6">普通网页对话框 </option>
            <option value="7">可移动透明对话框 </option>
            <option value="8">打开新窗口</option>
            <option value="9">弹出新窗口</option>
            <option value="10">对联式广告</option>
        </select></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback" id="adsrc_text">广告地址：</td>
        <td height=7 class="hback"><INPUT name=ADSrc id=ADSrc value="http://" size="40">
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告规格：</td>
        <td height=7 class="hback"><INPUT name=ADWidth id=ADWidth value="480" size="5">
          ×
            <INPUT name=ADHeight id=ADHeight value="60" size=5></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">链接地址：</td>
        <td height=7 class="hback"><INPUT id=ADLink size=40 name=ADLink>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">提示文字：</td>
        <td height=7 class="hback"><INPUT id=ADAlt size=40 name=ADAlt>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">显示次数：</td>
        <td height=7 class="hback"><INPUT name=ADStopViews id=ADStopViews value="0" size=40>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">点击次数：</td>
        <td height=7 class="hback"><INPUT name=ADStopHits id=ADStopHits value="0" size=40>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">到期时间：</td>
        <td height=16 class="hback"><INPUT id=ADStopDate onfocus=setday(this) readOnly value="<%=year(date())%>-<%=month(date())+1%>-<%=day(date())%>" name=ADStopDate maskType="longDate" realValue="">
            <IMG onclick=ADStopDate.focus() src="images/calendar.gif" align=absBottom></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告备注：</td>
        <td height=16 class="hback"><textarea name="ADNote" cols="40" rows="5"></textarea></td>
      </tr>
      <tr>
        <td height=32 colspan="2" align="center" class="hback"><input type="submit" name="Submit" value="添 加"></td>
      </tr>
    </tbody>
  </form>
</table>
<%end sub
sub Edit()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <form name="form" action="Admin_Ad.asp?Action=EditSave" method="post">
    <tbody>
      <tr>
        <td colspan="2" class=xingmu>广告修改</td>
      </tr>
      <tr>
        <td width="21%" height=32 align="right" class="hback">广告标题：</td>
        <td height=7 class="hback"><input name="ADName" type="text" id="ADName" size="40" value="<%= YWNT_TMS_ADName %>"></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告类型：</td>
        <td height=7 class="hback"><select size="1" name="ADType" onChange="ChangeType(this.options[this.selectedIndex].value)">
            <option <%IF YWNT_TMS_ADType=1 THEN Response.Write"selected"%> value="1">普通显示</option>
            <option <%IF YWNT_TMS_ADType=2 THEN Response.Write"selected"%> value="2">满屏浮动显示</option>
            <option <%IF YWNT_TMS_ADType=3 THEN Response.Write"selected"%> value="3">上下浮动显示-右</option>
            <option <%IF YWNT_TMS_ADType=4 THEN Response.Write"selected"%> value="4">上下浮动显示-左</option>
            <option <%IF YWNT_TMS_ADType=5 THEN Response.Write"selected"%> value="5">全屏幕渐隐消失</option>
            <option <%IF YWNT_TMS_ADType=6 THEN Response.Write"selected"%> value="6">普通网页对话框 </option>
            <option <%IF YWNT_TMS_ADType=7 THEN Response.Write"selected"%> value="7">可移动透明对话框 </option>
            <option <%IF YWNT_TMS_ADType=8 THEN Response.Write"selected"%> value="8">打开新窗口</option>
            <option <%IF YWNT_TMS_ADType=9 THEN Response.Write"selected"%> value="9">弹出新窗口</option>
            <option <%IF YWNT_TMS_ADType=10 THEN Response.Write"selected"%> value="10">对联式广告</option>
        </select></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback" id="adsrc_text">广告地址：</td>
        <td height=7 class="hback"><INPUT name="ADSrc" id="ADSrc" value="<%= YWNT_TMS_ADSrc %>" size="40">
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告规格：</td>
        <td height=7 class="hback"><INPUT name="ADWidth" id="ADWidth" value="<%= YWNT_TMS_ADWidth %>" size="5" >
          ×
            <INPUT name=ADHeight id=ADHeight value="<%= YWNT_TMS_ADHeight %>" size=5></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">链接地址：</td>
        <td height=7 class="hback"><INPUT id=ADLink size=40 name=ADLink value="<%= YWNT_TMS_ADLink %>">
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">提示文字：</td>
        <td height=7 class="hback"><INPUT id=ADAlt size=40 name=ADAlt value="<%= YWNT_TMS_ADAlt %>">
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">显示次数：</td>
        <td height=7 class="hback"><INPUT name=ADStopViews id=ADStopViews value="<%= YWNT_TMS_ADStopViews %>" size=40>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">点击次数：</td>
        <td height=7 class="hback"><INPUT name=ADStopHits id=ADStopHits value="<%= YWNT_TMS_ADStopHits %>" size=40>
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">到期时间：</td>
        <td height=16 class="hback"><INPUT id=ADStopDate onfocus=setday(this) readOnly value="<%=YWNT_TMS_ADStopDate%>" name=ADStopDate maskType="longDate" realValue="">
            <IMG onclick=ADStopDate.focus() src="images/calendar.gif" align=absBottom></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">广告备注：</td>
        <td height=16 class="hback"><textarea name="ADNote" cols="40" rows="5"><%=YWNT_TMS_ADNote%></textarea></td>
      </tr>
      <tr>
        <td height=32 colspan="2" align="center" class="hback"><input name="ID" type="hidden" value="<%= YWNT_TMS_ID %>"><input type="submit" name="Submit" value="修 改"></td>
      </tr>
    </tbody>
  </form>
</table>
<%end sub%>
</BODY></HTML>
