?? __shoperlist.java
字號:
shop = (org.pan.web.purchase)pageContext.getAttribute("shop"); //[ /shoperlist.jsp; Line: 10] if (shop == null) { // begin 'shop' synchronized instantiation block... //[ /shoperlist.jsp; Line: 10] shop = new org.pan.web.purchase(); //[ /shoperlist.jsp; Line: 10] pageContext.setAttribute("shop", shop); //[ /shoperlist.jsp; Line: 10] } // end synchronized bean instantiation block... //[ /shoperlist.jsp; Line: 10] } // end synchronized bean scope block... //[ /shoperlist.jsp; Line: 10] } // end bean instantiation block... //[ /shoperlist.jsp; Line: 10] out.print("\r\n\r\n"); //[ /shoperlist.jsp; Line: 12] String userid = (String) session.getAttribute("userid"); //[ /shoperlist.jsp; Line: 13] if ( userid == null ) //[ /shoperlist.jsp; Line: 14] userid = ""; //[ /shoperlist.jsp; Line: 15] String modi = request.getParameter("modi"); //[ /shoperlist.jsp; Line: 16] String del = request.getParameter("del"); //[ /shoperlist.jsp; Line: 17] String payoutCar = request.getParameter("payout"); //[ /shoperlist.jsp; Line: 18] String clearCar = request.getParameter("clear"); //[ /shoperlist.jsp; Line: 19] String mesg = ""; //[ /shoperlist.jsp; Line: 20] //[ /shoperlist.jsp; Line: 21] if (modi!=null && !modi.equals("")) { //[ /shoperlist.jsp; Line: 22] if ( !shop.modiShoper(request) ){ //[ /shoperlist.jsp; Line: 23] if (shop.getIsEmpty()) //[ /shoperlist.jsp; Line: 24] mesg = "你要的修改購買的圖書數量不足你的購買數量!"; //[ /shoperlist.jsp; Line: 25] else //[ /shoperlist.jsp; Line: 26] mesg = "修改購買數量出錯!"; //[ /shoperlist.jsp; Line: 27] } else { //[ /shoperlist.jsp; Line: 28] mesg = "修改成功"; //[ /shoperlist.jsp; Line: 29] } //[ /shoperlist.jsp; Line: 30] //[ /shoperlist.jsp; Line: 31] }else if ( del != null && !del.equals("") ) { //[ /shoperlist.jsp; Line: 32] if ( !shop.delShoper(request) ) { //[ /shoperlist.jsp; Line: 33] mesg = "刪除清單中的圖書時出錯!" ; //[ /shoperlist.jsp; Line: 34] } //[ /shoperlist.jsp; Line: 35] }else if (payoutCar != null && !payoutCar.equals("") ) { //[ /shoperlist.jsp; Line: 36] if (shop.payout(request) ) { //[ /shoperlist.jsp; Line: 37] mesg = "你的購物車中的物品已提交給本店,你的訂單號為 "+ shop.getIndentNo() + "<br>請及時付款,以便我們發貨!"; //[ /shoperlist.jsp; Line: 38] session.removeAttribute("shopcar"); //[ /shoperlist.jsp; Line: 39] } else { //[ /shoperlist.jsp; Line: 40] if(!shop.getIsLogin()) //[ /shoperlist.jsp; Line: 41] mesg = "你還沒有登錄,請先<a href=login.jsp>登錄</a>后再提交"; //[ /shoperlist.jsp; Line: 42] else //[ /shoperlist.jsp; Line: 43] mesg = "對不起,提交出錯,請稍后重試"; //[ /shoperlist.jsp; Line: 44] } //[ /shoperlist.jsp; Line: 45] } else if (clearCar != null && ! clearCar.equals("") ) { //[ /shoperlist.jsp; Line: 46] session.removeAttribute("shopcar"); //[ /shoperlist.jsp; Line: 47] mesg = "購物車中的物品清單已清空"; //[ /shoperlist.jsp; Line: 48] } //[ /shoperlist.jsp; Line: 49] //[ /shoperlist.jsp; Line: 50] //[ /shoperlist.jsp; Line: 51] out.print("\r\n\r\n<html>\r\n<head>\r\n<title>好易多網絡電子書店--我的購物車</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<script language=\"javascript\">\r\n\r\nfunction openScript(url,name, width, height){\r\n\tvar Win = window.open(url,name,\'width=\' + width + \',height=\' + height + \',resizable=1,scrollbars=yes,menubar=no,status=yes\' );\r\n}\r\nfunction checklogin() {\r\n\tif (document.payout.userid.value==\"\")\r\n\t{\r\n\t\talert(\"你還沒有登錄,請登錄后再提交購物清單地。\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction check()\r\n{\r\n\tif (document.change.amount.value<1){\r\n\t\talert(\"你的購買數量有問題\");\r\n\t\tdocument.change.amount.focus();\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}\r\n\r\n</script>\r\n<link rel=\"stylesheet\" href=\"books.css\" type=\"text/css\">\r\n</head>\r\n\r\n<body bgcolor=\"#FFCC99\" text=\"#000000\">\r\n<div align=\"center\">\r\n <table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n <tr> \r\n <td width=\"120\" align=\"center\"><img src=\"images/Img20625.jpg\" width=\"50\" height=\"50\"><br>\r\n <font color=\"#0066CC\">好易多書店</font></td>\r\n <td align=\"ce"); out.print("nter\"><img src=\"images/baners2.gif\" width=\"468\" height=\"60\"></td>\r\n <td align=\"center\" width=\"80\"><a href=\"#\">本站公告</a><br>\r\n <br>\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n <table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n <tr> \r\n <td width=\"200\"> </td>\r\n <td width=\"55\"><a href=\"index.jsp\">首頁</a></td>\r\n <td width=\"100\"><a href=\"booklist.jsp\">在線購物</a></td>\r\n <td width=\"100\"><a href=\"shoperlist.jsp\">我的購物車</a></td>\r\n <td width=\"100\"><a href=\"userinfo.jsp\">用戶信息</a></td>\r\n <td><a href=\"login.jsp\">用戶登錄</a></td>\r\n </tr>\r\n </table>\r\n <table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n <tr valign=\"top\"> \r\n <td width=\"150\"> \r\n <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n <tr> \r\n <td width=\"20\"> </td>\r\n <td>本店圖書分類:</td>\r\n </tr>\r\n "); if (classlist.excute()){ //[ /shoperlist.jsp; Line: 117] for (int i=0;i<classlist.getClasslist().size();i++){ //[ /shoperlist.jsp; Line: 118] bookclass bc = (bookclass) classlist.getClasslist().elementAt(i); //[ /shoperlist.jsp; Line: 119] //[ /shoperlist.jsp; Line: 119] out.print("\r\n <tr> \r\n <td width=\"20\"> </td>\r\n <td><a href=\"booklist.jsp?classid="); out.print(String.valueOf( bc.getId())); //[ /shoperlist.jsp; Line: 122] out.print("\">"); out.print(String.valueOf( bc.getClassName() )); //[ /shoperlist.jsp; Line: 122] out.print("</a></td>\r\n </tr>\r\n "); } //[ /shoperlist.jsp; Line: 124] } //[ /shoperlist.jsp; Line: 125] //[ /shoperlist.jsp; Line: 125] out.print("\r\n <tr> \r\n <td width=\"20\"> </td>\r\n <td> </td>\r\n </tr>\r\n </table>\r\n <p><img src=\"images/qrjbutton.gif\" width=\"120\" height=\"60\"></p>\r\n <p><img src=\"images/it_button_3.gif\" width=\"100\" height=\"50\"></p>\r\n </td>\r\n <td align=\"center\"> \r\n <p><br>\r\n <b><font color=\"#0000FF\">我的購物車物品清單</font></b></p>\r\n"); //[ /shoperlist.jsp; Line: 137] if (!mesg.equals("") ) //[ /shoperlist.jsp; Line: 138] out.println("<p ><font color=#ff0000>" + mesg + "</font></p>"); //[ /shoperlist.jsp; Line: 139] //[ /shoperlist.jsp; Line: 140] Vector shoplist = (Vector) session.getAttribute("shopcar"); //[ /shoperlist.jsp; Line: 141] if (shoplist==null || shoplist.size()<0 ){ //[ /shoperlist.jsp; Line: 142] if (mesg.equals("")) //[ /shoperlist.jsp; Line: 143] out.println("<p><font color=#ff0000>你還沒有選擇購買圖書!請先購買</font></p>"); //[ /shoperlist.jsp; Line: 144] } else { //[ /shoperlist.jsp; Line: 145] out.print("\r\n <table width=\"100%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" bordercolor=\"#CC9966\">\r\n <tr align=\"center\"> \r\n <td>圖書名稱</td>\r\n <td>作者</td>\r\n <td>圖書類別</td>\r\n <td>單價(元)</td>\r\n <td>數量</td>\r\n <td colspan =2>選擇</td>\r\n </tr>\r\n\t"); //[ /shoperlist.jsp; Line: 156] float totalprice =0; //[ /shoperlist.jsp; Line: 157] int totalamount = 0; //[ /shoperlist.jsp; Line: 158] for (int i=0; i<shoplist.size();i++){ //[ /shoperlist.jsp; Line: 159] indentlist iList = (indentlist) shoplist.elementAt(i); //[ /shoperlist.jsp; Line: 160] if (book_list.getOnebook((int)iList.getBookNo())) { //[ /shoperlist.jsp; Line: 161] books bk = (books) book_list.getBooklist().elementAt(0); //[ /shoperlist.jsp; Line: 162] totalprice = totalprice + bk.getPrince() * iList.getAmount(); //[ /shoperlist.jsp; Line: 163] totalamount = totalamount + iList.getAmount(); //[ /shoperlist.jsp; Line: 164] //[ /shoperlist.jsp; Line: 165] //[ /shoperlist.jsp; Line: 165] out.print("\r\n <tr>\r\n <td>"); out.print(String.valueOf( bk.getBookName() )); //[ /shoperlist.jsp; Line: 167] out.print("</td>\r\n <td align=\"center\">"); out.print(String.valueOf( bk.getAuthor() )); //[ /shoperlist.jsp; Line: 168] out.print("</td>\r\n <td align=\"center\">"); out.print(String.valueOf( bk.getClassname() )); //[ /shoperlist.jsp; Line: 169] out.print("</td>\r\n <td align=\"center\">"); out.print(String.valueOf( bk.getPrince() )); //[ /shoperlist.jsp; Line: 170] out.print("</td>\r\n\t\t <form name=\"change\" method=\"post\" action=\"shoperlist.jsp\">\r\n <td align=\"center\">\r\n <input type=\"text\" name=\"amount\" maxlength=\"4\" size=\"3\" value=\""); out.print(String.valueOf( iList.getAmount() )); //[ /shoperlist.jsp; Line: 173] out.print("\" >\t\t\t \r\n </td>\r\n <td align=\"center\" width=55 >\r\n\t\t\t<input type=\"hidden\" name=\"bookid\" value=\""); out.print(String.valueOf( iList.getBookNo() )); //[ /shoperlist.jsp; Line: 176] out.print("\" >\r\n <input type=\"submit\" name=\"modi\" value=\"修改\" onclick=\"return(check());\"></td>\r\n\t\t\t<form name=\"del\" method=\"post\" action=\"shoperlist.jsp\">\r\n\t\t\t <input type=\"hidden\" name=\"bookid\" value=\""); out.print(String.valueOf( iList.getBookNo() )); //[ /shoperlist.jsp; Line: 179] out.print("\" >\r\n\t\t\t <td align=center width=55> <input type=\"submit\" name=\"del\" value=\"刪除\">\r\n </td></form>\r\n </tr>\r\n\t\t"); } //[ /shoperlist.jsp; Line: 183] } //[ /shoperlist.jsp; Line: 184] //[ /shoperlist.jsp; Line: 184] out.print(" <tr><td colspan=7 align=\"right\"><br>你選擇的圖書的總金額:"); out.print(String.valueOf( totalprice)); //[ /shoperlist.jsp; Line: 184] out.print("元 總數量:"); out.print(String.valueOf( totalamount)); //[ /shoperlist.jsp; Line: 184] out.print("本 </td></tr>\r\n </table>\r\n <p></p>\r\n <table width=\"90%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n <tr> <form name=\"payout\" method=\"post\" action=\"shoperlist.jsp\">\r\n <td align=\"right\" valign=\"bottom\"> <a href=\"booklist.jsp\">繼續購書</a> \r\n \r\n\t\t\t\t<input type=\"hidden\" name=\"userid\" value=\""); out.print(String.valueOf( userid )); //[ /shoperlist.jsp; Line: 191] out.print("\">\r\n\t\t\t\t<input type=\"hidden\" name=\"totalprice\" value=\""); out.print(String.valueOf( totalprice )); //[ /shoperlist.jsp; Line: 192] out.print("\">\r\n\t\t\t\t<TEXTAREA NAME=\"content\" ROWS=\"3\" COLS=\"20\">附言:</TEXTAREA><br>\r\n\t\t\t\t<input type=\"submit\" name=\"payout\" value=\"提交我的購物車\" onclick=\"javascript:return(checklogin());\"> </td></form>\r\n\t\t\t\t<form name=\"form1\" method=\"post\" action=\"shoperlist.jsp\">\r\n\t\t\t <td valign=\"bottom\"> \r\n <input type=\"submit\" name=\"clear\" value=\"清空我的購物車\">\r\n </td></form>\r\n </tr>\r\n </table>\r\n </form>\r\n"); } //[ /shoperlist.jsp; Line: 202] //[ /shoperlist.jsp; Line: 202] out.print("\r\n </td>\r\n </tr>\r\n </table>\r\n <table width=\"70%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n <tr>\r\n <td align=\"center\">多智能網絡有限公司開發<br>\r\n CopyRight@2003 <br>\r\n Email:<a href=\"mailto:pz990@163.net\">pz990@163.net</a></td>\r\n </tr>\r\n </table>\r\n \r\n</div>\r\n</body>\r\n</html>\r\n"); } catch (Throwable __ee) { while (out != null && out != _originalOut) out = pageContext.popBody(); ((weblogic.servlet.jsp.PageContextImpl)pageContext).handlePageException((Throwable)__ee); }
//before final close brace...
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -