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

📄 search.asp

📁 青岛分类信息网整合企业名录.供大家分享
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="head.asp"-->
<!-- 这里是主题 -->

<%
dim name,theitem,sql,rs,thepage,currentpage,pagename,totalpage,n,page
name=HtmlEncode(trim(request("keyword")))
theitem=HtmlEncode(trim(request("item")))
Set rs = Server.CreateObject("ADODB.Recordset")
  if name="" or name="请输入搜索关键字" then
    response.write "<SCRIPT language=JavaScript>alert('请输入搜索关键字!');"
	response.write "this.location.href='javascript:history.back()';</SCRIPT>"
   	response.end
  else
    if theitem="全部" then
    sql="select * from data where (title Like '%"& name &"%' or text Like '%"& name &"%' or type Like '%"& name &"%') and mark='yes' and stop >= date() order by top desc,money desc,time desc"
    rs.open sql,conn,1,1
    else
    sql="select * from data where (title Like '%"& name &"%' or text Like '%"& name &"%' or type Like '%"& name &"%') and type='"&theitem&"' and mark='yes' and stop >= date() order by top desc,money desc,time desc"
    rs.open sql,conn,1,1
    end if
  end if
if rs.eof then
	response.write "<SCRIPT language=JavaScript>alert('对不起,没有找到符合条件的广告内容!');"
	response.write "this.location.href='javascript:history.back()';</SCRIPT>"
	rs.close
	set rs=nothing
   	response.end
end if
thepage=request("pageid")
if isnumeric(thepage)=false then
response.write "<script>alert('参数错误,窗口关闭!');history.back();</script>"
response.end
end if
currentpage = cint(thepage)            
if currentpage <= 0 then currentpage=1       
const maxperpage=40                        
rs.Pagesize = maxperpage  
pagename="search.asp"                     
totalpage = rs.PageCount 
rs.absolutepage = currentpage 
n=rs.recordcount                    
page = PageSet(currentpage,totalpage,pagename)
%>


<TABLE WIDTH=760 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
           <tr> 
             <td width="100%" height="30" colspan="4">
               <p align="center"><font style="font-size:14px"><b>您输入的搜索关键字:<font color="red"><%=name%></font>&nbsp;&nbsp;以下是搜索结果:</b></font></p>                
             </td>                                          
           </tr>


	<TR>
	 <td width="100%" height="30" style="BORDER-RIGHT: #91b9dd 1px dotted; BORDER-TOP: #91b9dd 1px dotted; BORDER-LEFT: #91b9dd 1px dotted; BORDER-BOTTOM: #91b9dd 1px dotted" bgColor="#e6faff" colspan="4">
 <p align="center"><a href="default.asp"><font style="font-size:14px" color="#0000BF">全部广告</font></a>&nbsp;&nbsp;页次:<b><%=currentpage%>/<% =totalpage%></b>&nbsp;&nbsp;每页<b><%=maxperpage%></b>条&nbsp;&nbsp;共刊登<b><%=n%></b>条广告&nbsp;&nbsp;&nbsp;&nbsp;<% response.write page %>

	 </td>
	 </tr>
<TR>

<%                
dim i,red_name                                                                               
i=0                                                                                                                                                                           
do while i < maxperpage and not rs.eof                                                     
red_name = replace(rs("text"),name,"<font color=#ff0000>"&name&"</font>")                                                                                                                            
%>   

