ADsList.asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:12k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <% Option Explicit %>
  3. <HTML xmlns="http://www.w3.org/1999/xhtml">
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
  6. <META NAME="copyright" CONTENT="Copyright 2004-2008 - wygk.cn-网域高科-公司企业网站管理系统" />
  7. <META NAME="Author" CONTENT="网域高科-公司企业网站管理系统-wygk.cn" />
  8. <META NAME="Keywords" CONTENT="" />
  9. <META NAME="Description" CONTENT="" />
  10. <TITLE>弹窗广告列表</TITLE>
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. </HEAD>
  14. <!--#include file="../Include/Const.asp" -->
  15. <!--#include file="../Include/ConnSiteData.asp" -->
  16. <!--#include file="CheckAdmin.asp"-->
  17. <BODY>
  18. <%
  19. dim Result,StartDate,EndDate,Keyword
  20. Result=request.QueryString("Result")
  21. StartDate=request.QueryString("StartDate")
  22. EndDate=request.QueryString("EndDate")
  23. Keyword=request.QueryString("Keyword")
  24. function PlaceFlag()
  25.   if Result="Search" then
  26.     Response.Write "广告:列表&nbsp;->&nbsp;检索&nbsp;->&nbsp;添加时间[<font color='red'>"&StartDate&"至"&EndDate&"</font>],关键字[<font color='red'>"&Keyword&"</font>]"
  27.   else
  28.     Response.Write "广告:列表&nbsp;->&nbsp全部"
  29.   end if
  30. end function  
  31. %>
  32. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  33.   <tr>
  34.     <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle">&nbsp;<strong>弹窗广告:添加,修改弹窗广告相关的内容</strong></font></td>
  35.   </tr>
  36.   <tr>
  37.     <td height="36" align="center" nowrap  bgcolor="#eafefe"><table width="100%" border="0" cellspacing="0">
  38.       <tr>
  39.         <form name="formSearch" method="post" action="Search.asp?Result=ADs">
  40.           <td nowrap> 广告检索:从
  41.           <script language=javascript> 
  42.           var myDate=new dateSelector(); 
  43.           myDate.year--; 
  44.   myDate.date; 
  45.           myDate.inputName='start_date';  //注意这里设置输入框的name,同一页中日期输入框,不能出现重复的name。 
  46.           myDate.display(); 
  47.           </script>
  48.           &nbsp;到
  49.           <script language=javascript> 
  50.           myDate.year++; 
  51.           myDate.inputName='end_date';  //注意这里设置输入框的name,同一页中的日期输入框,不能出现重复的name。 
  52.           myDate.display(); 
  53.           </script>
  54.           &nbsp;&nbsp;关键字:<input name="Keyword" type="text" class="textfield" value="<%=Keyword%>" size="18">
  55.           <input name="submitSearch" type="submit" class="button" value="检索">
  56.           </td>
  57.         </form>
  58.         <td align="right" nowrap><a href="ADsList.asp" onClick='changeAdminFlag("弹窗广告列表")'>弹窗广告列表</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="ADsEdit.asp?Result=Add" onClick='changeAdminFlag("添加弹窗广告")'>添加弹窗广告</a></td>
  59.       </tr>
  60.     </table>      </td>    
  61.   </tr>
  62. </table>
  63. <table width="100%" border="0" cellspacing="1" cellpadding="0">
  64.   <tr>
  65.     <td height="30"><%PlaceFlag()%></td>
  66.   </tr>
  67. </table>
  68. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  69.   <form action="DelContent.asp?Result=ADs" method="post" name="formDel" >
  70.   <tr>
  71.     <td width="30" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>ID</strong></font></td>
  72.     <td width="18" height="24" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>中</strong></font></td>
  73.     <td width="18" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">英</font></strong></td>
  74.     <td nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>弹窗广告标题</strong></font></td>
  75.     <td width="120" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>弹窗尺寸</strong>(像素)</font></td>
  76.     <td width="128" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">发布时间</font></strong></td>
  77.     <td width="52" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">查看次数</font></strong></td>
  78.     <td colspan="2" width="76" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">操作</font></strong>
  79.       <input onClick="CheckAll(this.form)" name="buttonAllSelect" type="button" class="button"  id="submitAllSelect" value="全" style="HEIGHT: 18px;WIDTH: 16px;">
  80.       <input onClick="CheckOthers(this.form)" name="buttonOtherSelect" type="button" class="button"  id="submitOtherSelect" value="反" style="HEIGHT: 18px;WIDTH: 16px;"> </td>
  81.   </tr>
  82.   <% ADsList() %>
  83.   </form>
  84. </table>
  85. </BODY>
  86. </HTML>
  87. <%
  88. '-----------------------------------------------------------
  89. function ADsList()
  90.   dim idCount'记录总数
  91.   dim pages'每页条数
  92.       pages=20
  93.   dim pagec'总页数
  94.   dim page'页码
  95.       page=clng(request("Page"))
  96.   dim pagenc'每页显示的分页页码数量=pagenc*2+1
  97.       pagenc=2
  98.   dim pagenmax'每页显示的分页的最大页码
  99.   dim pagenmin'每页显示的分页的最小页码
  100.   dim datafrom'数据表名
  101.       datafrom="Wygkcnflash_ADs"
  102.   dim datawhere'数据条件
  103.       if Result="Search" then
  104.      datawhere="where ( ADsNameCh like '%" & Keyword &_
  105.            "%') and AddTime >= #" & StartDate & " # and AddTime <= #" & EndDate & "#"
  106.   else
  107.         datawhere=""
  108.   end if
  109.   dim sqlid'本页需要用到的id
  110.   dim Myself,PATH_INFO,QUERY_STRING'本页地址和参数
  111.       PATH_INFO = request.servervariables("PATH_INFO")
  112.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  113.       if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  114.     Myself = PATH_INFO & "?"
  115.   else
  116.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  117.   end if
  118.   dim taxis'排序的语句 asc,desc
  119.       taxis="order by id desc"
  120.   dim i'用于循环的整数
  121.   dim rs,sql'sql语句
  122.   '获取记录总数
  123.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  124.   set rs=server.createobject("adodb.recordset")
  125.   rs.open sql,conn,0,1
  126.   idCount=rs("idCount")
  127.   '获取记录总数
  128.  
  129.   if(idcount>0) then'如果记录总数=0,则不处理
  130.     if(idcount mod pages=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
  131.   pagec=int(idcount/pages)'获取总页数
  132.     else
  133.       pagec=int(idcount/pages)+1'获取总页数
  134.     end if
  135. '获取本页需要用到的id============================================
  136.     '读取所有记录的id数值,因为只有id所以速度很快
  137.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  138.     set rs=server.createobject("adodb.recordset")
  139.     rs.open sql,conn,1,1
  140.     rs.pagesize = pages '每页显示记录数
  141.     if page < 1 then page = 1
  142.     if page > pagec then page = pagec
  143.     if pagec > 0 then rs.absolutepage = page  
  144.     for i=1 to rs.pagesize
  145.   if rs.eof then exit for  
  146.   if(i=1)then
  147.     sqlid=rs("id")
  148.   else
  149.     sqlid=sqlid &","&rs("id")
  150.   end if
  151.   rs.movenext
  152.     next
  153.   '获取本页需要用到的id结束============================================
  154.   end if
  155. '-----------------------------------------------------------
  156. '-----------------------------------------------------------
  157.   if(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
  158.     '用in刷选本页所语言的数据,仅读取本页所需的数据,所以速度快
  159.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  160.     set rs=server.createobject("adodb.recordset")
  161.     rs.open sql,conn,0,1
  162.     while(not rs.eof)'填充数据到表格
  163.   Response.Write "<tr bgcolor='#eafefe' onMouseOver = ""this.style.backgroundColor = '#FFFFFF'"" onMouseOut = ""this.style.backgroundColor = ''"" style='cursor:hand'>" & vbCrLf
  164.       Response.Write "<td nowrap>"&rs("ID")&"</td>" & vbCrLf
  165.       if rs("ViewFlagCh") then
  166.         Response.Write "<td nowrap><font color='green'>√</font></td>" & vbCrLf
  167.       else
  168.         Response.Write "<td nowrap><font color='red'>×</font></td>" & vbCrLf
  169.   end if
  170.   
  171.       if rs("ViewFlagEn") then
  172.         Response.Write "<td nowrap><font color='green'>√</font></td>" & vbCrLf
  173.       else
  174.         Response.Write "<td nowrap><font color='red'>×</font></td>" & vbCrLf
  175.   end if
  176.   if StrLen((rs("ADsNameCh")))>51 then
  177.         Response.Write "<td nowrap>"&StrLeft(rs("ADsNameCh"),48)&"</td>" & vbCrLf
  178.       else
  179.         Response.Write "<td nowrap>"&rs("ADsNameCh")&"</td>" & vbCrLf
  180.       end if 
  181.       Response.Write "<td nowrap>"&rs("ADsWidth")&"×"&rs("ADsHeight")&"&nbsp;px</td>" & vbCrLf
  182.       Response.Write "<td nowrap>"&rs("AddTime")&"</td>" & vbCrLf
  183.       Response.Write "<td nowrap>"&rs("ClickNumber")&"</td>" & vbCrLf
  184.       Response.Write "<td width='60' nowrap><a href='ADsEdit.asp?Result=Modify&ID="&rs("ID")&"' onClick='changeAdminFlag(""修改弹窗广告"")'><font color='#330099'>修改</font></a></td>" & vbCrLf
  185.       Response.Write "<td width='14' nowrap><input name='selectID' type='checkbox' value='"&rs("ID")&"' style='HEIGHT: 13px;WIDTH: 13px;'></td>" & vbCrLf
  186.       Response.Write "</tr>" & vbCrLf
  187.   rs.movenext
  188.     wend
  189.     Response.Write "<tr>" & vbCrLf
  190.     Response.Write "<td colspan='8' nowrap  bgcolor='#eafefe'>&nbsp;</td>" & vbCrLf
  191.     Response.Write "<td colspan='2' nowrap  bgcolor='#eafefe'><input name='submitDelSelect' type='button' class='button'  id='submitDelSelect' value='删除所选' onClick='ConfirmDel(""您真的要删除这些弹窗广告吗?"");'></td>" & vbCrLf
  192.     Response.Write "</tr>" & vbCrLf
  193.   else
  194.     response.write "<tr><td height='50' align='center' colspan='10' nowrap  bgcolor='#eafefe'>暂无弹窗广告</td></tr>"
  195.   end if
  196. '-----------------------------------------------------------
  197. '-----------------------------------------------------------
  198.   Response.Write "<tr>" & vbCrLf
  199.   Response.Write "<td colspan='10' nowrap  bgcolor='#bbe5e5'>" & vbCrLf
  200.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  201.   Response.Write "<tr>" & vbCrLf
  202.   Response.Write "<td>共计:<font color='#ff6600'>"&idcount&"</font>条记录&nbsp;页次:<font color='#ff6600'>"&page&"</font></strong>/"&pagec&"&nbsp;每页:<font color='#ff6600'>"&pages&"</font>条</td>" & vbCrLf
  203.   Response.Write "<td align='right'>" & vbCrLf
  204.   '设置分页页码开始===============================
  205.   pagenmin=page-pagenc '计算页码开始值
  206.   pagenmax=page+pagenc '计算页码结束值
  207.   if(pagenmin<1) then pagenmin=1 '如果页码开始值小于1则=1
  208.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>9</font></a>&nbsp;") '如果页码大于1则显示(第一页)
  209.   if(pagenmin>1) then response.write ("<a href='"& myself &"Page="& page-(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>7</font></a>&nbsp;") '如果页码开始值大于1则显示(更前)
  210.   if(pagenmax>pagec) then pagenmax=pagec '如果页码结束值大于总页数,则=总页数
  211.   for i = pagenmin to pagenmax'循环输出页码
  212. if(i=page) then
  213.   response.write ("&nbsp;<font color='#ff6600'>"& i &"</font>&nbsp;")
  214. else
  215.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  216. end if
  217.   next
  218.   if(pagenmax<pagec) then response.write ("&nbsp;<a href='"& myself &"Page="& page+(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>8</font></a>&nbsp;") '如果页码结束值小于总页数则显示(更后)
  219.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>:</font></a>&nbsp;") '如果页码小于总页数则显示(最后页)
  220.   '设置分页页码结束===============================
  221.   Response.Write "跳到:第&nbsp;<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/D/.test(this.value)){alert('只能在跳转目标页框内输入整数!');this.value='"&Page&"';}"" style='HEIGHT: 18px;WIDTH: 40px;'  type='text' class='textfield' value='"&Page&"'>&nbsp;页" & vbCrLf
  222.   Response.Write "<input style='HEIGHT: 18px;WIDTH: 20px;' name='submitSkip' type='button' class='button' onClick='GoPage("""&Myself&""")' value='GO'>" & vbCrLf
  223.   Response.Write "</td>" & vbCrLf
  224.   Response.Write "</tr>" & vbCrLf
  225.   Response.Write "</table>" & vbCrLf
  226.   rs.close
  227.   set rs=nothing
  228.   Response.Write "</td>" & vbCrLf  
  229.   Response.Write "</tr>" & vbCrLf
  230. '-----------------------------------------------------------
  231. '-----------------------------------------------------------
  232. end function 
  233. %>