ShowProducts.jsp
上传用户:sxychgz
上传日期:2019-04-21
资源大小:4772k
文件大小:11k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page language="java" import="com.bjsxt.shopping.product.*"
  2. pageEncoding="GBK"%>
  3. <%@ page import="java.util.*"%>
  4. <%
  5. final int PAGE_SIZE = 8;
  6. int pageNo = 1;
  7. String strPageNo = request.getParameter("pageNo");
  8. if (strPageNo != null && !strPageNo.trim().equals("")) {
  9. try {
  10. pageNo = Integer.parseInt(strPageNo);
  11. } catch (NumberFormatException e) {
  12. pageNo = 1;
  13. }
  14. }
  15. if (pageNo <= 0)
  16. pageNo = 1;
  17. int categoryId = Integer.parseInt(request
  18. .getParameter("categoryId"));
  19. List<Product> products = new ArrayList<Product>();
  20. int totalRecords = ProductMgr.getInstance().find(products, pageNo,
  21. PAGE_SIZE, categoryId);
  22. int totalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE;
  23. if (pageNo > totalPages)
  24. pageNo = totalPages;
  25. %>
  26. <html>
  27. <head>
  28. <meta http-equiv="Content-Language" content="zh-cn">
  29. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  30. <title>- ThinkPad配件 - 内存 新品上市:3M笔记本防窥片</title>
  31. <link href="images/new.css" rel="stylesheet" type="text/css">
  32. <script language="javascript1.2">
  33. function js_callpage(htmlurl)
  34. {
  35. var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top=2,width=360,height=470');
  36. return false;
  37. }
  38. function js_callpage1(htmlurl)
  39. {
  40. var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=2,width=100,height=100');
  41. return false;
  42. }
  43. </script>
  44. </head>
  45. <body>
  46. <table align="left" border="0" cellpadding="0" cellspacing="0"
  47. width="980">
  48. <tbody>
  49. <tr>
  50. <td bgcolor="#dadce8" height="1">
  51. <img src="images/line.gif" height="1" width="1">
  52. </td>
  53. </tr>
  54. <tr>
  55. <td>
  56. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  57. <tbody>
  58. <tr>
  59. <td bgcolor="#e5e5f0" valign="top" width="190">
  60. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  61. <tbody>
  62. <tr>
  63. <td>
  64. <table border="0" cellpadding="0" cellspacing="0"
  65. width="100%">
  66. <tbody>
  67. <tr>
  68. <td align="center" height="40">
  69. <img src="images/login.gif" height="39" width="190">
  70. </td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td>
  78. <table border="0" cellpadding="0" cellspacing="0"
  79. width="100%">
  80. <tbody>
  81. <tr>
  82. <td rowspan="3" bgcolor="#aab3d5" width="1">
  83. <img src="images/line.gif" height="1" width="1">
  84. </td>
  85. <td width="176">
  86. <img src="images/loginbg1.gif" height="19" width="188">
  87. </td>
  88. <td rowspan="3" bgcolor="#aab3d5" width="1">
  89. <img src="images/line.gif" height="1" width="1">
  90. </td>
  91. </tr>
  92. <tr>
  93. <td align="center" bgcolor="#e2e4f0">
  94. <table border="0" cellpadding="0" cellspacing="0"
  95. width="95%">
  96. <form method="post" action="login.php"></form>
  97. <tbody>
  98. <tr>
  99. <td align="left" height="25" width="73%">
  100. 会员号:
  101. <input name="cardnumber" size="10"
  102. style="font-size: 12px;" type="text">
  103. </td>
  104. <td rowspan="2" width="27%">
  105. <input src="images/down.gif" name="B1" border="0"
  106. height="45" type="image" width="45">
  107. </td>
  108. </tr>
  109. <tr>
  110. <td align="left">
  111. 密 码:
  112. <input name="passwd" size="10"
  113. style="font-size: 11px;" type="password">
  114. </td>
  115. </tr>
  116. <tr>
  117. <td colspan="2" height="30">
  118. <p align="center">
  119. [
  120. <a href="extend.phptype=regtop.htm">新用户注册</a>]
  121. &nbsp;[
  122. <a href="passwdview.php.htm"
  123. onClick="js_callpage(href);return false">忘记密码</a>]
  124. </p>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. </td>
  130. </tr>
  131. <tr>
  132. <td bgcolor="#aab3d5" height="1">
  133. <img src="images/line.gif" height="1" width="1">
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </td>
  139. </tr>
  140. <!--ad-->
  141. <!--ad end-->
  142. </tbody>
  143. </table>
  144. </td>
  145. <td width="10">
  146. </td>
  147. <td valign="top" width="780">
  148. <table style="border-collapse: collapse;" border="0"
  149. bordercolor="#111111" cellpadding="0" cellspacing="0"
  150. height="417" width="100%">
  151. <tbody>
  152. <tr>
  153. <td height="119">
  154. <table style="border-collapse: collapse;" border="0"
  155. bordercolor="#111111" cellpadding="0" cellspacing="0"
  156. width="100%">
  157. <tbody>
  158. <tr>
  159. <td width="100%">
  160. <input name="nowpcd" value="" type="hidden">
  161. <table border="0" cellpadding="0" cellspacing="0"
  162. width="100%">
  163. <form method="post"
  164. action="index_catalog.php?pma_code=21&amp;cat_code=107&amp;sub_cat_code=&amp;onepcd="
  165. name="glform"></form>
  166. <tbody>
  167. <tr>
  168. <td bgcolor="#e5e5f0" height="25">
  169. <table style="border-collapse: collapse;"
  170. border="0" cellpadding="0" cellspacing="0"
  171. width="100%">
  172. <tbody>
  173. <tr>
  174. <td>
  175. &nbsp;
  176. <img src="images/m_33.gif" height="10"
  177. width="10">
  178. &nbsp;
  179. <strong><a
  180. href="http://www.thinkshop.cn/index_catalog.php?pma_code=21&amp;cat_code=107">内存</a>
  181. </strong> &nbsp;
  182. </td>
  183. <form method="post"
  184. action="index_catalog.php?pma_code=21&amp;cat_code=107&amp;sub_cat_code=&amp;mfname_sel=&amp;sortby=pdate&amp;onepcd=&amp;nowpcd="></form>
  185. <td align="right">
  186. 全部
  187. <b><%=totalRecords%> </b>种商品,共
  188. <b><%=totalPages%> </b>页,当前第
  189. <b><%=pageNo%> </b>页&nbsp;&nbsp;
  190. <select size="1" name="pagenum" class="input"
  191. onChange="submit()">
  192. <option value="1" selected="selected">
  193. 第1页
  194. </option>
  195. </select>
  196. </td>
  197. </tr>
  198. </tbody>
  199. </table>
  200. </td>
  201. </tr>
  202. <%
  203. for (int i = 0; i < products.size(); i++) {
  204. Product p = products.get(i);
  205. %>
  206. <tr>
  207. <td align="center" height="100">
  208. <table style="border-collapse: collapse;"
  209. bgcolor="#ffffff" border="0" cellpadding="0"
  210. cellspacing="0" width="95%">
  211. <tbody>
  212. <tr>
  213. <td rowspan="3" width="108">
  214. <a
  215. href="ShowProductDetail.jsp?id=<%=p.getId()%>"
  216. class="mingcheng1"> <img
  217. src="images/product/<%=p.getId() + ".jpg"%>"
  218. border="0" height="90" width="75"> </a>
  219. </td>
  220. <td width="492">
  221. <a href="" class="mingcheng1"><%=p.getName()%></a>&nbsp;
  222. </td>
  223. <td rowspan="2" align="center" width="141">
  224. <a href="Buy.jsp?id=<%=p.getId()%>&action=add"
  225. target="cart"> <img
  226. src="images/xiaoche.gif" border="0"> </a>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td width="492">
  231. 商品编号:<%=p.getId()%>
  232. &nbsp; 市场价格:
  233. <font color="#cc0000">¥<%=p.getNormalPrice()%></font>&nbsp;
  234. 会员价格:
  235. <font color="#0000ff">¥<%=p.getMemberPrice()%></font>
  236. </td>
  237. </tr>
  238. <tr>
  239. <td colspan="2" width="633">
  240. <%=p.getDescr()%>
  241. </td>
  242. </tr>
  243. </tbody>
  244. </table>
  245. </td>
  246. </tr>
  247. <tr>
  248. <td align="center" height="20" valign="middle">
  249. <img src="images/3j_line_2.gif" height="3"
  250. width="744">
  251. </td>
  252. </tr>
  253. <%
  254. } // end for
  255. %>
  256. <form method="post"
  257. action="index_catalog.php?pma_code=21&amp;cat_code=107&amp;sub_cat_code=&amp;mfname_sel=&amp;sortby=pdate&amp;onepcd=&amp;nowpcd="></form>
  258. </tbody>
  259. </table>
  260. </td>
  261. </tr>
  262. </tbody>
  263. </table>
  264. </td>
  265. </tr>
  266. <tr>
  267. <td height="30">
  268. </td>
  269. </tr>
  270. </tbody>
  271. </table>
  272. </td>
  273. </tr>
  274. </tbody>
  275. </table>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td width="100%">
  280. <!--底部INC--><br>
  281. </td>
  282. </tr>
  283. </tbody>
  284. </table>
  285. </body>
  286. </html>