list.asp

来自「新闻发布系统」· ASP 代码 · 共 346 行

ASP
346
字号
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file=config.asp -->
<!--#include file="check.asp"-->
<html><head>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<meta http-equiv=Pragma content=no-cache>
<link href=../Fsmanage/css/css.css rel=STYLESHEET type=text/css>
<title>广告发布管理系统</title>
</script>

</head><body marginwidth=0 marginheight=0>


<div align=center><center>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <!--#include file=menu.asp -->
    </td>
  </tr>
</table>
<table width=98% border=0 align="center" cellpadding=0 cellspacing=0 bgcolor=#BBB3AA>
  <tr bgcolor=#ffffff align=center valign=top> 
    <td> <table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor="#7ED3A7">
        <tr> 
          <td height="54" align=center bgcolor="#F7FFF4"> 
            <%
if request.querystring("type")="openp" then
%>
            <font color=red><b>黄金广告位置正常播放的广告条列表</b></font> 
            <%
elseif request.querystring("type")="opens" then
%>
            <font color=red><b>一般广告位置正常播放的广告条列表</b></font> 
            <%
elseif request.querystring("type")="close" then
%>
            <font color=red><b>被管理员暂停而未失效的广告条列表</b></font> 
            <%
elseif request.querystring("type")="lose" then
%>
            <font color=red><b>已经失效的的广告条列表</b></font> 
            <%
elseif request.querystring("type")="top" then
%>
            <font color=red><b>TOP 20 条广告点击龙虎榜(不含失效广告)</b></font> TOP20 是指前 20 
            名,由于一些广告条点击数相同,只能算一名,所以条数可能不止 20 条。 
            <%
elseif request.querystring("type")="end" then
%>
            <font color=red><b>点击率最低的 20 条广告(不含失效广告)</b></font>TOP20 是指前 20 名,由于一些广告条点击数相同,只能算一名,所以条数可能不止 
            20 条。 
            <%
else
%>
            <font color=red><b>所有正常播放的广告条列表</b></font> 
            <%
adssql="select * from ads where act=1 order by id"
end if
%>
          </td>
        </tr>
      </table>
      <table border=0 width=100% cellspacing="1" cellpadding=3 bgcolor=#000000>
        <%

adsconn.Open adsdata
dim MaxPerPage,adssql,adsrs,totalPut,CurrentPage,TotalPages,i,advlistact
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set adsrs=server.createobject("adodb.recordset")





if request.querystring("type")="openp" then
adssql="select * from ads where act=1 and place=1 order by regtime"


elseif request.querystring("type")="opens" then
adssql="select * from ads where act=1 and place=0 order by regtime"

elseif request.querystring("type")="close" then
adssql="select * from ads where act=0 order by regtime"

elseif request.querystring("type")="lose" then
adssql="select * from ads where act=2 order by regtime"

elseif request.querystring("type")="top" then
adssql="select top 20 * from ads where act<>2 order by click desc"

elseif request.querystring("type")="end" then
adssql="select top 20 * from ads where act<>2 order by click"

else
adssql="select * from ads where act=1 order by regtime"
end if

adsrs.open adssql,adsconn,1,1
if adsrs.eof and adsrs.bof then
response.write "没有记录"
else
adsrs.pagesize=advertlistnumber'每页显示的记录数
totalPut=adsrs.recordcount '记录总数
totalPage=adsrs.pagecount
MaxPerPage=adsrs.pagesize
if currentpage<1 then
currentpage=1
end if
if currentpage>totalPage then
currentpage=totalPage
end if
if currentPage=1 then
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
adsrs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=adsrs.bookmark '移动到开始显示的记录位置
showContent
showpages
end if
end if
adsrs.close
set adsrs=nothing
end if
adsconn.close
set adsconn=nothing

%>
      </table></td>
  </tr>
</table>
<%