<td width="25%">
<table border="0" width="100%" cellpadding="1" cellspacing="2">                     <tr>                                                                                 <td width="100%" height="24" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted" bgColor="#ffe8e8">
   <p align="center">
   <% if rs("cu")="yes" then %>
   <b><font style="font-size:14px" <% if rs("color")<>"" then %>color="<%=rs("color")%>"<% end if %>><%=rs("title")%></font></b><% else %><font style="font-size:14px" <% if rs("color")<>"" then %>color="<%=rs("color")%>"<% end if %>><%=rs("title")%></font><% end if %>
  </td> 
  </tr>                
 <tr>                
   <td width="100%" height="127" valign="top" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted"> 
   <% if rs("ispic")<>"yes" then %>                  
                <div align="center">                               
                    <center>   
                    <% if rs("bgcolor1")<>"" then %>
                    <table border="1" width="100%" cellspacing="0" cellpadding="2" bordercolor="<%=rs("bgcolor1")%>">
                    <% else %>                                
                    <table border="0" width="93%" cellspacing="0" cellpadding="0">
                    <% end if %>                                  
                      <tr>                                    
                        <td width="100%">                                       
                          <p style="margin-top: 2"><%=red_name%></td> 
                      </tr>                                    
                    </table>                                   
                    </center>                                   
                  </div>                                              
                  <% else %>                                              
                  <p style="margin-top: 0; margin-bottom: 0" align="center"><% if rs("url")<>"" and rs("url")<>"http://" then %><a href="<%=rs("url")%>" target="_blank"><img src="adpic/<%=rs("pic")%>" border="0" width="170" height="119"></a><% else %><img src="adpic/<%=rs("pic")%>" border="0" width="170" height="119"><% end if %> 
                  <% end if %> 		   
   </td>  
 </tr>               
 <tr>                
  <td width="100%" style="BORDER-RIGHT: #92dcb9 1px dotted; BORDER-TOP: #92dcb9 1px dotted; BORDER-LEFT: #92dcb9 1px dotted; BORDER-BOTTOM: #92dcb9 1px dotted"> 
   <p align="center"><font color="#FF0000">发布时间:</font> <font color="#008000"><%=rs("date")%></font> <br>
<p align="center"><% if rs("top")="1" then %><font color="#FF0000">固顶广告</font> <font color="#008000">有效期还有<%=datediff("d",date(),rs("stop"))%>天</font><% else %><% if rs("money")<>"0" then %><img src="images/dot.gif"> <font color="#FF6600">竞价广告</font> <font color="#008000">有效期还有<%=datediff("d",date(),rs("stop"))%>天</font><% else %><font color="#008000">↑有效期还有<%=datediff("d",date(),rs("stop"))%>天↑</font><% end if %><% end if %> 
  </td> 
 </tr>
 </table></td>

<%                                      
i=i+1
if i mod 4=0 then  
response.write "</tr><tr>"        
end if
rs.movenext
loop  
if (n mod 4) <> 0 and not i mod maxperpage = 0 Then 
for i = 1 to (4 - (n mod 4))  
%>
<td width="25%">
<table border="0" width="100%" cellpadding="1" cellspacing="2">
<tr>                                                                                
   <td width="100%" height="24" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted" bgColor="#ffe8e8">                                         <p align="center"><b><font style="font-size:14px" >网站制作</font></b></td> 
  </tr>                 
 <tr>              
   <td width="100%" height="127" valign="top" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted">                                       <div align="center"><center> 
  <table border="0" width="93%" cellspacing="0" cellpadding="0">                       <tr> 
        <td width="100%">  <p style="margin-top: 2">网站制作网站制作网站制作网站制作网站制作</td>
        </tr>                                                                                                    
       </table>                                                                                                    
    </center></div>                                              
   </td>                                                                                                    
 </tr>                                                                                                    
 <tr>                                                                                                    
  <td width="100%" style="BORDER-RIGHT: #92dcb9 1px dotted; BORDER-TOP: #92dcb9 1px dotted; BORDER-LEFT: #92dcb9 1px dotted; BORDER-BOTTOM: #92dcb9 1px dotted"> 
   <p align="center"><font color="#FF0000"></font> <font color="#008000">有效期还有182天</font> <br>
  <p align="center"><font color="#FF0000">固顶广告</font> <font color="#008000">有效期还有182天</font>
   </td> 
 </tr>
 </table></td>

⌨️ 快捷键说明

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