📄 cart_0005fsee_0002ejsp_jsp.java
字号:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import java.sql.*;
import java.util.Vector;
import commerce.goodselement;
import com.wgh.DB.chStr;
import com.wgh.DB.connDB;
public class cart_0005fsee_0002ejsp_jsp extends HttpJspBase {
private static java.util.Vector _jspx_includes;
public java.util.List getIncludes() {
return _jspx_includes;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
String username="";
username=(String)session.getAttribute("username");
if(username=="" || username==null){
out.println("<script language='javascript'>alert('请先登录!');window.location.href='index.jsp';</script>");
}else{
chStr chStr=new chStr();
connDB conn=new connDB();
Vector cart=(Vector)session.getAttribute("cart");
if(cart==null || cart.size()==0){
response.sendRedirect("cart_null.jsp");
}else{
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>Go购电子商城");
out.write("</title>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<link href=\"CSS/style.css\" rel=\"stylesheet\">\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write("<table width=\"790\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td class=\"tableBorder\">\r\n");
JspRuntimeLibrary.include(request, response, "navigation.jsp", out, false);
out.write("\r\n");
out.write("<table width=\"790\" height=\"236\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td width=\"182\" height=\"182\" valign=\"top\">\r\n\t");
JspRuntimeLibrary.include(request, response, "left.jsp", out, false);
out.write("\r\n\t");
out.write("</td>\r\n ");
out.write("<td valign=\"top\">");
out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"33\" background=\"images/shop_12.gif\">");
out.write("</td>\r\n ");
out.write("<td width=\"505\" height=\"33\" align=\"right\" valign=\"middle\" background=\"images/shop_12.gif\">");
out.write("<table width=\"100%\" height=\"24\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"8\">");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td align=\"right\" class=\"word_green\">");
out.write("<marquee direction=\"left\" scrollamount=\"1\" scrolldelay=\"1\" onMouseOver=\"this.stop();\" onMouseOut=\"this.start();\">^_^ 顾客您好!购买商品请先登录 ");
out.write("<a href=\"register.jsp\" class=\"word_green\">[新用户注册]");
out.write("</a>");
out.write("</marquee>");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>");
out.write("</td>\r\n ");
out.write("<td width=\"10\" background=\"images/shop_12.gif\"> ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td width=\"93\" height=\"50\" background=\"images/shop_15.gif\"> ");
out.write("</td>\r\n ");
out.write("<td colspan=\"2\" background=\"images/shop_16.gif\">\r\n\t\t ");
JspRuntimeLibrary.include(request, response, "search.jsp", out, false);
out.write("\r\n\t\t");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>\r\n ");
out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"189\" valign=\"top\">");
out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"80\" background=\"images/center_cart.gif\"> ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr valign=\"top\">\r\n ");
out.write("<td height=\"134\" align=\"center\">\r\n");
out.write("<table width=\"100%\" height=\"126\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\r\n\t\t\t ");
out.write("<tr>\r\n ");
out.write("<td valign=\"top\">\r\n ");
out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td>\r\n");
out.write("<form method=\"post\" action=\"cart_modify.jsp\" name=\"form1\">\r\n");
out.write("<table width=\"92%\" height=\"48\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr align=\"center\" valign=\"middle\">\r\n ");
out.write("<td height=\"27\" class=\"tableBorder_B1\">编号");
out.write("</td>\r\n ");
out.write("<td height=\"27\" class=\"tableBorder_B1\">商品编号");
out.write("</td>\r\n ");
out.write("<td class=\"tableBorder_B1\">商品名称");
out.write("</td>\r\n ");
out.write("<td height=\"27\" class=\"tableBorder_B1\">单价");
out.write("</td>\r\n ");
out.write("<td height=\"27\" class=\"tableBorder_B1\">数量");
out.write("</td>\r\n ");
out.write("<td height=\"27\" class=\"tableBorder_B1\">金额");
out.write("</td>\r\n ");
out.write("<td class=\"tableBorder_B1\">退回");
out.write("</td>\r\n ");
out.write("</tr> \r\n\t");
float sum=0;
int ID=-1;
String goodsname="";
for(int i=0;i<cart.size();i++){
goodselement goodsitem=(goodselement)cart.elementAt(i);
sum=sum+goodsitem.number*goodsitem.nowprice;
ID=goodsitem.ID;
if (ID>0){
ResultSet rs_goods=conn.executeQuery("select * from tb_goods where ID="+ID);
if (rs_goods.next()){
goodsname=rs_goods.getString("goodsname");
}
}
out.write(" \r\n ");
out.write("<tr align=\"center\" valign=\"middle\"> \r\n ");
out.write("<td width=\"32\" height=\"27\">");
out.print(i+1);
out.write("</td>\r\n ");
out.write("<td width=\"109\" height=\"27\">");
out.print(ID);
out.write("</td> \r\n ");
out.write("<td width=\"199\" height=\"27\">");
out.print(goodsname);
out.write("</td>\r\n ");
out.write("<td width=\"59\" height=\"27\">¥");
out.print(goodsitem.nowprice);
out.write("</td> \r\n ");
out.write("<td width=\"51\" height=\"27\">\r\n ");
out.write("<input name=\"num");
out.print(i);
out.write("\" size=\"7\" type=\"text\" class=\"txt_grey\" value=\"");
out.print(goodsitem.number);
out.write("\" onBlur=\"check(this.form)\">");
out.write("</td> \r\n ");
out.write("<td width=\"65\" height=\"27\">¥");
out.print((goodsitem.nowprice*goodsitem.number));
out.write("</td> \r\n ");
out.write("<td width=\"34\">");
out.write("<a href=\"cart_move.jsp?ID=");
out.print(i);
out.write("\">");
out.write("<img src=\"images/del.gif\" width=\"16\" height=\"16\">");
out.write("</a>");
out.write("</td>\r\n ");
out.write("<script language=\"javascript\">\r\n\t\t\t");
out.write("<!--\r\n\t\t\tfunction check(myform){\r\n\t\t\t\tif(isNaN(myform.num");
out.print(i);
out.write(".value) || myform.num");
out.print(i);
out.write(".value.indexOf('.',0)!=-1){\r\n\t\t\t\t\talert(\"请不要输入非法字符\");myform.num");
out.print(i);
out.write(".focus();return;}\r\n\t\t\t\tif(myform.num");
out.print(i);
out.write(".value==\"\"){\r\n\t\t\t\t\talert(\"请输入修改的数量\");myform.num");
out.print(i);
out.write(".focus();return;}\t\r\n\t\t\t\tmyform.submit();\r\n\t\t\t}\r\n\t\t\t-->\r\n\t\t");
out.write("</script>\r\n\t");
}
out.write(" ");
out.write("</tr>\r\n ");
out.write("</table>\r\n\t ");
out.write("</form>\r\n");
out.write("<table width=\"100%\" height=\"52\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr align=\"center\" valign=\"middle\">\r\n\t\t");
out.write("<td height=\"10\"> \t\t");
out.write("</td>\r\n ");
out.write("<td width=\"24%\" height=\"10\" colspan=\"-3\" align=\"left\"> ");
out.write("</td>\r\n\t\t");
out.write("</tr>\r\n ");
out.write("<tr align=\"center\" valign=\"middle\">\r\n ");
out.write("<td height=\"21\" class=\"tableBorder_B1\"> ");
out.write("</td>\r\n ");
out.write("<td height=\"21\" colspan=\"-3\" align=\"left\" class=\"tableBorder_B1\">合计总金额:¥");
out.print(sum);
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr align=\"center\" valign=\"middle\">\r\n ");
out.write("<td height=\"21\" colspan=\"2\"> ");
out.write("<a href=\"index.jsp\">继续购物");
out.write("</a> | ");
out.write("<a href=\"cart_checkout.jsp\">去收银台结账");
out.write("</a> | ");
out.write("<a href=\"cart_clear.jsp\">清空购物车");
out.write("</a> | ");
out.write("<a href=\"#\">修改数量");
out.write("</a>");
out.write("</td>\r\n ");
out.write("</tr>\r\n");
out.write("</table>\r\n\t\t\t\t\t\t");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>");
out.write("</td>\r\n\t\t\t ");
out.write("</tr>\r\n ");
out.write("</table>\r\n ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"38\" align=\"right\" background=\"images/center02.gif\">");
out.write("<a href=\"sale.jsp\">");
out.write("<br>\r\n ");
out.write("<br>\r\n ");
out.write("</a>");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>");
out.write("</td>\r\n ");
out.write("</tr>\r\n");
out.write("</table>\r\n");
out.write("<table width=\"790\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td>");
out.write("<table width=\"100%\" height=\"78\" border=\"0\" align=\"center\" cellpadding=\"-2\" cellspacing=\"-2\">\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"13\" colspan=\"5\">");
out.write("<div align=\"center\">\r\n ");
out.write("<hr width=\"100%\" size=\"1\">\r\n ");
out.write("</div>");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td width=\"124\" height=\"13\"> ");
out.write("</td>\r\n ");
out.write("<td height=\"13\" colspan=\"3\" align=\"center\">Go购电子商城客户服务热线:0431-4978981,4978982 传真:0431-4972266");
out.write("</td>\r\n ");
out.write("<td width=\"141\"> ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td height=\"15\" colspan=\"2\"> ");
out.write("</td>\r\n ");
out.write("<td width=\"464\" valign=\"bottom\" align=\"center\"> CopyRight © 2005 www.mingrisoft.com 吉林省明日科技有限公司");
out.write("</td>\r\n ");
out.write("<td colspan=\"2\"> ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr>\r\n ");
out.write("<td colspan=\"2\"> ");
out.write("</td>\r\n ");
out.write("<td align=\"center\">本站请使用IE6.0或以上版本 1024*768为最佳显示效果");
out.write("</td>\r\n ");
out.write("<td colspan=\"2\"> ");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("<tr bgcolor=\"#cccccc\">\r\n ");
out.write("<td height=\"8\" colspan=\"2\">");
out.write("</td>\r\n ");
out.write("<td height=\"8\" align=\"center\">");
out.write("</td>\r\n ");
out.write("<td height=\"8\" colspan=\"2\">");
out.write("</td>\r\n ");
out.write("</tr>\r\n ");
out.write("</table>");
out.write("</td>\r\n ");
out.write("</tr>\r\n");
out.write("</table>\r\n");
out.write("</td>\r\n");
out.write("</tr>\r\n");
out.write("</table>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
conn.close();}
}
out.write("\r\n");
} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -