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

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.io.*,java.util.*" errorPage="" %>
  3. <jsp:useBean id="productinfoBean" class="MyFly.Bean.productinfoBean" scope="request"/>
  4. <jsp:useBean id="useclassBeans" class="MyFly.Bean.useclassBeans" scope="request"/>
  5. <jsp:useBean id="characterclassBeans" class="MyFly.Bean.characterclassBeans" scope="request"/>
  6. <jsp:useBean id="productvoteBean" class="MyFly.Bean.productvoteBean" scope="request"/>
  7. <jsp:useBean id="useclassBean" class="MyFly.Bean.useclassBean" scope="request"/>
  8. <jsp:useBean id="productremarkBeans" class="MyFly.Bean.productremarkBeans" scope="request"/>
  9. <%
  10.   request.setCharacterEncoding("gb2312");
  11. %>
  12. <script language="javascript">
  13. function openScript(url,name, width, height){
  14. var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
  15. }
  16. </script>
  17. <style type="text/css">
  18. <!--
  19. p{text-indent:2em}
  20. .style9 {color: #FF0000}
  21. -->
  22. </style>
  23. <%!
  24.  StringBuffer convert(StringBuffer sour){
  25. for(int i=0;i<sour.length();i++){
  26. if(sour.substring(i,i+1).equals("n")){
  27. sour.delete(i,i+1);
  28. sour.insert(i,"</p><p>");
  29. }
  30. }
  31. return sour;
  32. }
  33. %>
  34. <%@ include file ="top.jsp" %>
  35. <%!
  36.    String fun(String str)
  37.    {
  38.       try
  39.   {
  40.       return new String(str.getBytes("ISO8859_1"));
  41.   }
  42.   catch(Exception e)
  43.   {
  44.      return "";
  45.   }
  46.    }
  47. %>
  48. <%
  49.     String proType=fun(request.getParameter("proType"));
  50. String proNum=request.getParameter("proNum").replace(',', '#');
  51. productinfoBean.getNew(proNum);//传递的值
  52. %>
  53. <!-- saved from url=(0030)http://172.28.110.153/xnld.htm -->
  54. <HTML><HEAD><TITLE></TITLE>
  55. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  56. <META content="MSHTML 6.00.2800.1400" name=GENERATOR>
  57. <META content=JavaScript name=vs_defaultClientScript>
  58. <META content=http://schemas.microsoft.com/intellisense/ie5 
  59. name=vs_targetSchema>
  60. <STYLE type=text/css>
  61. TD {
  62. FONT-SIZE: 9pt; LETTER-SPACING: 0.02em
  63. }
  64. A {
  65. COLOR: #000000; TEXT-DECORATION: none
  66. }
  67. A:hover {
  68. COLOR: red; TEXT-DECORATION: none}
  69. .hg {
  70. LINE-HEIGHT: 18px
  71. }
  72. .whitetx {
  73. COLOR: #ffffff
  74. }
  75. .ibox {
  76. BORDER-RIGHT: #ff386b 1px solid; BORDER-TOP: #ff386b 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #ff386b 1px solid; BORDER-BOTTOM: #ff386b 1px solid; HEIGHT: 16px; BACKGROUND-COLOR: #ffe6ed
  77. }
  78. .style3 {color: #FF0099}
  79. .style4 {color: #000000}
  80. a:link {
  81. text-decoration: none;
  82. }
  83. a:visited {
  84. text-decoration: none;
  85. }
  86. a:active {
  87. text-decoration: none;
  88. }
  89. body {
  90. background-image: url(image/bk.jpg);
  91. }
  92. .sec1 {
  93. BORDER-RIGHT: gray 2px solid; BORDER-TOP: #ffffff 2px solid; BORDER-LEFT: #ffffff 2px solid; CURSOR: hand; COLOR: #000000; BORDER-BOTTOM: #ffffff 2px solid; BACKGROUND-COLOR: #eeeeee
  94. }
  95. .sec2 {
  96. BORDER-RIGHT: gray 1px solid; BORDER-TOP: #000000 1px solid; FONT-WEIGHT: bold; BORDER-LEFT: #ffffff 1px solid; CURSOR: hand; COLOR: #000000; BACKGROUND-COLOR: #000000
  97. }
  98. .main_tab {
  99. BORDER-RIGHT: gray 1px solid; BORDER-LEFT: #ffffff 1px solid; COLOR: #000000; BORDER-BOTTOM: gray 1px solid; BACKGROUND-COLOR: #d4d0c8
  100. }
  101. </STYLE>
  102. <BODY leftMargin=0 topMargin=0>
  103. <table width="771" height="665" border="0" align="center" cellspacing="0" bgcolor="#FFFFFF">
  104.   <tr valign="middle">
  105.     <td width="159" height="55" background="image/spfl1.jpg">&nbsp;</td>
  106.     <td width="608" rowspan="4" valign="top"><table width="100%" height="664"  border="0" cellspacing="0">
  107.         <tr>
  108.           <td height="25" valign="top" bgcolor="#FFFFFF"><table width="80%"  border="0">
  109.               <tr bgcolor="#FFFFFF">
  110.                 <td width="8%">&nbsp;</td>
  111.                 <td width="92%"><img src="image/xz07.gif" width="16" height="16"> <strong>当前位置: </strong><a href="index.jsp">首页</a><strong> --&gt; </strong>产品详情 <span class="style9"><a href="shopcar/shoplist.jsp">我的购物车</a> <a href="shopcar/listinfo.jsp">订单信息</a></span></td>
  112.               </tr>
  113.           </table>
  114.           </td>
  115.         </tr>
  116.         <tr>
  117.           <td height="638" valign="top" bgcolor="#FFFFFF"><table width="103%" height="636"  border="0" cellspacing="0">
  118.             <tr bgcolor="#FFFFFF">
  119.               <td width="40%" height="213" align="right"><table width="84%" height="189"  border="1" bordercolor="#66CCCC">
  120.                   <tr>
  121.                     <td align="center" bordercolor="#FFFFFF"><img src="product_image/<%=productinfoBean.getMaxPicture()%>" width="165" height="181"></td>
  122.                   </tr>
  123.               </table></td>
  124.               <td width="60%" align="center" valign="middle">
  125.                 <table width="58%" height="152"  border="0" cellspacing="0">
  126.                     <tr>
  127.                       <td width="205" height="20">产品名称:&nbsp;&nbsp;<%=productinfoBean.getProductName()%> </td>
  128.                     </tr>
  129.                     <tr>
  130.                       <td height="20">产品编号:&nbsp;&nbsp;<%=proNum%> </td>
  131.                     </tr>
  132.                     <tr>
  133.                       <td height="20">所属类别:&nbsp;&nbsp;<%=proType%></td>
  134.                     </tr>
  135.                     <tr>
  136.                       <td height="20">市场价:&nbsp;&nbsp;&nbsp;&nbsp;<%=productinfoBean.getMarketPrice()%></td>
  137.                     </tr>
  138.                     <tr>
  139.                       <td height="20">优惠价:&nbsp;&nbsp;&nbsp;&nbsp;<%=productinfoBean.getPreferPrice()%> </td>
  140.                     </tr>
  141.                     <tr>
  142.                       <td height="20">上货日期:&nbsp;&nbsp;<%=productinfoBean.getShangData()%></td>
  143.                     </tr>
  144.                     <tr>
  145.                       <td height="20">产品库存:&nbsp;&nbsp;<%=productinfoBean.getStorage()%></td>
  146.                     </tr>
  147. <tr>
  148.                       <td height="20"><a href="#" onclick="openScript('purchase.jsp?bookid=<%= proNum %>','pur',300,250)">放入购物车</a></td>
  149.                     </tr>
  150.               </table></td></tr>
  151.             <tr align="left" valign="middle">
  152.               <td height="11" colspan="2">
  153.                 <table width="100%"  border="0" cellspacing="0">
  154.                   <tr>
  155.                     <td width="1%">&nbsp;</td>
  156.                     <td width="99%"><hr width="550" size="4" noshade  color="#009999"></td>
  157.                   </tr>
  158.               </table></td>
  159.             </tr>
  160.             <tr align="left" valign="middle">
  161.               <td height="11" colspan="2"><table width="96%"  border="0" cellspacing="0">
  162.                 <tr>
  163.                   <td width="13%" height="25">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  164.                   <td width="87%">用户已经发表的评论:</td>
  165.                 </tr>
  166.                 <%
  167.      productremarkBeans.getQuery("5",proNum);
  168.  if(productremarkBeans.getItems() > 0)
  169.  {
  170.      for(int i=0; i<productremarkBeans.getItems(); i++)
  171.  {
  172.     out.println("<tr><td>&nbsp;</td><td height="25">"+"<font color=red>标题:</font>"+" "+convert(new StringBuffer(productremarkBeans.getTitle(i)))+"<br>"+"<font color=blue>内容:</font>"+" "+convert(new StringBuffer(productremarkBeans.getContent(i)))+"</td></tr>");
  173.  }
  174.  }
  175.  else
  176.  {
  177.       out.println("<tr><td>&nbsp;</td><td height="25">"+"<font color=red>暂时还没有该产品的用户评论</font>"+"</td></tr>");
  178.   }
  179.  %>
  180.               </table></td>
  181.             </tr>
  182.             <tr align="center" valign="top">
  183.               <td height="340" colspan="2"><SCRIPT language=javascript>
  184.      function secBoard(n)
  185.   {
  186.     for(i=0;i<secTable.cells.length;i++)
  187.       secTable.cells[i].className="sec1";
  188.     secTable.cells[n].className="sec2";
  189.     for(i=0;i<mainTable.tBodies.length;i++)
  190.       mainTable.tBodies[i].style.display="none";
  191.     mainTable.tBodies[n].style.display="block";
  192.   }
  193.                   </SCRIPT>
  194.                     <!--HTML部分-->
  195.                 <TABLE width=440 height="40" border=0 cellPadding=0 cellSpacing=0 id=secTable>
  196.                     <TBODY>
  197.                       <TR align=middle height=20>
  198.                         <TD width="29%"  height="40" class=sec2 onclick=secBoard(0)><img src="image/cpjs.jpg" width="151" height="41"></TD>
  199.                         <TD class=sec1 onclick=secBoard(1) width="29%"><img src="image/yhpl.jpg" width="151" height="41"></TD>
  200.                         <TD class=sec1 onclick=secBoard(2) width="42%"><img src="image/cptp.jpg" width="151" height="41"></TD>
  201.                       </TR>
  202.                     </TBODY>
  203.                   </TABLE>
  204.                   <TABLE width=513 height=333 border=0 align="center" 
  205.             cellPadding=0 cellSpacing=0   id=mainTable>
  206.                     <!--关于TBODY标记-->
  207.                     <TBODY style="DISPLAY: block">
  208.                       <TR>
  209.                         <TD width="551" height="18" align=center vAlign=top>
  210.                           <TABLE cellSpacing=0 cellPadding=0 width=482 border=0>
  211.                             <TBODY>
  212.                               <TR background="image/dgnbg1.jpg"> <% 
  213.        StringBuffer str=new StringBuffer(productinfoBean.getIntroduce());
  214.                                    str=convert(str);
  215. %>
  216.                                 <TD height="54" align="center" background="image/dgnbg1.jpg">&nbsp;&nbsp;&nbsp;                                  <table width="94%" height="48"  border="0" cellspacing="0">
  217.                                     <tr>
  218.                                       <td width="3%" height="39">&nbsp;</td>
  219.                                       <td width="94%"><%=str%></td>
  220.                                       <td width="3%">&nbsp;</td>
  221.                                     </tr>
  222.                                   </table></TD>
  223.                               </TR>
  224.                               <TR>
  225.                                 <TD height="9" background="image/dgnbg2.jpg">&nbsp;</TD>
  226.                               </TR>
  227.                             </TBODY>
  228.                           </TABLE>
  229.                         </TD>
  230.                       </TR>
  231.                     </TBODY>
  232.                     <!--关于cells集合-->
  233.                     <TBODY style="DISPLAY: none">
  234.                       <TR>
  235.                         <TD height="147" align=center vAlign=top><table width="94%"  border="0" cellspacing="0">
  236.                               <tr>
  237.                                 <td width="480" height="73" align="center" background="image/dgnbg1.jpg"><TABLE cellSpacing=0 cellPadding=0 width=447 border=0>
  238.                                   <TBODY>
  239.                                     <TR>
  240.                                       <TD height="145"><form name="form1" method="post" action="productremark.jsp?proType=<%=proType%>&proNum=<%=proNum.replace('#', ',')%>">
  241.                                           <table width="100%"  border="0" cellspacing="0">
  242.                                             <tr>
  243.                                               <td width="22%" height="39" align="center" valign="middle">评论标题:</td>
  244.                                               <td width="78%"valign="middle"><input type="text" height="20" name="title" size="30"></td>
  245.                                             </tr>
  246.                                             <tr>
  247.                                               <td align="center" valign="top">评论内容:</td>
  248.                                               <td><textarea name="content" cols="45" rows="5"></textarea></td>
  249.                                             </tr>
  250.                                             <tr>
  251.                                               <td valign="top">&nbsp;</td>
  252.                                               <td><input type="submit" name="Submit" value="提交">
  253.                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  254.                                                 <input type="reset" name="Submit2" value="清除"></td>
  255.                                             </tr>
  256.                                           </table>
  257.                                       </form></TD>
  258.                                     </TR>
  259.                                   </TBODY>
  260.                                 </TABLE></td>
  261.                               </tr>
  262.                               <tr>
  263.                                 <td height="9" align="center" background="image/dgnbg2.jpg">&nbsp;</td>
  264.                               </tr>
  265.                             </table></TD>
  266.                       </TR>
  267.                     </TBODY>
  268.                     <!--关于tBodies集合-->
  269.                     <TBODY style="DISPLAY: none">
  270.                       <TR>
  271.                         <TD height="168" align=center vAlign=top>
  272.                             <table width="94%"  border="0" cellspacing="0">
  273.                               <tr>
  274.                                 <td background="image/dgnbg1.jpg"><TABLE cellSpacing=0 cellPadding=0 width=477 border=0>
  275.                                   <TBODY>
  276.                                     <TR>
  277.                                       <TD width="477" height="168" align="center" valign="middle">
  278.   <form name="form2" method="post" action="productvote.jsp?proType=<%=proType%>&proNum=<%=proNum.replace('#', ',')%>">
  279.                                           <table width="80%"  border="0" cellspacing="0">
  280.                                             <tr>
  281.                                               <td width="10%" height="24">&nbsp;</td>
  282.                                               <td width="90%">请选择您对该产品的评价:&nbsp;&nbsp;&nbsp;</td>
  283.                                             </tr>
  284.                                             <tr>
  285.                                               <td>&nbsp;</td>
  286.                                               <td>很好:
  287.                                                   <input name="productvote" type="radio" value="best" checked>
  288.                 好:
  289.                 <input name="productvote" type="radio" value="good">
  290.                 一般:
  291.                 <input type="radio" name="productvote" value="middle">
  292. &nbsp; 差:
  293.                 <input type="radio" name="productvote" value="bad">
  294. &nbsp;&nbsp;&nbsp;
  295.                 <input type="submit" name="Submit3" value="提交"></td>
  296.                                             </tr>
  297.                                           </table>
  298.                                         </form>
  299.                                           <table width="93%"  border="0" cellspacing="0">
  300.                                             <tr>
  301.                                               <td width="16%">&nbsp;</td>
  302.                                               <td width="84%"><%
  303.     
  304.     int good;
  305. int best;
  306. int middle;
  307. int bad;
  308. int total_p;
  309.    if(productvoteBean.getNew(proNum))
  310.    {
  311.        best=productvoteBean.getGood();
  312.        good=productvoteBean.getBest();
  313.    middle=productvoteBean.getMiddle();
  314.    bad=productvoteBean.getBad();
  315.    total_p=good+middle+bad+best;
  316. }
  317. else
  318. {
  319.     good=0;
  320. middle=0;
  321. bad=0;
  322. best=0;
  323. total_p=0;
  324. }
  325. %></td>
  326.                                             </tr>
  327.                                             <tr>
  328.                                               <td height="25">&nbsp;</td>
  329.                                               <td>已经有 <font color="#FF0000"><%=total_p%> </font>位 客人 投票</td>
  330.                                             </tr>
  331.                                             <tr>
  332.                                               <td height="24">&nbsp;</td>
  333.                                               <td>投票结果:</td>
  334.                                             </tr>
  335.                                           </table>
  336.                                           <table width="100%"  border="0" cellspacing="0">
  337.                                             <tr>
  338.                                               <td width="18%">&nbsp;</td>
  339.                                               <td width="18%">很好:<font color="#FF0000"><%=best%></font>人</td>
  340.                                               <td width="17%">好:<font color="#FF0000"><%=good%></font>人</td>
  341.                                               <td width="16%">一般:<font color="#FF0000"><%=middle%></font>人</td>
  342.                                               <td width="30%">差:<font color="#FF0000"><%=bad%></font>人</td>
  343.                                             </tr>
  344.                                         </table></TD>
  345.                                     </TR>
  346.                                   </TBODY>
  347.                                 </TABLE></td>
  348.                               </tr>
  349.                               <tr>
  350.                                 <td height="9" background="image/dgnbg2.jpg">&nbsp;</td>
  351.                               </tr>
  352.                             </table>                          </TD>
  353.                       </TR>
  354.                     </TBODY>
  355.                 </TABLE></td>
  356.             </tr>
  357.           </table></td>
  358.         </tr>
  359.     </table></td>
  360.   </tr>
  361.   <tr valign="top">
  362.     <td height="315" align="center" background="image/spfl22.jpg"><table width="97%" height="313"  border="0" cellspacing="0">
  363.       <tr>
  364.         <td height="313" valign="top"><table width="99%" height="124"  border="0" cellspacing="0">
  365.             <tr>
  366.               <td height="124" valign="top"><table width="151" height="86" cellpadding="0" cellspacing="0">
  367.                   <tr>
  368.                     <td height="23" colspan="2" valign="middle">&nbsp;&nbsp;<span class="style3">---- <font  style="font-size:13px;font-weight: bold">用途类别 ----</font></span></td>
  369.                   </tr>
  370.                   <%
  371.    useclassBeans.getQuery("-1");
  372.    for(int i=0; i<useclassBeans.getItems(); i++)
  373.    {
  374.      %>
  375.                   <tr>
  376.                     <td width="18" height="18" align="center" valign="middle">·</td>
  377.                     <td width="129" valign="middle" class="left"><a href="jjyp.jsp?proType=useType&pageNum=1&proNum=<%=useclassBeans.getUseclassID(i)%>"><%=useclassBeans.getUseclassName(i)%></a></td>
  378.                   </tr>
  379.                   <%
  380. }
  381. %>
  382.                   <tr>
  383.                     <td height="25" colspan="2" valign="middle">&nbsp;<span class="style3">&nbsp;---- <font  style="font-size:13px;font-weight: bold">性质类别 ----</font></span><font  style="font-size:13px;font-weight: bold">&nbsp; </font></td>
  384.                   </tr>
  385.                   <%
  386.  characterclassBeans.getQuery("-1");
  387.    for(int i=0; i<characterclassBeans.getItems(); i++)
  388.    {
  389.      %>
  390.                   <tr>
  391.                     <td width="18" height="18" align="center" valign="middle">·</td>
  392.                     <td width="129" valign="middle" class="left"><a href="jjyp.jsp?proType=characterType&pageNum=1&proNum=<%=characterclassBeans.getCharacterID(i)%>"><%=characterclassBeans.getCharacterName(i)%></a></td>
  393.                   </tr>
  394.                   <%
  395. }
  396. %>
  397.               </table></td>
  398.             </tr>
  399.         </table></td>
  400.       </tr>
  401.     </table>    </td>
  402.   </tr>
  403.   <tr valign="top">
  404.     <td height="55" align="center" background="image/yqlj.jpg">&nbsp;</td>
  405.   </tr>
  406. </table>
  407. <%@ include file ="foot.jsp"%>
  408. </BODY></HTML>