⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 __shoperlist.java

📁 本站基本功能如下: 首页(index.jsp) 图书选购,(可按分类方式查找图书
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                    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\">&nbsp;</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\">&nbsp;</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\">&nbsp;</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\">&nbsp;</td>\r\n            <td>&nbsp;</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("元&nbsp;&nbsp;总数量:");                out.print(String.valueOf( totalamount));  //[ /shoperlist.jsp; Line: 184]                out.print("本&nbsp;</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>&nbsp;&nbsp;&nbsp; \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());\">&nbsp;</td></form>\r\n\t\t\t\t<form name=\"form1\" method=\"post\" action=\"shoperlist.jsp\">\r\n\t\t\t  <td valign=\"bottom\">&nbsp;\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 + -