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

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.*,java.net.*" 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. <script language="javascript" src="js/showimg.js"></script>
  8. <%@ include file ="top.jsp" %>
  9. <%!
  10.    String fun(String str)
  11.    {
  12.       try
  13.   {
  14.       return new String(str.getBytes("ISO8859_1"));
  15.   }
  16.   catch(Exception e)
  17.   {
  18.      return "";
  19.   }
  20.    }
  21. %>
  22. <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE>
  23. <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
  24. href="image/buyok_shop.css" type=text/css rel=stylesheet>
  25. <LINK 
  26. href="image/buyok_shop.css" type=text/css rel=stylesheet><LINK 
  27. href="image/table.css" type=text/css rel=stylesheet><LINK 
  28. href="image/buyok_shop.css" type=text/css rel=stylesheet>
  29. <STYLE type=text/css>.STYLE4 {
  30. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0072a8; TEXT-DECORATION: underline
  31. }
  32. .lei1 {
  33. FONT-SIZE: 13px
  34. }
  35. .STYLE5 {
  36. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0099cc
  37. }
  38. .red1 {
  39. COLOR: #ff0000
  40. }
  41. </STYLE>
  42. <%
  43. request.setCharacterEncoding("gb2312");
  44.   String pageSize="12";
  45.   //String str = new String(request.getParameter("something").getBytes("ISO-8859-1"),"utf-8") 
  46.   String proType=request.getParameter("proType"); //取得子类
  47.   String pageNum=(String)request.getParameter("pageNum"); //取得想要显示的页
  48.   String proNum=(String)request.getParameter("proNum");   // 取得类别编号
  49.   
  50.    productinfoBeans.setProType(proType);
  51. productinfoBeans.setProNum(proNum);
  52. productinfoBeans.setPageSize(Integer.parseInt(pageSize));
  53. productinfoBeans.setPageNum(pageNum);
  54. productinfoBeans.init();
  55.   
  56.     productinfoBeans.getQuery();  //查询
  57. int num=productinfoBeans.getItems();
  58. int pageCount=productinfoBeans.getPageCount();
  59. //String s=java.net.URLEncoder.encode(proType,"gb2312");
  60. //System.out.print(URLEncode.encode(proType,"utf-8"));
  61. %>
  62. <LINK href="image/table.css" type=text/css rel=stylesheet>
  63. <META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
  64. <BODY><LINK href="image/buyok_shop.css" type=text/css 
  65. rel=stylesheet>
  66. <LINK href="image/buyok_shop.css" type=text/css rel=stylesheet>
  67. <TABLE class=grayline cellSpacing=0 cellPadding=0 width=760 align=center 
  68. border=0>
  69.   <TBODY>
  70.   <TR>
  71.     <TD class=right vAlign=top align=left width=210 height=239 rowSpan=2>
  72.       <STYLE type=text/css>.STYLE4 {
  73. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0072a8; TEXT-DECORATION: underline
  74. }
  75. .STYLE5 {
  76. FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #0099cc
  77. }
  78. </STYLE>
  79.       <LINK href="image/buyok_shop.css" type=text/css 
  80.       rel=stylesheet>
  81.       <TABLE height=263 cellSpacing=0 cellPadding=0 width=200 align=left 
  82.       border=0>
  83.         <TBODY>
  84.         <TR>
  85.           <TD width=206 height=31><IMG height=50 
  86.             src="image/lei.gif" width=200></TD></TR>
  87.         <TR>
  88.           <TD vAlign=top align=middle height=189>
  89.             <TABLE height=226 cellSpacing=0 cellPadding=0 width=190 align=center 
  90.             background=image/leftlist_bg.jpg border=0>
  91.               <TBODY>
  92.               <TR>
  93.                 <TD vAlign=top align=middle 
  94.                 background=image/leftlist_bg.jpg bgColor=#ebebeb 
  95.                 height=189><TABLE cellSpacing=0 cellPadding=0 width="88%" 
  96.                         bgColor=#fafafa border=0>
  97.                   <TBODY>
  98.                     <TR>
  99.                       <TD background=image/erbook.com.htm 
  100.                             height=11>
  101.                         <TABLE height=9 cellSpacing=0 cellPadding=0 
  102.                               width="100%" align=center border=0>
  103.                           <TBODY>
  104.                             <TR>
  105.                               <TD   bgColor=#ffffff></TD>
  106.                             </TR>
  107.                           </TBODY>
  108.                       </TABLE></TD>
  109.                     </TR>
  110.                     <%
  111.  characterclassBeans.getQuery("-1");
  112. for(int i_c=0; i_c<characterclassBeans.getItems(); i_c++)//第一层循环读出大类
  113.     {
  114.   
  115. %>
  116.                     <TR>
  117.                       <TD style="PADDING-LEFT: 20px" 
  118.                             background=image/erbook.com.htm 
  119.                               height=23><IMG height=9 
  120.                               src="image/bit05.gif" width=8 
  121.                               align=absMiddle> <A class=lei1 
  122.                               onclick=javascript:ShowFLT(<%=(i_c+1)%>) 
  123.                               href="javascript:void(null)"><%=characterclassBeans.getCharacterName(i_c)%></A> </TD>
  124.                     </TR>
  125.                     <TR id=LM<%=(i_c+1)%> style="DISPLAY: none">
  126.                       <TD>
  127.                         <TABLE cellSpacing=2 cellPadding=0 width="100%" 
  128.                               border=0>
  129.                           <TBODY>
  130.                             <%
  131. int j_u=characterclassBeans.getCharacterID(i_c);
  132. int num1=useclassBeans.getQuerycha(j_u);
  133.  for(int i_q=0; i_q<num1; i_q++)
  134.  {
  135. %>
  136.                             <TR>
  137.                               <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")%>
  138. &pageNum=1&proNum=<%=useclassBeans.getUseclassID(i_q)%>"  target=_blank><%=useclassBeans.getUseclassName(i_q)%></A> </TD>
  139.                             </TR>
  140.                             <%}
  141. %>
  142.                           </TBODY>
  143.                       </TABLE></TD>
  144.                     </TR>
  145.                     <%}
  146. %>
  147.                     <TR id=LM18 style="DISPLAY: none">
  148.                       <TD>&nbsp; </TD>
  149.                     </TR>
  150.                   </TBODY>
  151.                 </TABLE>
  152. <SCRIPT language=javascript id=clientEventHandlersJS>
  153. <!--
  154. var number=3;
  155. function LMYC() {
  156. var lbmc;
  157. //var treePic;
  158.     for (i=1;i<=number;i++) {
  159.         lbmc = eval('LM' + i);
  160.         //treePic = eval('treePic'+i);
  161.         //treePic.src = 'images/file.gif';
  162.         lbmc.style.display = 'none';
  163.     }
  164. }
  165.  
  166. function ShowFLT(i) {
  167.     lbmc = eval('LM' + i);
  168.     //treePic = eval('treePic' + i)
  169.     if (lbmc.style.display == 'none') {
  170.         LMYC();
  171.         //treePic.src = 'images/nofile.gif';
  172.         lbmc.style.display = '';
  173.     }
  174.     else {
  175.         //treePic.src = 'images/file.gif';
  176.         lbmc.style.display = 'none';
  177.     }
  178. }
  179. //-->
  180.       </SCRIPT>
  181. </TD>
  182.               </TR></TBODY></TABLE><IMG 
  183.             height=9 src="image/leftlist_bottom.gif" 
  184.         width=190></TD></TR></TBODY></TABLE></TD>
  185.     <TD vAlign=top align=left width=550>
  186.       <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  187.         <TBODY>
  188.         <TR>
  189.           <TD><IMG height=201 src="image/tsfl_top.gif" 
  190.           width=550></TD></TR></TBODY></TABLE>
  191.       <DIV align=center>
  192.       <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  193.         <TBODY>
  194.         <TR>
  195.           <TD height=25><IMG height=11 src="image/jt_2.gif" 
  196.             width=11 align=absMiddle> 当前位置:<A 
  197.             href="default.jsp">首页</A>&gt;&gt;<A 
  198.             href="#">图书分类</A>&gt;&gt;&nbsp;<FONT 
  199.             class=orge size=2><B>
  200. <%=proType%></FONT></TD></TR>
  201.         <TR>
  202.           <TD background=image/bgline.gif 
  203.       height=1></TD></TR></TBODY></TABLE>
  204.       <TABLE>
  205.         <TBODY>
  206.  <%
  207.    
  208.   if(num==-1)
  209.   {
  210.   out.print("<table width="485" height="145"  border="0" align="center" cellpadding="0" cellspacing="0">");
  211.   out.print("<tr><td>对不起暂时没有您要的分类图书,请如需要请到<font color="red">留言板留言</font>我们尽快回复你的要求</td></tr>");
  212.   out.print("</table>");
  213.   }
  214.       else
  215.  
  216.  {
  217.  
  218.  
  219.     int t = (num%2 == 0)? num/2 : num/2+1;
  220.  for(int i=0; i<t; i++)//行数
  221. {
  222. %>  
  223.                     <TR>
  224.                   <%
  225.         for(int j=0;j<2;j++)//一行两个
  226.   {
  227.    if(2*i+j == num)
  228.      {
  229.           break;
  230.      }
  231.       %>
  232.           <TD>
  233.             <DIV></DIV>
  234.             <CENTER>
  235.             <TABLE cellSpacing=0 cellPadding=0 width=270 align=left 
  236.             bgColor=#cccccc border=0>
  237.               <TBODY>
  238.               <TR>
  239.                 <TD vAlign=center align=middle width=130 bgColor=#ffffff 
  240.                 height=130>
  241.                   <TABLE height=136 cellSpacing=0 cellPadding=0 width=116 
  242.                   align=center border=0>
  243.                     <TBODY>
  244.                     <TR>
  245.                       <TD vAlign=center align=middle 
  246.                       background=image/bg.jpg> 
  247.   <a href="listbook.jsp?proNum=<%=productinfoBeans.getProductID(2*i+j).replace('#', ',')%>&proType=<%=proType%>">
  248.   <%  
  249.   String proNum1=productinfoBeans.getProductID(2*i+j);
  250.   String proNum2=proNum1.replace(',','#');
  251.     productinfoBean.getNew(proNum2);
  252. String num1=productinfoBeans.getProductID(i).replace('#', '1');
  253. %>
  254.   <img src="product_image/<%=productinfoBeans.getMinPicture(2*i+j)%>"  onMouseOver="showBigImg('<%=productinfoBean.getMaxPicture()%>',<%=num1%>,event);" onMouseOut="mouseout('<%=productinfoBeans.getMinPicture(2*i+j)%>',event)" width="93" height="112" border="0"></a>
  255.   </TD></TR></TBODY></TABLE></TD>
  256.                 <TD vAlign=center align=left width=140 bgColor=#ffffff>
  257.                   <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  258.                     <TBODY>
  259.                     <TR>
  260.                       <TD height=25><A 
  261.                         href="http://www.erbook.com.cn/list.asp?sp_code=978780115677801" 
  262.                         target=_blank><SPAN 
  263.                         class=font_blu><%=productinfoBeans.getProductName(2*i+j)%></SPAN></A></TD></TR>
  264.                     <TR>
  265.                       <TD height=20>作者:<%=productinfoBeans.getAuthor(2*i+j)%> </TD></TR>
  266.                     <TR>
  267.                       <TD height=20>出版日期:<%=productinfoBeans.getShangData(2*i+j)%></TD></TR>
  268.                     <TR>
  269.                       <TD height=20>原 &nbsp;价:<%=productinfoBeans.getMarketPrice(2*i+j)%></TD></TR>
  270.                     <TR>
  271.                       <TD height=20>会员价:<SPAN class=red1>¥<A 
  272.                         class=font><%=productinfoBeans.getPreferPrice(2*i+j)%></A></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></TD>
  273.                     <%}%>
  274.   </TR>
  275.  <%
  276.   }
  277.   %>
  278.     </TBODY></TABLE></DIV></TD></TR>
  279.   <TR>
  280.     <TD vAlign=top align=left>
  281.       <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center 
  282.       bgColor=#ffffff border=0>
  283.         <TBODY>
  284.         <TR>
  285.           <TD height=10>
  286.             <HR id=hr width="100%" SIZE=1>
  287.           </TD></TR>
  288.            <tr>
  289.                
  290.                    <td height="23" align="center">
  291.                      <div align="right"><a href="prosort.jsp?proType=<%=proType%>&pageNum=1&proNum=<%=Integer.parseInt(proNum)%>">首页</a> 
  292.                        <% 
  293. if(Integer.parseInt(pageNum) > 1)
  294.    {
  295. %>
  296.                <a href="prosort.jsp?proType=<%=proType%>&pageNum=<%=Integer.parseInt(pageNum)-1%>&proNum=<%=Integer.parseInt(proNum)%>">上一页</a> &nbsp;
  297.                        <%
  298. }
  299. %>
  300.                        <% 
  301. if(Integer.parseInt(pageNum) < pageCount)
  302.    {
  303. %>
  304.                <a href="prosort.jsp?proType=<%=proType%>&pageNum=<%=Integer.parseInt(pageNum)+1%>&proNum=<%=Integer.parseInt(proNum)%>">下一页</a> &nbsp;
  305.                        <%
  306. }
  307. %>
  308.                        <a href="prosort.jsp?proType=<%=proType%>&pageNum=<%=pageCount%>&proNum=<%=Integer.parseInt(proNum)%>">尾页</a> 
  309. 页次:<STRONG><FONT 
  310.                   color=red><%=Integer.parseInt(pageNum)%></FONT>/<%=pageCount%></STRONG>页 &nbsp;</div></td>
  311.             </tr></TBODY></TABLE></TD></TR><%}%></TBODY></TABLE>
  312. <%@ include file ="foot.jsp" %>
  313. </BODY></HTML>