<!--#include file=menu.asp -->

<table border=0 width=95% cellspacing=1 cellpadding=0 align="center">
<tr bgcolor=#ffffff align=center valign=top>
<td>
<table border=0 width=100% cellspacing=3 cellpadding=3>
<tr><td align=center>
<%
if trim(request.form("kclass"))="1" then
%>
<font size="3"><b>搜索ID值为 <font color=red><%=trim(request.form("kword"))%></font> 的广告的结果</b></font>
<%
elseif trim(request.form("kclass"))="2" then
%>
<font size="3"><b>搜索关键字为 <font color=red><%=trim(request.form("kword"))%></font> 的广告的结果</b></font>
<%
end if


dim getid,adssql,adsrs
%>
</td></tr></table>


<table border=0 width=100% cellspacing="1" cellpadding=3 bgcolor=#999999>
<%
if trim(request.form("kclass"))="1" then

getid=cint(request.form("kword"))
set adsrs=server.createobject("adodb.recordset")
adssql="select * from dlxf_ads where dlxf_id="&getid&" order by dlxf_regtime"

adsrs.open adssql,conn,1,1
if adsrs.eof and adsrs.bof then
response.write "<tr><td bgcolor=#ffffff>没有记录</td></tr></table>"
else
do while not (adsrs.eof or err)
%>
<tr><td height=28 bgcolor=#ffffee><font color=red>ID：<%=adsrs("dlxf_id")%></font>(<%if adsrs("dlxf_act")=1 then%>正常播出<%elseif adsrs("dlxf_act")=0 then%>被暂停<%elseif adsrs("dlxf_act")=2 then%>失效<%end if%>)
<a href=<%=adsrs("dlxf_url")%> target=_blank><%=adsrs("dlxf_sitename")%></a>　<%=adsrs("dlxf_url")%></td>
<td bgcolor=#ffffee align=center><a href=view.asp?id=<%=adsrs("dlxf_id")%>><strong>查看详细</strong></a></td></tr>
<tr bgcolor=#ffffff width=535><td>　加入时间：<font color=red><%=adsrs("dlxf_regtime")%></font>　最近显示时间：<font color=red><%=adsrs("dlxf_time")%></font></td>
<td width=90 align=center><a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=banner','banner<%=adsrs("dlxf_id")%>',500,90)>查看banner</a></td></tr>
<tr bgcolor=#ffffff><td>　显示：<font color=red><%=adsrs("dlxf_show")%></font>次(<a href=javascript:opw('listip.asp?id=<%=adsrs("dlxf_id")%>&ip=sip','s<%=adsrs("dlxf_id")%>',360,400)>显示记录</a>)，点击：<font color=red><%=adsrs("dlxf_click")%></font>次(<a href=javascript:opw('listip.asp?id=<%=adsrs("dlxf_id")%>&ip=cip','c<%=adsrs("dlxf_id")%>',360,400)>点击记录</a>)，位置：<font color=red><%if adsrs("dlxf_place")=1 then%>首要页面<%else%>一般页面<%end if%></font>，打开窗口：<font color=red><%if adsrs("dlxf_window")=1 then%>原窗<%else%>新窗<%end if%></font>
</td>
<td align=center>
<%
if adsrs("dlxf_act")=1 then
%>
<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=close','close<%=adsrs("dlxf_id")%>',300,140)>暂停</a>
<%
else
%>
<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=open','open<%=adsrs("dlxf_id")%>',300,140)>激活</a>
<%end if%>　<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=delit','del<%=adsrs("dlxf_id")%>',300,140)>删除</a></td></tr>
<tr bgcolor=#ffffff><td>
　失效条件：<%
if adsrs("dlxf_class")=1 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次
<%
elseif adsrs("dlxf_class")=2 then
%>
显示<font color=red><%=adsrs("dlxf_shows")%></font>次
<%
elseif adsrs("dlxf_class")=3 then
%>
截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=4 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，显示<font color=red><%=adsrs("dlxf_shows")%></font>次
<%
elseif adsrs("dlxf_class")=5 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=6 then
%>
显示<font color=red><%=adsrs("dlxf_shows")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=7 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，显示<font color=red><%=adsrs("dlxf_shows")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
else
%>
无限制条件
<%
end if
%>
</td>
<td align=center><a href=javascript:opw('modify.asp?id=<%=adsrs("dlxf_id")%>','<%=adsrs("dlxf_id")%>',500,420)>修改详细设置</a></td></tr>
<tr><td colspan=2 bgcolor=#dddddd>.</td></tr>
<%
adsrs.movenext
loop
end if
adsrs.close
set adsrs=nothing
conn.close
set conn=nothing


