<!--#include file="conn.asp"-->
<%if session("ad_admin")="" then
response.Redirect "login.asp"
end if

dim sql,rs
keyword=replace(trim(request.form("keyword")),"'","")
if keyword <>"" then
sql="select * from data where ( title like '%" & keyword & "%' or text like '%" & keyword & "%' ) and stop >= date() order by adid desc"
else
sql="select * from data where stop >= date() order by adid desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>现有广告列表</title>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1px; margin-bottom: 1px }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
-->
</style>
</head>

<body background="../images/background.gif">

      <table border="0" width="100%"  cellspacing="0" cellpadding="0">
      <tr>                                                             
    <td height="30">     
    <p align="center"><font style="font-size:14px">发布新广告&nbsp;&nbsp;全部广告&nbsp;&nbsp;付费广告&nbsp;&nbsp;固顶广告&nbsp;&nbsp;过期广告&nbsp;&nbsp;修改管理密码&nbsp;&nbsp;<a href="quit.asp"><font color="#FF0000">退出管理</font></a></font></p>    
      </td>                                                                          
   </tr>
    <tr>
      <td width="100%">
      <div align="center">
  <center>
  <table width="700" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#F3F3F3">
<tr>
    <td bgcolor="#CAE2F8">
      <p align="center">编号</p>    </td>
    <td bgcolor="#CAE2F8">&nbsp;广告标题</td>
    <td bgcolor="#CAE2F8" align="center">广告类别</td>
    <td bgcolor="#CAE2F8">
      <p align="center">发布日期</td>
    <td bgcolor="#CAE2F8">
      <p align="center">生效日期</td>
    <td bgcolor="#CAE2F8">
      <p align="center">截止日期</td>
    <td bgcolor="#CAE2F8">
      <p align="center">发布状态</td>
    <td align="center" bgcolor="#CAE2F8">会员</td>
    <td align="center" bgcolor="#CAE2F8">身份证</td>
    <td align="center" bgcolor="#CAE2F8">IP</td>
    <td bgcolor="#CAE2F8">
      <p align="center">管理操作</p>
    </td>
  </tr>
<%if rs.eof or rs.bof then
response.write"<tr><td colspan='8'><p align='center'><font color='red'>暂无广告！</font></p></td></tr></table>"
response.end
else
const maxperpage=50
dim currentpage
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if isnumeric(currentpage)=false then
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"
response.end
end if
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
	if currentpage > rs.pagecount then
	currentpage=rs.pagecount
	end if
end if

dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
do while i< maxperpage and not rs.eof%>
<tr>
    <td>
      <p align="center"><%=i+currentpage*maxperpage-maxperpage+1%></td>
    <td>&nbsp;<a href="../show.asp?id=<%=rs("adid")%>" target="_blank"><%=rs("title")%></a><%If rs("ispic")="yes" Then%>
      <font color="#FF0000">图</font>
      <%End If%></td>
    <td align="center"><%=rs("type")%></td>
    <td>
      <p align="center"><%=rs("date")%></td>
    <td>
      <p align="center"><%=rs("time")%></td>
  <td>
      <p align="center"><%=rs("stop")%></td>
    <td>
      <p align="center"><%If rs("mark")="yes" Then%><font color="#008000">已经发布</font><%Else%><font color="#FF0000">尚未发布</font><%End If%>
</td>
<td align="center"><%If rs("uid")<>"" Then%>
  <font color="#FF0000">是</font>
  <%Else%>否<%End If%></td>
    <FORM action="http://www.oicq88.com/idsearch/index.asp" method=post target="_blank"><td align="center"><INPUT name="action" type="hidden" value="idcard"><INPUT name="userid" value="<%=rs("cardid")%>" type="hidden"><%If rs("cardid")<>"" Then%><INPUT name=B1 type=submit value="查"><%Else%>无<%End If%></td></FORM>
    <FORM METHOD=POST ACTION="http://www.ip138.com/ips.asp" target="_blank"><td align="center"><input name="ip" value="<%=rs("ip")%>" TYPE="hidden"><%If rs("ip")<>"" Then%><input type="submit" value="查"><%Else%>无<%End If%><INPUT TYPE="hidden" name="action" value="2"></td></FORM>
    <td>
      <p align="center"><font color="green">修改</font>&nbsp;<font color="red">删除</font></p>
    </td>
  </tr>
    <%i=i+1                     
    rs.movenext                                                               
    loop    
    rs.close  
    set rs=nothing                                                                                     
    conn.close   
    set conn=nothing                                                                                        
    end if%>     </table>     
  </div>                                                         
      </td>                                                                                                            
        </tr>                                                             
      </table>                                                             
  <table border="0" width="100%" cellspacing="0" cellpadding="0">                                                              
   <tr>                                                             
    <td height="30">     
    <p align="center">本页为演示页，如需此项功能，请联系QQ：1756162 或拨打手机13845961980</p>    
     </td>                                                                          
   </tr>   
   <tr>                                                     
    <td height="30"><p align="center">页数：<%=currentpage%>/<%=n%>                                                            
   	<%k=currentpage                                                                                         
   	if k<>1 then%>                                                                     
   	<a href="list.asp?pageid=1">首页</a>                                                                                         
   	<a href="list.asp?pageid=<%=k-1%>">上一页</a>                                                                                         
   	<%else%>                                                                     
   	首页&nbsp;上一页                                                                                         
   	<%end if%>                                                                     
   	<%if k<>n then%>                                                                                         
   	<a href="list.asp?pageid=<%=k+1%>">下一页</a>                                                                                         
   	<a href="list.asp?pageid=<%=n%>">尾页</a>                                                                                         
   	<%else%>                                                                     
   	下一页&nbsp;尾页                                                                                         
   	<%end if%>                                                                     
        共有 <%=totalput%> 条广告</p>                                                                                        
     </td>                                                                                  
   </tr> 
      <tr><td>
   <form action="" method="post" name="search">     
    <p align="center"><font style="font-size:14px">关键字 </font><input  maxLength="20" name="keyword" onfocus="this.value=''" size="18"  value="<%=keyword%>"> 
    <input  type="submit" value="搜索" style="font-size: 12px" name="search"></form> 
   </td></tr>                                                               
  </table>                                                       
</body>                                                                        
</html>     