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

📄 indentlist_jsp.java

📁 jsp mysql 实现网上购物系统
💻 JAVA
字号:
package org.apache.jsp.manage;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.mybusiness.web.ware.*;
import com.mybusiness.util.str;

public final class indentlist_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");

if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
	response.sendRedirect("error.htm");
} 
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      com.mybusiness.web.purchase myIndentlist = null;
      synchronized (_jspx_page_context) {
        myIndentlist = (com.mybusiness.web.purchase) _jspx_page_context.getAttribute("myIndentlist", PageContext.PAGE_SCOPE);
        if (myIndentlist == null){
          myIndentlist = new com.mybusiness.web.purchase();
          _jspx_page_context.setAttribute("myIndentlist", myIndentlist, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.mybusiness.web.waremn mybook = null;
      synchronized (_jspx_page_context) {
        mybook = (com.mybusiness.web.waremn) _jspx_page_context.getAttribute("mybook", PageContext.PAGE_SCOPE);
        if (mybook == null){
          mybook = new com.mybusiness.web.waremn();
          _jspx_page_context.setAttribute("mybook", mybook, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.mybusiness.web.usermn user = null;
      synchronized (_jspx_page_context) {
        user = (com.mybusiness.web.usermn) _jspx_page_context.getAttribute("user", PageContext.PAGE_SCOPE);
        if (user == null){
          user = new com.mybusiness.web.usermn();
          _jspx_page_context.setAttribute("user", user, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");

String mesg = "";
long Id=0;
String submit= request.getParameter("submit");
if (submit!=null && !submit.equals("")){
	if (myIndentlist.update(request))
		mesg = "更新订单状态成功!";
	else 
		mesg = "更新订单状态出错!";
}

if (request.getParameter("indentid")==null || request.getParameter("indentid").equals("")) {
		mesg = "你要查看的订单清单不存在!";
} else {
	try {
		Id = Long.parseLong(request.getParameter("indentid"));
		if (!myIndentlist.getOneIndent(Id) || !myIndentlist.getIndentList(Id)){
			mesg = "你要查看的订单清单不存在!";
		}
	} catch (Exception e){
		mesg = "你要查看的订单清单不存在!";
	}
}




      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>商场翱游购物管理系统 查看订购清单资料</title>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<script language=\"javascript\">\r\n");
      out.write("\r\n");
      out.write("  function openScript(url,name, width, height){\r\n");
      out.write("\tvar Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );\r\n");
      out.write("}\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("<link rel=\"stylesheet\" href=\"books.css\" type=\"text/css\">\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body  background=../images/112.gif text=\"#000000\" onload=\"javascript:window.focus();\" >\r\n");
      out.write("<div align=\"center\">\r\n");
      out.write("  \r\n");
      out.write("  ");
 if(!mesg.equals("")){
		out.println(mesg);
	  } else {
		indent Ident = (indent) myIndentlist.getMy_indent().elementAt(0);
	
      out.write("\r\n");
      out.write("\t\t<p>商场翱游购物系统商品订单");
      out.print( Ident.getIndentNo() );
      out.write("&nbsp;清单:</p>\r\n");
      out.write("          <table width=\"95%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" bordercolor=\"#CC9966\">\r\n");
      out.write("          <tr align=\"center\"> \r\n");
      out.write("            <td>商品名称</td>\r\n");
      out.write("            <td>商品类别</td>\r\n");
      out.write("            <td>单价(元)</td>\r\n");
      out.write("            <td>数量</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("\t");

	float totalprice =0;
	int totalamount = 0;
	for (int i=0; i<myIndentlist.getIndent_list().size();i++){
		indentlist idList = (indentlist) myIndentlist.getIndent_list().elementAt(i);
		if (mybook.getOnebook((int)idList.getBookNo()) ){
			ware bk = (ware) mybook.getBooklist().elementAt(0);		
	
      out.write("\t  \r\n");
      out.write("\t      <tr align=\"center\"> \r\n");
      out.write("            <td>");
      out.print( bk.getBookName() );
      out.write("</td>\r\n");
      out.write("            \r\n");
      out.write("            <td>");
      out.print( bk.getClassname() );
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( bk.getPrince() );
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( idList.getAmount() );
      out.write("</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("\t");
	totalprice = totalprice + bk.getPrince() * idList.getAmount();
		totalamount = totalamount + idList.getAmount();
		} 
      out.write("\r\n");
      out.write("\t\r\n");
   }
      out.write("<tr align=\"center\"> \r\n");
      out.write("            <td colspan=5 >购买的总金额是:");
      out.print( totalprice );
      out.write("元,总数量是");
      out.print( totalamount);
      out.write("</td> </tr>\r\n");
      out.write("\t\t</table>\r\n");
      out.write("  <br>\r\n");
      out.write("  <table width=\"95%\" border=\"1\" cellspacing=\"2\" cellpadding=\"1\" bordercolor=\"#CC9966\">\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">下单用户:</td>\r\n");
      out.write("      <td width=\"60%\">");

				if (user.getUserinfo(Ident.getUserId()) ) {
					shopuser userinfo = (shopuser)user.getUserlist().elementAt(0); 
      out.write("\r\n");
      out.write("\t\t\t\t<a href=\"#\" onclick=\"openScript('showuser.jsp?userid=");
      out.print( Ident.getUserId() );
      out.write("','showuser',450,500)\">");
      out.print( userinfo.getUserName() );
      out.write("</a>\r\n");
      out.write("\t\t\t");
} else {
					out.println("该用户已被删除");
				}			
			
      out.write("</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">下单时间:</td>\r\n");
      out.write("      <td width=\"60%\">");
      out.print( Ident.getSubmitTime() );
      out.write("</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">交货时间:</td>\r\n");
      out.write("      <td width=\"60%\">");
      out.print( Ident.getConsignmentTime() );
      out.write("&nbsp;</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">总金额:</td>\r\n");
      out.write("      <td width=\"60%\">");
      out.print( Ident.getTotalPrice() );
      out.write("&nbsp;</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">下单时IP:</td>\r\n");
      out.write("      <td width=\"60%\">");
      out.print( Ident.getIPAddress() );
      out.write("&nbsp;</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">用户备注:</td>\r\n");
      out.write("      <td width=\"60%\">");
      out.print( str.toHtml(Ident.getContent()) );
      out.write("&nbsp;</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("\t<form name=\"form1\" method=\"post\" action=\"indentlist.jsp\" >\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">是否付款:</td>\r\n");
      out.write("      <td width=\"60%\"> \r\n");
      out.write("        <input type=\"radio\" name=\"payoff\" value=\"1\" ");
if (!Ident.getIsPayoff()) out.print("checked") ; 
      out.write(">\r\n");
      out.write("        否<input type=\"radio\" name=\"payoff\" value=\"2\" ");
if (Ident.getIsPayoff()) out.print("checked") ; 
      out.write(">\r\n");
      out.write("        是</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td width=\"40%\" align=\"right\">是否交货:</td>\r\n");
      out.write("      <td width=\"60%\"> \r\n");
      out.write("        <input type=\"radio\" name=\"sales\" value=\"1\" ");
if (!Ident.getIsSales()) out.print("checked") ; 
      out.write(">\r\n");
      out.write("        否<input type=\"radio\" name=\"sales\" value=\"2\" ");
if (Ident.getIsSales()) out.print("checked") ; 
      out.write(">\r\n");
      out.write("        是</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td width=\"40%\" align=\"right\">&nbsp;</td>\r\n");
      out.write("      <td width=\"60%\">\r\n");
      out.write("\t\t<input type=\"hidden\" name=\"indentid\" value=\"");
      out.print( Id );
      out.write("\">\r\n");
      out.write("        <input type=\"submit\" name=\"submit\" value=\"更新\">\r\n");
      out.write("      </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("\t</form>\r\n");
      out.write("  </table>\r\n");
      out.write("  <br>\r\n");
      out.write("\r\n");
 } 
      out.write("\r\n");
      out.write("  <br><p><a href=\"javascript:window.close()\">关闭窗口</a></p>\r\n");
      out.write("  <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td align=\"center\">开发:王文耀<br>\r\n");
      out.write("        CopyRight@2006<br>\r\n");
      out.write("        Email:<a href=\"mailto:wwy170@163.com\">wwy170@163.com</a></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("  \r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
mybook.close();
myIndentlist.close();
user.close();
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -