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

📄 search_product.jsp~13~

📁 jsp数据库开发实例精粹全书原代码 无解压缩密码 包括 书店
💻 JSP~13~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.util.*"%>
<%@ page import="zhaobiao.db.*,zhaobiao.date.*"%>
<%!
    String getStr(String str)
    {
            try
            {
                       String temp=new String(str.getBytes("ISO8859_1"));
                    return temp;
            }
            catch(Exception e)
            {
                    return null;
            }
        }
%>
<%
Search search=new Search();
Vector list=new Vector();
String keys=null;
 if(request.getParameter("keys")!=null)
 keys=getStr(request.getParameter("keys").trim());
//out.print(keys);
list=search.searchProduct(keys);
search.freeCon();
  %>
<html>
<head>
<title>xxx</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<script language="JavaScript">
<!--
      function checknull()
  {

   var a=document.form1.keys.value;
     if(a=="")
       {
        alert("关键字不能为空!");
         return false;
       }
       else
  return true;

}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<table width="776" border="0" cellspacing="0" cellpadding="0" height="103">

  <tr>
      <td height="65"> <a href="index.jsp"><img src="images/zhaobiao_01.jpg" width="777" height="89" align="absbottom" border="0"></a></td>
  </tr>
  </table>
  <a href="product1.jsp">产品信息</a> <a href="project1.jsp">项目信息</a> <a href="maker1.jsp">厂商信息</a><br>
<table width="774" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="center">
      <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
        <tr bgcolor="0092B8">
          <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF">
              <tr align="center">
                <td>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0">
                      <tr align="center" bgcolor="E1D1B7">
                        <td height="25" align="center" colspan="13"><b><a href="product1.jsp">查询到的产品信息</a></b></td>
                      </tr>
                      <tr bgcolor="F6F2E6" align="center">
                        <td height="25" width="15%" align="left">
                          <p>查询到的产品信息</p>
                        </td>
                        <td colspan="4" align="left">
                <%

                 if(list!=null)
                 {
                   for(int i=0;i<list.size();i++)
                   {
                     Product pd=new Product();
                     pd=(Product)list.get(i);
%>

  <%=i+1%>.<a href="product3.jsp?pdid=<%=pd.getProduct_id()%>"><%=pd.getProduct_name()%></a><br>
                          <br>
        <%}}
%>                    </td>
                      </tr>
                    </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr align="right">
    <td colspan="2"></td>
  </tr>
</table>
  <form  name="form1" method="POST" action="search1.jsp" onsubmit="return checknull()">
  关键字:
  <input type="text" name="keys" value="<%=keys%>">
  <select name="searchid">
  <option selected value=0>所有</option>
    <option value=1>项目</option>
    <option value=2>厂商</option>
    <option value=3>产品</option>
  </select>
  <input type="submit" name="submit" value="搜索">
</form>

⌨️ 快捷键说明

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