⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dirnews.asp

📁 默认管理员:etaodu 密码:etaodu 陶都房市++介绍: 本版本是基于<住易江南>美化
💻 ASP
字号:
<!--#include file=../conn/conn1.asp -->
<% if request.cookies("okadmin")="" and request.cookies("rank")="" then
  response.redirect "login.asp"
end if %>
<title>房产新闻信息</title>
<%
   dim MaxPerPage
   dim sql 
   dim rs
   dim gstBookID
   dim totalPut   
   dim CurrentPage
   dim TotalPages
    if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>

<html>
<head>
<LINK 
href="../images/style.css" rel=stylesheet type=text/css>
<style>
<!--
{  }
.9size {  font-family: "宋体"; font-size: 9pt; color: #000000; text-decoration: none}
.txt {  font-family: "宋体"; font-size: 9pt; color: #000000; text-decoration: none; background-color: #FFFFFF}
-->
</style>

</head>
 <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000">
                        <center>
                
    
<div align="center">
  <center>
                
    
<table width="97%" height="343" border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#FFFFFF" style="border-collapse: collapse">
  <tr> 
    <td width="599" height="54" valign="bottom" style="border-left-style: none; border-left-width: medium"> 
      <div align="left"><strong><font size="4">房产信息、咨询、服务</font></strong></div></td>
  </tr>
  <tr valign="top"> 
    <td valign="top" style="border-left-style: none; border-left-width: medium"> 
      <%   
set rs=server.createobject("adodb.recordset")   
sql= "SELECT *  FROM news order by ID Desc "
rs.open sql,conn,1,1   
if rs.eof and rs.bof then %> 
      <p align="center">还没有房产信息!</p>
      <% else    
   rs.pagesize=25   
   totalPut=rs.recordcount '记录总数    
   totalPage=rs.pagecount    
   MaxPerPage=rs.pagesize    
      if currentpage<1 then    
          currentpage=1    
      end if    
      if currentpage>totalPage then    
          currentpage=totalPage    
      end if    
   if currentPage=1 then    
      showpages    
      showContent    
      showpages1    
    else    
         if (currentPage-1)*MaxPerPage<totalPut then    
         rs.move  (currentPage-1)*MaxPerPage    
         dim bookmark    
         bookmark=rs.bookmark '移动到开始显示的记录位置    
         showpages    
         showContent    
         showpages1    
      else     
               
      end if    
   end if    
      rs.close    
end if    
set rs=nothing      
conn.close    
set conn=nothing      
    
sub showContent    
     dim i,j   
   
%>
      <div align="center">
        <center> 
      <table width="98%" cellspacing="1" bordercolor="#111111" style="border-collapse: collapse" height="35" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">
        <tr bgcolor="#00CCFF" class="9size" valign="bottom"> 
                      
          <td width="125" height="18" bgcolor="#DBDBB7" style="border-style: solid; border-width: 1" valign="middle"> 
            <div align="center">类 别</div></td>
                      <td width="373" bgcolor="#DBDBB7" style="border-style: solid; border-width: 1" height="18" valign="middle"> <div align="center">标 题</div></td>
                      <td width="103" bgcolor="#DBDBB7" style="border-style: solid; border-width: 1" height="18" valign="middle"> <div align="center">发表时间</div></td>
                      <td width="72" bgcolor="#DBDBB7" style="border-style: solid; border-width: 1" height="18" valign="middle"><div align="center">
                        点击</div></td>
                      <td width="55" bgcolor="#DBDBB7" style="border-style: solid; border-width: 1" height="18" valign="middle">
                      <p align="center">删 除</td>
                    </tr>
        <% i=1   
       do while not (rs.eof or err)%>
        <tr bgcolor="<%If (i Mod 2) Then%>#EAEAEA<%Else%>#FFFFFF<%End If%>">
                      <td width="125" style="border-style: solid; border-width: 1" height="18" valign="middle"> 
                        <div align="center"><% if rs("type")="新闻" then %><font color="red"><span style="font-size: 9pt">[<%= rs("type") %>]</span></font><% Else %><font color="green"><span style="font-size: 9pt">[<%= rs("type") %>]</span></font><% End If %></div></td>
                      <td width="373" style="border-style: solid; border-width: 1" height="18" valign="middle"> 
                        <div align="left"><span style="font-size: 9pt"> </span><font color="#0000FF"><span style="font-size: 9pt"><a target="_blank" style="text-decoration: none" href="../listnews.asp?id=<%= rs("id") %>"><%=left((rs.Fields.Item("name").Value),22)%></a></span></font></div></td>
                      <td width="103" style="border-style: solid; border-width: 1" height="18" valign="middle"> 
                        <div align="center"><span style="font-size: 9pt"><%=(rs.Fields.Item("Dat").Value)%></span></div></td>
                      <td width="72" style="border-style: solid; border-width: 1" height="18" valign="middle"><div align="center"><span style="font-size: 9pt"><%=(rs.Fields.Item("hit").Value)%></span></div></td>
                      <td width="55" style="border-style: solid; border-width: 1" height="18" valign="middle">
                      <p align="center">
                      <a href="news_delete.asp?id=<%=rs("id") &"&page="&currentPage %>">删
                      除</a></td>
                    </tr>
        <%     
   if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出     
   i=i+1     
    rs.movenext     
    loop     
%> 
      </table>
        </center>
      </div>
      <%end sub %> <%sub showpages() %>
      <div align="center">
        <center> 
      <table width="97%" style="border-collapse: collapse" bordercolor="#111111" cellspacing="1">
        <tr> 
          <td align="right"><span style="font-size:9pt">共<font color="#FF0000"><%=totalPage%></font>页/<font color="red"><%=totalPut%></font>篇文章</span></td>
        </tr>
      </table>
        </center>
      </div>
      <%     
end sub     
sub showpages1()     
dim n     
n=totalPage     
%> <form action="dirnews.asp" method="GET" align="right">
        <div align="center"> 
          <center>
            <table width="97%" height="30" border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
              <tr> 
                <td width="100%" height="30"> <div align="left"><span style="font-size:9pt"> 
                     共<font color="#FF0000"><%=totalPage%></font>页/<font color="red"><%=totalPut%></font>篇文章</span> 
                    <% If currentPage <> 1 Then %>
                    <A href=dirnews.asp><font color="#FF6600"><span style="font-size:9pt">[首页]</span></font></A> 
                    <A href=dirnews.asp?Page=<%= (currentPage-1) %> ><font color="#FF6600"><span style="font-size:9pt">[上一页]</span></font></A> 
                    <% End If %>
                    <% If currentPage <> rs.PageCount Then %>
                    <A href=dirnews.asp?Page=<%= (currentPage+1) %> ><font color="#FF6600"><span style="font-size:9pt">[下一页]</span></font></A> 
                    <A href=dirnews.asp?Page=<%= totalPage %>><font color="#FF6600"><span style="font-size:9pt">[尾页]</span></font></A> 
                    <% End If %>
                    <span style="font-size:9pt">第<font color="#FF0000"><%=currentPage%></font>页/共<font color="#FF0000"><%=totalPage%></font>页 
                    <%   response.write " 转到:<select name='page' size=1 class=smallselsect style='font-family: 宋体; font-size: 9pt;'>"     
     
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>"     
  response.write "&nbsp;<input class=buttonface type='submit'  value='go'  style='font-family: 宋体; font-size: 9pt;'>"     
%>
                    </span> </div></td>
              </tr>
            </table>
          </center>
        </div>
      </form>
      <%end sub%>
    </td>
  </tr>
</table>
  </center>
</div>
</div>
</body>
</html>

⌨️ 快捷键说明

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