elseif trim(request.form("kclass"))="2" then

dim MaxPerPage,totalPut,CurrentPage,TotalPages,i,advlistact
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if

adskeyword=trim(request("kword"))
set adsrs=server.createobject("adodb.recordset")
adssql="Select * from [dlxf_ads] where dlxf_sitename like '%"&adskeyword&"%' or dlxf_url like '%"&adskeyword&"%' order by dlxf_time"


adsrs.open adssql,conn,1,1
if adsrs.eof and adsrs.bof then
response.write "<tr><td bgcolor=#ffffff>没有记录</td></tr></table>"
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
conn.close
set conn=nothing

end if
%>

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


<%
sub showContent
i=0
do while not (adsrs.eof or err)
%>
<tr><td height=28 bgcolor=#ffffee><font color=red>ID：<%=adsrs("dlxf_id")%></font>(<%if adsrs("dlxf_act")=1 then%>正常播出<%elseif adsrs("dlxf_act")=0 then%>被暂停<%elseif adsrs("dlxf_act")=2 then%>失效<%end if%>)
<a href=<%=adsrs("dlxf_url")%> target=_blank><%=adsrs("dlxf_sitename")%></a>　<%=adsrs("dlxf_url")%></td>
<td bgcolor=#ffffee align=center><a href=view.asp?id=<%=adsrs("dlxf_id")%>><strong>查看详细</strong></a></td></tr>
<tr bgcolor=#ffffff width=535><td>　加入时间：<font color=red><%=adsrs("dlxf_regtime")%></font>　最近显示时间：<font color=red><%=adsrs("dlxf_time")%></font></td>
<td width=90 align=center><a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=banner','banner<%=adsrs("dlxf_id")%>',500,90)>查看banner</a></td></tr>
<tr bgcolor=#ffffff><td>　显示：<font color=red><%=adsrs("dlxf_show")%></font>次，点击：<font color=red><%=adsrs("dlxf_click")%></font>次，位置：<font color=red><%if adsrs("dlxf_place")=1 then%>首要页面<%else%>一般页面<%end if%></font>，打开窗口：<font color=red><%if adsrs("dlxf_window")=1 then%>原窗<%else%>新窗<%end if%></font>
</td>
<td align=center>
<%
if adsrs("dlxf_act")=1 then
%>
<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=close','close<%=adsrs("dlxf_id")%>',300,140)>暂停</a>
<%
else
%>
<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=open','open<%=adsrs("dlxf_id")%>',300,140)>激活</a>
<%end if%>　<a href=javascript:opw('option.asp?id=<%=adsrs("dlxf_id")%>&job=delit','del<%=adsrs("dlxf_id")%>',300,140)>删除</a></td></tr>
<tr bgcolor=#ffffff><td>
　失效条件：<%
if adsrs("dlxf_class")=1 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次
<%
elseif adsrs("dlxf_class")=2 then
%>
显示<font color=red><%=adsrs("dlxf_shows")%></font>次
<%
elseif adsrs("dlxf_class")=3 then
%>
截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=4 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，显示<font color=red><%=adsrs("dlxf_shows")%></font>次
<%
elseif adsrs("dlxf_class")=5 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=6 then
%>
显示<font color=red><%=adsrs("dlxf_shows")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
elseif adsrs("dlxf_class")=7 then
%>
点击<font color=red><%=adsrs("dlxf_clicks")%></font>次，显示<font color=red><%=adsrs("dlxf_shows")%></font>次，截止期<font color=red><%=adsrs("dlxf_lasttime")%></font>
<%
else
%>
无限制条件
<%
end if
%>
</td>
<td align=center><a href=javascript:opw('modify.asp?id=<%=adsrs("dlxf_id")%>','<%=adsrs("dlxf_id")%>',500,420)>修改详细设置</a></td></tr>
<tr><td colspan=2 bgcolor=#dddddd>.</td></tr>
<%
i=i+1
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出，如果记录达到页最大显示数，也退出
adsrs.movenext
loop
end sub 

sub showpages()
dim n
n=totalPage
%>
</table>
<table border=0 width=95% cellspacing=1 cellpadding=0 align="center">
<tr><td></td></tr>
</table>
<table border=0 width=95% cellpadding=2 cellspacing=1 align="center">
<form method=post action=search.asp><tr bgcolor=#ffffff><td align=right colspan=4><input type=hidden name=kclass value="2"><input type=hidden name=kword value=<%=trim(request("kword"))%>>
共<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
%>
</center></div>