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

📄 search_cp.asp

📁 一个诚信信息港门户网 功能: 系统设置  企业会员  个人会员  商贸机会  产品管理  企业新闻  行业新闻  招聘信息  展会管理  模版管理
💻 ASP
字号:
<!--#include file="main.asp"-->
<%word=request("word")
key=request("key")
ypxxone_id=request("ypxxone_id")
ypxxtwo_id=request("ypxxtwo_id")
addone_id=request("addone_id")
addtwo_id=request("addtwo_id")
if ypxxone_id<>"" then
xxsort=" and SMT_ypxxone_id="&ypxxone_id&""
if ypxxtwo_id<>"" then
xxsort=xxsort&" and SMT_ypxxtwo_id="&ypxxtwo_id&""
end if
end if
'==================================
if word="" or key="" then
response.redirect"search.asp"
end if%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=citytitle%></title>
</head>

<body topmargin="0">
<%SMT_TOP%>
<%search%>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr><td height=10></td></tr>
  <tr><td valign="top" height=400>
<!--==================-->
<table width="96%" border="0" cellspacing="1" cellpadding="0" align="center">
<%sql="select * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and (SMT_cpname like'%"&word&"%' or SMT_cpsm like'%"&word&"%') "&xxsort&" order by SMT_id desc"
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "<tr><td height=50>没有找到能和“<font color=red>"&word&"</font>”匹配的内容,请尝试其它搜索。</td></tr>"
else  
'分页的实现 
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum%>
<%i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
<tr><td background="img/search_line.gif" colspan=2></td></tr>
<%do while not rs.eof and i<listnum
'====================
SMT_cpname=replace(rs("SMT_cpname"),word,"<font color=red>"&word&"</font>")
aaa=trim(rs("SMT_cpjm"))
if instr(aaa,word) then
a=len(aaa)
b=instr(aaa,word)
if b<50 then c=left(aaa,b) else c="..."&mid(aaa,b-50,50)
if a-(b+len(word))<50 then d=right(aaa,a-(b+len(word))) else d=mid(aaa,b,50)&"..."
SMT_cpjm=c&d
else
SMT_cpjm=Trim(left(aaa,100))&"..."
end if
SMT_cpjm=replace(SMT_cpjm,word,"<font color=red>"&word&"</font>")
'====================
n=n+1

set rs1=server.createobject("adodb.recordset")
sql1="select *  from SMT_yp where SMT_id="&rs("SMT_yp_id")
rs1.open sql1,conn,1,1
if not rs1.eof then
goname=rs1("SMT_user")
goid=rs1("SMT_id")
coname=rs1("SMT_coname")
addtwo_id=rs1("SMT_addtwo_id")
svip=rs1("SMT_vip")

set rs2=server.createobject("adodb.recordset")
sql2="select *  from SMT_ypaddtwo where SMT_addtwo_id="&addtwo_id
rs2.open sql2,conn,1,1
coadd=" <font color=1587DE>["&rs2("SMT_addtwo")&"/"&rs2("SMT_addone")&"]</font>"
rs2.close
end if
rs1.close%>
<!--#include file="dns/dns.asp"-->
<tr>
 <td width="108"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" width="80" style="border:1px #000000 solid"></a></td>
 <td width="619" valign=top><p style="line-height:180%"><font color=#000000><strong><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank" class="f14"><%=SMT_cpname%></a></strong></font> <font color=#999999>(<%=rs("SMT_date")%>)</font><br><a href=<%=usertwourl%> target=_blank><%=coname%></a>&nbsp;<%if svip=2 then%><img src="img/vip.gif" title="VIP会员"><%end if%> <%=coadd%><br>
  <%=SMT_cpjm%></td>
</tr>
<tr><td height=10 colspan=2></td></tr>
<tr><td background="img/list_line_1.gif" colspan=2></td></tr>
<tr><td height=10 colspan=2></td></tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr>
<%filename="search_"&key&".asp?word="&word&"&key="&key%>
<td colspan=6 align=right bgcolor=#95CDFF height=20><strong><font color=FF6C00><%=rs.recordcount%></font></strong>条信息 共<strong><font color=FF6C00><%=Rs.pagecount%></font></strong>页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong>|<<</strong></a>
      <a href=<%=filename%>&page=<%=page-1%>><strong><<</strong></a>
      <a href=<%=filename%>&page=<%=page-1%>><strong>[<%=page-1%>]</strong></a>
<%end if%><% if Rs.pagecount=1 then %>
<%else%><strong>[<%=page%>]</strong>
<%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>&page=<%=page+1%>><strong>[<%=page+1%>]</strong></a>
      <a href=<%=filename%>&page=<%=page+1%>><strong>>></strong></a>
      <a href=<%=filename%>&page=<%=Rs.pagecount%>><strong>>>|</strong></a>
	  <%end if%>&nbsp;&nbsp;</td>
<%end if%></tr>
<tr><td colspan=5 height=4></td></tr>
</table>
<%rs.close%>
<!--==================-->
	</td>
  </tr>
</table>
<!--====== bottom ========-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=#ffffff>
<tr><td height=2 bgcolor=#4795EC></td></tr>
  <tr>
    <td align="center" height=80><%=citybottom%></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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