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

📄 search.asp

📁 夏茂政府网站
💻 ASP
字号:
<!--#include file="head.asp" -->
<%
    sub navigation()
    response.write " &gt;&gt; "
    response.write "站内搜索结果"
    end sub
%>
<div align="left">
	<table border="0" cellpadding="0" cellspacing="0" width="996" height="50" bgcolor="#EFEFE7">
		<tr>
<td width="216" valign="top" background="images/2/left_bg.gif">
            <div align="center">
			<%call zf11_tianqi()%>
			</div>
		   <div align="center">
			<% call zf11_Search5() %>
           </div>	   
           <div align="center">
			<% call zf11_login5()%>
           </div>
		   
            <div align="center">
            <TABLE cellSpacing=0 cellPadding=0 width=212 border=0>
              <TBODY>
              <TR>
                <TD align=middle height=30><img src="images/2/index_80.gif" width="206" height="30" alt=""></TD>
			  </TR>
              <TR>
                <TD align=middle height=200><% Call zf11_articleInfo(1,8,20,0,0) %></TD>
			  </TR>
			  </TBODY>
			</TABLE>
           </div>
		   
          </td>
			<td width="780" valign="top">
<div align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="780" >
					<tr>
						<td><IMG height=45 src="images/2/class_top3.gif" width=796></td>
					</tr>
				</table>
</div>
<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="780" height="160" style="border: 1px solid #CECFCE">
		<tr>
			<td bgcolor="#FFFFFF">   
<!--新闻文章开始-->
<br>
<TABLE width=580 border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
        <TR> 
          <TD width="100%"> <TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
              <TBODY>
                <TR bgColor=#ffffff> 
                  <TD height=2></TD>
                </TR>
              </TBODY>
            </TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=780 border=0>
        <TBODY>
        <TR>
<TD vAlign=top align=left width=580 style="BORDER-RIGHT: #d8d8d8 1px solid">
<%
    const MaxPerPage=20
    dim totalPut
    dim CurrentPage
    dim TotalPages
    dim i,j
    dim idlist
    dim Title
    Title=Trim(Request.Form("txtitle"))
    If Session("search")="" and Title="" Then : Session("search")=Title
    If Request("page")<>"" Then
    else
    Session("search")=Title
    End If
	if not isempty(request("page")) then
      		currentPage=Trim(request("page"))
   	else
      		currentPage=1
   	end if
  	if not isempty(request("selAnnounce")) then
     		idlist=request("selAnnounce")
     		if instr(idlist,",")>0 then
			dim idarr
			idArr=split(idlist)
			dim id
		for i = 0 to ubound(idarr)
	       		id=clng(idarr(i))
	       		call deleteannounce(id)
		next
     		else
			call deleteannounce(clng(idlist))
     		end if
  	end if 
   	dim sql
   	dim rs
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
<tr> 
<td width="100%" align="center"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form method=Post action="search.asp"><tr>     
<td> 
<%
    If session("search")<>"" Then : title=session("search")
    if title<>"" then
    sql="select * from Info where title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%' order by ID desc"
    end if
    if title="" then
    sql="select * from Info order by ID desc"
    end if
    Set rs= Server.CreateObject("ADODB.Recordset")
    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
    response.write "<br><br><p align='center'>没有找到任何信息...</p>"
    else
    totalPut=rs.recordcount
    if currentpage<1 then
    currentpage=1
    end if
    if (currentpage-1)*MaxPerPage>totalput then
    if (totalPut mod MaxPerPage)=0 then
    currentpage= totalPut \ MaxPerPage
    else
    currentpage= totalPut \ MaxPerPage + 1
    end if
    end if
    if currentPage=1 then
    showpage totalput,MaxPerPage,"Search.asp"
    showContent
    showpage totalput,MaxPerPage,"Search.asp"
    else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark
           			showpage totalput,MaxPerPage,"Search.asp"
            			showContent
             			showpage totalput,MaxPerPage,"Search.asp"
        		else
	        		currentPage=1
           			showpage totalput,MaxPerPage,"Search.asp"
           			showContent
           			showpage totalput,MaxPerPage,"Search.asp"
	      		end if
	   	end if
   	rs.close
   	end if
	        
   	set rs=nothing  
   	conn.close
   	set conn=nothing
  
   	sub showContent
       	dim i
	   i=0
%>
<br><br>
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
                                <tr bgcolor="#e3e3e3"> 
                                  <td width="486" height="22" align="center">信 息 标 题</td>
                                  <td width="80" align="center" bgcolor="#D8IDD8D8">发 布 时 间</td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<td height="22" bgcolor="#FFFFFF"> 
<p align="left">&nbsp;&nbsp;<a href="typenews.asp?id=<%=rs(0)%>"><%=rs("title")%></a></td>
<td> <p align="center"><%=rs("AddDate")%></td>
</tr>
<%
    i=i+1
    if i>=MaxPerPage then exit do
    rs.movenext
    loop
%>
                                <tr bgcolor="#e3e3e3"> 
                                  <td height="22" colspan="2"> 
                                    <div align="right"> </div></td>
</tr>
</table>
<%
    end sub 
    function showpage(totalnumber,maxperpage,filename)
    dim n
    if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
    else
     n= totalnumber \ maxperpage+1
    end if
    response.write "<p align='center'>&nbsp;"
    if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
    else
    response.write "<a href="&filename&"?page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
    end if
    if n-currentpage<1 then
    response.write "下一页 尾页"
    else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
    end if
    response.write "&nbsp;页次:<strong>"&CurrentPage&"/"&n&"</strong>页"
    response.write "&nbsp;共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/页"
    end function
%>
            </td>
        </tr></form>
      </table> </td>
  </tr>
</table>
</TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<br>
<!-- 新闻文章结束-->
</td>
		</tr>
	</table>
</div>
			</td>
		</tr>
	</table>
</div>
<!--#include file="foot.asp" -->

⌨️ 快捷键说明

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