sub showContent
i=0
do while not (adsrs.eof or err)
dim getdiftime
getdiftime=datediff("d",date,adsrs("lasttime"))
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr bgcolor="#95B8DB" > 
    <td colspan="3"> 
      <div align="center">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" background="../Fsmanage/images/bg1.gif">
          <tr> 
            <td height="26"> <div align="center"><b>ID:<%=adsrs("id")%> </b></div></td>
          </tr>
        </table>
      </div></td>
  </tr>
  <tr> 
    <td colspan="3" height="137"> <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#7ED3A7">
        <tr bgcolor="#Ffffff"> 
          <td width="160" height="17"><font color="#FF0000">广告(站点)名称:</font></td>
          <td width="229" height="17"><a href=<%=adsrs("url")%> target=_blank><%=adsrs("sitename")%></a></td>
          <td width="116" height="17"><font color="#FF0000">站点URL:</font></td>
          <td width="210" height="17"><%=adsrs("url")%></td>
        </tr>
        <tr bgcolor="#F7FFF4"> 
          <td width="128"><font color="#FF0000">广告位种类:</font></td>
          <td width="229"><b><%=adsrs("price")%></b></td>
          <td width="116"><font color="#FF0000">广告位:</font></td>
          <td width="210">第 <font color=blue><b><%=adsrs("place")%></b></font> 
            位</td>
        </tr>
        <tr bgcolor="#Ffffff"> 
          <td width="128"><font color="#FF0000">加入时间:</font></td>
          <td width="229"><%=adsrs("regtime")%></td>
          <td width="116"><font color="#FF0000">最近显示时间:</font></td>
          <td width="210"><%=adsrs("time")%></td>
        </tr>
        <tr  bgcolor="#F7FFF4"> 
          <td width="128"><font color="#FF0000">客户姓名:</font></td>
          <td width="229"><%=adsrs("username")%></td>
          <td width="116"><font color="#FF0000">客户联系方式:</font></td>
          <td width="210"><%=adsrs("contact")%></td>
        </tr>
        <tr bgcolor="#Ffffff"> 
          <td width="128"><font color="#FF0000">广告条宽度:</font></td>
          <td width="229"><b><%=adsrs("width")%></b> 像素</td>
          <td width="116"><font color="#FF0000">广告条高度:</font></td>
          <td width="210"><b><%=adsrs("height")%></b> 像素</td>
        </tr>
        <tr  bgcolor="#F7FFF4"> 
          <td width="128"><font color="#FF0000">显示:</font></td>
          <td width="229" bgcolor="#F7FFF4"><font color=red><%=adsrs("show")%></font>次(<a href=listip.asp?id=<%=adsrs("id")%>&ip=sip><font color="#FF0000">显示记录</font></a>)</td>
          <td width="116"><font color="#FF0000">点击:</font></td>
          <td width="210"><font color=red><%=adsrs("click")%></font>次(<a href=listip.asp?id=<%=adsrs("id")%>&ip=cip><font color="#FF0000">点击记录</font></a>)</td>
        </tr>
        <tr bgcolor="#Ffffff"> 
          <td width="128"><font color="#FF0000">位置:</font></td>
          <td width="229"> 
            <%if adsrs("place")=1 then%>
            首要页面 
            <%else%>
            一般页面 
            <%end if%>
          </td>
          <td width="116"><font color="#FF0000">打开窗口:</font></td>
          <td width="210"> 
            <%if adsrs("window")=1 then%>
            原窗 
            <%else%>
            新窗 
            <%end if%>
          </td>
        </tr>
        <tr bgcolor="#F7FFF4"> 
          <td width="128"><font color=red>广告图片URL:</font></td>
          <td width="229" bgcolor="#F7FFF4"><a href="<%=adsrs("gif_url")%>" target=_blank><%=adsrs("gif_url")%> 
            </a></td>
          <td width="116"><font color="#FF0000">失效条件:</font></td>
          <td width="210"> 
            <%
if adsrs("class")=1 then
%>
            点击<font color=red><%=adsrs("clicks")%></font>次 
            <%
