searchPro1.jsp
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:14k
源码类别:

Applet

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.lang.*" errorPage="" %>
  3. <jsp:useBean id="productinfoBeans" class="MyFly.Bean.productinfoBeans" scope="request"/>
  4. <jsp:useBean id="productinfoBean" class="MyFly.Bean.productinfoBean" scope="request"/>
  5. <jsp:useBean id="useclassBeans" class="MyFly.Bean.useclassBeans" scope="request"/>
  6. <jsp:useBean id="characterclassBeans" class="MyFly.Bean.characterclassBeans" scope="request"/>
  7. <%@ include file ="top.jsp" %>
  8. <script language="javascript" src="js/showimg.js"></script>
  9. <script language="javascript">
  10. function openScript(url,name, width, height){
  11. var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
  12. }
  13. </script>
  14. <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE>
  15. <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
  16. href="image/buyok_shop.css" type=text/css rel=stylesheet>
  17. <LINK 
  18. href="image/buyok_shop.css" type=text/css rel=stylesheet><LINK 
  19. href="image/table.css" type=text/css rel=stylesheet><LINK 
  20. href="image/buyok_shop.css" type=text/css rel=stylesheet>
  21. <STYLE type=text/css>.STYLE4 {
  22. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0072a8; TEXT-DECORATION: underline
  23. }
  24. .lei1 {
  25. FONT-SIZE: 13px
  26. }
  27. .STYLE5 {
  28. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0099cc
  29. }
  30. .red1 {
  31. COLOR: #ff0000
  32. }
  33. </STYLE>
  34. <%
  35.    request.setCharacterEncoding("gb2312");
  36.    String pageSize="5";
  37.    String protype="searchPro";
  38.   //String KeyWords=new String(request.getParameter("keywords").getBytes("8859_1")); //取得子类getyong
  39.    String KeyWords=request.getParameter("keywords");
  40.    String pageNum=request.getParameter("pageNum");
  41.      //if(KeyWords==" "||KeyWords==null)
  42.  // {   
  43.       //out.println("<Script language=JavaScript>alert('请填写搜索的内容');JavaScript:history.back();</Script>");
  44.  // }
  45.    //String url=request.getRequestURI();
  46.    productinfoBeans.setName(KeyWords);
  47.    productinfoBeans.setProType(protype);
  48.    productinfoBeans.setPageSize(Integer.parseInt(pageSize)); 
  49.    productinfoBeans.setPageNum(pageNum);
  50.    productinfoBeans.init();
  51.    productinfoBeans.selectProductName(KeyWords);
  52.    int num=productinfoBeans.getItems();
  53.    int pageCount=productinfoBeans.getPageCount();
  54.    //System.out.print(proNum);
  55.   ///System.out.println(url);
  56.   
  57.    //productinfoBeans.setProType(proType);
  58. ///productinfoBeans.setProNum(proNum);
  59. //productinfoBeans.setPageSize(Integer.parseInt(pageSize));
  60. //productinfoBeans.setPageNum(pageNum);
  61. //productinfoBeans.init();
  62.   
  63.     //productinfoBeans.getQuery();  //查询
  64. //int num=productinfoBeans.getItems();
  65. //int pageCount=productinfoBeans.getPageCount();
  66. //
  67. %>
  68. <LINK href="image/table.css" type=text/css rel=stylesheet>
  69. <META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
  70. <BODY><LINK href="image/buyok_shop.css" type=text/css 
  71. rel=stylesheet>
  72. <STYLE type=text/css>BODY {
  73. MARGIN: 0px
  74. }
  75. .STYLE1 {
  76. COLOR: #ff3300
  77. }
  78. .STYLE2 {
  79. COLOR: #ff0000
  80. }
  81. </STYLE>
  82. <META name=KEYWords 
  83. contect="网上书城,网上购书,书,买书,卖书,购书,网上书店,广东,东莞,永正,购书中心,文学,经济,工商,计算机,电脑,教育,音像,电子,医药卫生,建筑工业,艺术,法律,历史,外语,儿童,动漫,小说">
  84. <STYLE type=text/css>BODY {
  85. FONT-SIZE: 12px
  86. }
  87. TD {
  88. FONT-SIZE: 12px
  89. }
  90. TH {
  91. FONT-SIZE: 12px
  92. }
  93. BODY {
  94. MARGIN: 0px
  95. }
  96. </STYLE>
  97. <LINK href="image/buyok_shop.css" type=text/css rel=stylesheet>
  98. <TABLE class=grayline cellSpacing=0 cellPadding=0 width=760 align=center 
  99. border=0>
  100.   <TBODY>
  101.   <TR>
  102.     <TD class=right vAlign=top align=left width=210 height=239 rowSpan=2>
  103.       <STYLE type=text/css>.STYLE4 {
  104. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0072a8; TEXT-DECORATION: underline
  105. }
  106. .STYLE5 {
  107. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0099cc
  108. }
  109. </STYLE>
  110.       <LINK href="image/buyok_shop.css" type=text/css 
  111.       rel=stylesheet>
  112.       <TABLE height=263 cellSpacing=0 cellPadding=0 width=200 align=left 
  113.       border=0>
  114.         <TBODY>
  115.         <TR>
  116.           <TD width=206 height=31><IMG height=50 
  117.             src="image/lei.gif" width=200></TD></TR>
  118.         <TR>
  119.           <TD vAlign=top align=middle height=189>
  120.             <TABLE height=226 cellSpacing=0 cellPadding=0 width=190 align=center 
  121.             background=image/leftlist_bg.jpg border=0>
  122.               <TBODY>
  123.               <TR>
  124.                 <TD vAlign=top align=middle 
  125.                 background=image/leftlist_bg.jpg bgColor=#ebebeb 
  126.                 height=189><TABLE cellSpacing=0 cellPadding=0 width="88%" 
  127.                         bgColor=#fafafa border=0>
  128.                   <TBODY>
  129.                     <TR>
  130.                       <TD background=image/erbook.com.htm 
  131.                             height=11>
  132.                         <TABLE height=9 cellSpacing=0 cellPadding=0 
  133.                               width="100%" align=center border=0>
  134.                           <TBODY>
  135.                             <TR>
  136.                               <TD   bgColor=#ffffff></TD>
  137.                             </TR>
  138.                           </TBODY>
  139.                       </TABLE></TD>
  140.                     </TR>
  141.                     <%
  142.  characterclassBeans.getQuery("-1");
  143. for(int i_c=0; i_c<characterclassBeans.getItems(); i_c++)//第一层循环读出大类
  144.     {
  145.   
  146. %>
  147.                     <TR>
  148.                       <TD style="PADDING-LEFT: 20px" 
  149.                             background=image/erbook.com.htm 
  150.                               height=23><IMG height=9 
  151.                               src="image/bit05.gif" width=8 
  152.                               align=absMiddle> <A class=lei1 
  153.                               onclick=javascript:ShowFLT(<%=(i_c+1)%>) 
  154.                               href="javascript:void(null)"><%=characterclassBeans.getCharacterName(i_c)%></A> </TD>
  155.                     </TR>
  156.                     <TR id=LM<%=(i_c+1)%> style="DISPLAY: none">
  157.                       <TD>
  158.                         <TABLE cellSpacing=2 cellPadding=0 width="100%" 
  159.                               border=0>
  160.                           <TBODY>
  161.                             <%
  162. int j_u=characterclassBeans.getCharacterID(i_c);
  163. int num1=useclassBeans.getQuerycha(j_u);
  164.  for(int i_q=0; i_q<num1; i_q++)
  165.  {
  166. %>
  167.                             <TR>
  168.                               <TD style="PADDING-LEFT: 40px" height=23> <IMG height=7 src="image/bit06.gif" width=8 align=absMiddle> <A  href="prosort.jsp?proType=<%=java.net.URLEncoder.encode(useclassBeans.getUseclassName(i_q),"utf-8")%>
  169. &pageNum=1&proNum=<%=useclassBeans.getUseclassID(i_q)%>"  target=_blank><%=useclassBeans.getUseclassName(i_q)%></A> </TD>
  170.                             </TR>
  171.                             <%}
  172. %>
  173.                           </TBODY>
  174.                       </TABLE></TD>
  175.                     </TR>
  176.                     <%}
  177. %>
  178.                     <TR id=LM18 style="DISPLAY: none">
  179.                       <TD>&nbsp; </TD>
  180.                     </TR>
  181.                   </TBODY>
  182.                 </TABLE>
  183.                 <SCRIPT language=javascript id=clientEventHandlersJS>
  184. <!--
  185. var number=3;
  186. function LMYC() {
  187. var lbmc;
  188. //var treePic;
  189.     for (i=1;i<=number;i++) {
  190.         lbmc = eval('LM' + i);
  191.         //treePic = eval('treePic'+i);
  192.         //treePic.src = 'images/file.gif';
  193.         lbmc.style.display = 'none';
  194.     }
  195. }
  196.  
  197. function ShowFLT(i) {
  198.     lbmc = eval('LM' + i);
  199.     //treePic = eval('treePic' + i)
  200.     if (lbmc.style.display == 'none') {
  201.         LMYC();
  202.         //treePic.src = 'images/nofile.gif';
  203.         lbmc.style.display = '';
  204.     }
  205.     else {
  206.         //treePic.src = 'images/file.gif';
  207.         lbmc.style.display = 'none';
  208.     }
  209. }
  210. //-->
  211.       </SCRIPT>
  212. </TD>
  213.               </TR></TBODY></TABLE><IMG 
  214.             height=9 src="image/leftlist_bottom.gif" 
  215.         width=190></TD></TR></TBODY></TABLE></TD>
  216.     <TD vAlign=top align=left width=550>
  217.       <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  218.         <TBODY>
  219.         <TR>
  220.           <TD><IMG height=201 src="image/tops.gif" 
  221.           width=550></TD></TR></TBODY></TABLE>
  222.       <DIV align=center>
  223.       <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  224.         <TBODY>
  225.         <TR>
  226.           <TD height=25><IMG height=11 src="image/jt_2.gif" 
  227.             width=11 align=absMiddle>  <strong>当前位置:</strong><a href="default.jsp">首页</a><strong>—&gt; </strong>搜索结果 <FONT 
  228.             class=orge size=2><B></FONT></TD>
  229.         </TR>
  230.         <TR>
  231.           <TD background=image/bgline.gif 
  232.       height=1></TD></TR></TBODY></TABLE>
  233.   <%
  234.   if(num==-1)
  235.   {
  236.   out.print("<table width="485" height="145"  border="0" align="center" cellpadding="0" cellspacing="0">");
  237.       out.print("<tr><td>对不起暂时没有您要的图书,请试试<font color="red">高级查询</font></td></tr>");
  238.   out.print("</table>");
  239.   } 
  240.   else
  241.   {
  242.   for(int i=0;i<num;i++)
  243.   {
  244.   %>
  245.       <table width="485" height="145"  border="0" align="center" cellpadding="0" cellspacing="0">
  246.         <tr>
  247.           <td><img src="image/bg_top.jpg" width="485" height="14"></td>
  248.         </tr>
  249.         <tr>
  250.           <td height="128" align="left" valign="top" background="image/bg_line.jpg"><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  251.               <tr>
  252.                 <td width="170"  align="center" valign="top"><table width="116" height="136"  border="0" cellpadding="0" cellspacing="0">
  253.                     <tr>
  254.                       <td align="center" valign="middle" background="image/bg.jpg"> 
  255.   <a href="listbook.jsp?proNum=<%=productinfoBeans.getProductID(i).replace('#', ',')%>">
  256.   <%  
  257.   String proNum1=productinfoBeans.getProductID(i);
  258.   String proNum2=proNum1.replace(',','#');
  259.     productinfoBean.getNew(proNum2);
  260. String num1=productinfoBeans.getProductID(i).replace('#', '1');
  261. %>
  262. <img src="product_image/<%=productinfoBeans.getMinPicture(i)%>"  onMouseOver="showBigImg('<%=productinfoBean.getMaxPicture()%>',<%=num%>,event);" onMouseOut="mouseout('<%=productinfoBeans.getMinPicture(i)%>',event)" width="93" height="112" border="0"></a>
  263.   </td>
  264.                     </tr>
  265.                 </table></td>
  266.                 <td width="65%" align="left" valign="top"><table width=100% border=0 cellpadding="0" cellspacing="0" style="table-layout:fixed;word-break:break-all">
  267.                     <tr>
  268.                       <td height=20 width=77>【书&nbsp; 名】</td>
  269.                       <td width="228" height="25"><%=productinfoBeans.getProductName(i)%></td>
  270.                     </tr>
  271.                     <tr>
  272.                       <td height=20>【作 &nbsp;者】</td>
  273.                       <td height="20"><%=productinfoBeans.getAuthor(i)%> </td>
  274.                     </tr>
  275.                     <tr>
  276.                       <td height="20" valign=middle>【出版社】</td>
  277.                       <td height="20"><%=productinfoBeans.getPublish(i)%></td>
  278.                     </tr>
  279.                     <tr>
  280.                       <td height="20" valign=middle>【上架日期】</td>
  281.                       <td height="20" ><%=productinfoBeans.getShangData(i)%></td>
  282.                     </tr>
  283.                     <tr>
  284.                       <td width=77 height="20" valign=middle>【商品价格】</td>
  285.                       <td height="20" >原价:<%=productinfoBeans.getMarketPrice(i)%>&nbsp;&nbsp;&nbsp;会员价:<span class="red1">¥<a class="font"><%=productinfoBeans.getPreferPrice(i)%></a></span></td>
  286.                     </tr>
  287.                     <tr>
  288.                       <td height="35" colspan=2 align=center><a href=listbook.jsp?proType=<%=productinfoBeans.getUseclassID(i)%>&proNum=<%=productinfoBeans.getProductID(i).replace('#', ',')%>><img src=image/xiangxi.jpg alt=详细了解 width="102" height="32" border=0 align="left"></a> <span style="CURSOR: hand" onClick="openScript('purchasecart.jsp?bookid=<%=num1 %>','pur',650,300);"><img src=image/buynow.jpg alt=千寻万觅,要的就是她 width="90" height="32" border=0></span>  <SPAN style="CURSOR: hand" 
  289.                               onclick="openScript('UserCenter/collection.jsp?bookid=<%= num1 %>','collection',650,300);"> <img src=image/favnow.jpg alt=好东东,收藏起来先 width="90" height="32" border=0></span> </td>
  290.                     </tr>
  291.                 </table></td>
  292.               </tr>
  293.           </table></td>
  294.         </tr>
  295.         <tr>
  296.           <td><img src="image/bg_bt.jpg" width="485" height="14"></td>
  297.         </tr>
  298.       </table>
  299.   <%}}%>
  300.       </DIV></TD></TR>
  301.   <TR>
  302.     <TD vAlign=top align=left>
  303.       <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center 
  304.       bgColor=#ffffff border=0>
  305.         <TBODY>
  306.         <TR>
  307.           <TD height=10>
  308.             <HR id=hr width="100%" SIZE=1>
  309.           </TD></TR>
  310.            <tr>
  311.                
  312.                    <td height="23" align="center">
  313. <!-- 放分页代码-->
  314.    <div align="right"><a href="searchPro1.jsp?pageNum=<%=Integer.parseInt(pageNum)%>&keywords=<%=KeyWords%>">首页</a> 
  315.                        <% 
  316.     if(Integer.parseInt(pageNum) > 1)
  317.    {
  318. %>
  319.                <a href="searchPro1.jsp?pageNum=<%=Integer.parseInt(pageNum)-1%>&keywords=<%=KeyWords%>">上一页</a> &nbsp;
  320.                        <%
  321. }
  322. %>
  323.                        <% 
  324. if(Integer.parseInt(pageNum) < pageCount)
  325.    {
  326. %>
  327.                <a href="searchPro1.jsp?pageNum=<%=Integer.parseInt(pageNum)+1%>&keywords=<%=KeyWords%>">下一页</a> &nbsp;
  328.                        <%
  329. }
  330. %>
  331.                        <a href="searchPro1.jsp?pageNum=<%=pageCount%>&keywords=<%=KeyWords%>">尾页</a> 
  332. 页次:<STRONG><FONT color=red><%=Integer.parseInt(pageNum)%></FONT>/<%=pageCount%></STRONG>页 &nbsp;</div>
  333.                    </td>
  334.             </tr></TBODY></TABLE></TD></TR></TBODY></TABLE>
  335. <%@ include file ="foot.jsp" %>
  336. </BODY></HTML>