search.jsp
上传用户:helenhuo66
上传日期:2007-06-01
资源大小:865k
文件大小:2k
源码类别:

百货/超市行业

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ include file="top.jsp"%>
  3. <link href="css.css" rel="stylesheet" type="text/css">
  4.         <div align="center">
  5.           <center>
  6.         <table width="500" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 6; border-collapse:collapse" bordercolor="#111111">
  7.           <tr> 
  8.             <td width="99%" align="center" bgcolor="#DBC2B0" height="25"><b>搜索结果</b></td>
  9.           </tr>
  10.           <tr> 
  11.             <td height="100" colspan="2" bgcolor="#F5EFE7"> <div align="center"></div>
  12.               <table border="0" width="300" cellspacing="0" cellpadding="0" height="5" align="center">
  13.                 <%String hw_name,sort_id;
  14.   if(session.getAttribute("sort_id")==null){
  15.                   hw_name=getStr(request.getParameter("hw_name"));
  16.                   sql="select * from hw where hw_name like '%"+hw_name+"%' order by hw_id DESC";
  17.   rs=mdb.executeQuery(sql);
  18.   }
  19.   else{
  20.                     sort_id=request.getParameter("sort_id");
  21.                     hw_name=getStr(request.getParameter("hw_name"));
  22.                     sql="select * from hw where sort_id='"+sort_id+"' and hw_name like '%"+hw_name+"%' order by hw_id DESC";
  23. rs=mdb.executeQuery(sql);
  24.   }
  25.     if(!rs.next()){
  26.     %>
  27.                 <tr> 
  28.                   <td width="380">没有你要找的商品,请先确定商品的类别</td>
  29.                 </tr>
  30.                 <%}
  31. else{rs.previous();
  32. %>
  33.                 <tr> 
  34.                   <td> </td>
  35.                 </tr>
  36.                 <%while(rs.next()){%>
  37.                 <tr> 
  38.                   <td><a href="views.jsp?hw_id=<%=rs.getString("hw_id")%>"><b class="dz1"><%=rs.getString("hw_name")%></b></a></td>
  39.                 </tr>
  40.                 <%
  41. }
  42. }%>
  43.               </table>
  44.               <br> <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
  45.                 <tr> 
  46.                   <td valign="middle"><div align="center"><img src="img/pics/seperator.gif" width="359" height="1"></div></td>
  47.                 </tr>
  48.               </table>
  49.               <br> </td>
  50.           </tr>
  51.         </table>
  52.           </center>
  53. </div>
  54. <%@ include file="copy.jsp"%>