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

📄 search.asp

📁 欢迎使用酷航设计系统
💻 ASP
字号:
<!--#include file="ku_top.asp" -->
<%
    sub navigation()
    response.write " &gt;&gt; "
    response.write "站内搜索结果"
    end sub
%>
<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="800" height="50" bgcolor="#FFFFFF">
		<tr>
			<td width="218" valign="top">
			<div align="center">
				<table border="0" width="208" id="table2" bgcolor="#ebebeb" cellpadding="0" cellspacing="0">
					<tr>
						<td height="30"  background="xbqq_img/gonggao.gif">
						<p align="center"><b>站 内 公 告</b></td>
					</tr>
					<tr>
						<td><% xbqq_Marquee %></td>
					</tr>
					<tr>
						<td height="0"><hr></td>
					</tr>					
					<tr>
						<td height="30"  background="xbqq_img/gonggao.gif">
						<p align="center"><b>信 息 搜 索</b></td>
					</tr>
					<tr>
						<td height="23"><% xbqq_Search %></td>
					</tr>
					<tr>
						<td height="0"><hr></td>
					</tr>	
					<tr>
						<td height="30"  background="xbqq_img/gonggao.gif">
						<p align="center"><b>站 内 投 票</b></td>
					</tr>
					<tr>
						<td><% xbqq_vote %></td>
					</tr>
					<tr>
						<td height="0"><br></td>
					</tr>	
				</table>
			</div>
			</td>
			<td width="560" valign="top">
<div align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="580" height="28" id="table1"  background="xbqq_img/kind1.gif">
					<tr>
						<td>&nbsp;<img border="0" src="xbqq_img/ico1.gif" width="11" height="9">
						<font color="#FFFFFF">搜索结果</font></td>
					</tr>
				</table>
</div>
<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="580" height="5">
		<tr>
			<td></td>
		</tr>
	</table>
</div>
<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="580" height="160" style="border: 1px solid #CECFCE">
		<tr>
			<td bgcolor="#FFFFFF" width="100%">   
<!--新闻文章开始-->
<br>
<TABLE width=580 border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
        <TR> 
          <TD width="100%"> <TABLE cellSpacing=0 cellPadding=0 width=580 align=center border=0>
              <TBODY>
                <TR bgColor=#ffffff> 
                  <TD height=2></TD>
                </TR>
              </TBODY>
            </TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=580 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="#D8D8D8"> 
                                  <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="ViewInfo.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="#D8D8D8"> 
                                  <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="xbqq_foot.asp" -->

⌨️ 快捷键说明

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