elseif adsrs("class")=2 then
%>
            显示<font color=red><%=adsrs("shows")%></font>次 
            <%
elseif adsrs("class")=3 then
%>
            截止期:<font color=red><%=adsrs("lasttime")%></font> 
            <%if getdiftime<7 and getdiftime>0 then%>
            <br> 
            <div style="width: 200; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: glow(color=ffff00, strength=5)">还有 
              <%=getdiftime%> 天到期!</div>
            <%end if%>
            <%
elseif adsrs("class")=4 then
%>
            点击<font color=red><%=adsrs("clicks")%></font>次,显示<font color=red><%=adsrs("shows")%></font>次 
            <%
elseif adsrs("class")=5 then
%>
            点击<font color=red><%=adsrs("clicks")%></font>次,截止期:<font color=red><%=adsrs("lasttime")%></font> 
            <%if getdiftime<7  and getdiftime>0 then%>
            <br> 
            <div style="width: 200; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: glow(color=ffff00, strength=5)">还有 
              <%=getdiftime%> 天到期!</div>
            <%end if%>
            <%
elseif adsrs("class")=6 then
%>
            显示<font color=red><%=adsrs("shows")%></font>次,截止期:<font color=red><%=adsrs("lasttime")%></font> 
            <%if getdiftime<7  and getdiftime>0 then%>
            <br> 
            <div style="width: 200; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: glow(color=ffff00, strength=5)">还有 
              <%=getdiftime%> 天到期!</div>
            <%end if%>
            <%
elseif adsrs("class")=7 then
%>
            点击<font color=red><%=adsrs("clicks")%></font>次,显示<font color=red><%=adsrs("shows")%></font>次,截止期:<font color=red><%=adsrs("lasttime")%></font> 
            <%if getdiftime<7  and getdiftime>0 then%>
            <br> 
            <div style="width: 200; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: glow(color=ffff00, strength=5)">还有 
              <%=getdiftime%> 天到期!</div>
            <%end if%>
            <%
else
%>
            无限制条件 
            <%

end if%>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td><font color=red>备注:</font><%=adsrs("note")%></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td width="595"> <div align="right"><a href=option.asp?id=<%=adsrs("id")%>&job=banner target="_blank">查看banner</a> 
        &nbsp;&nbsp;&nbsp;&nbsp; 
        <%
if adsrs("act")=1 then
%>
        <a href=option.asp?id=<%=adsrs("id")%>&job=close target="_self">暂停</a> 
        <%
else
%>
        <a href=option.asp?id=<%=adsrs("id")%>&job=open target="_self">激活</a> 
        <%end if%>
         </div></td>
    <td width="231"> <div align="center"><a href=option.asp?id=<%=adsrs("id")%>&job=delit target="_self">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=modifyads_place.asp?id=<%=adsrs("id")%>  target=_self>修改详细设置</a></div></td>
    <td width="166"> <div align="center"></div></td>
  </tr>
</table>
<%
i=i+1
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
adsrs.movenext
loop
end sub 

sub showpages()
dim n
n=totalPage
%>
<p></p>
<table border=0 width=100% cellspacing=1 cellpadding=0>
<tr><td></td></tr>
</table>
<table width=630 border=0 align="center" cellpadding=2 cellspacing=1>
<form method=post action=list.asp?type=<%=request.querystring("type")%> target="_self"><tr bgcolor=#ffffff><td align=right colspan=4>
共<font color=red><%=totalput%></font>条,每页<font color=red><%=advertlistnumber%></font>条,第<font color=red><%=currentPage%></font>页,共<font color=red><%=totalPage%></font>页 
<%
response.write " 转到:<select name='page' size=1>"
for i=1 to n
response.write "<option value="& i
if currentpage=i then
response.write " selected"
end if
response.write ">"& i &"</option>"
next
response.write "</select>&nbsp;<input type='submit'  value=' goto '>"
%>
</td></tr></form>
</table>
<%
end sub
%>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?