📄 orderpage.jsp
字号:
<%--
* @author Rajat Gupta
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
* Name of the Application : OrderPage.jsp
* Creation/Modification History :
*
* Rajat Gupta 22-Jan-2002 Created
*
* Overview of Application :
* This JSP displays the orders made by the Customer.
--%>
<%@ page language="java" %>
<%@ page errorPage="Exception.jsp" %>
<HTML><HEAD><TITLE>Advanced Queuing Sample - Order page</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<%@ page import="oracle.otnsamples.AQ.Helper.ShoppingCartProduct"%>
<BODY bgColor=#ffffff text=#000000>
<form name="DisplayOrders" method="post">
<%
Hashtable shoppingCart = (Hashtable)session.getAttribute("ShoppingCart");
%>
<!-- Main table -->
<jsp:include page="include/Top.jsp" />
<SPAN class="greeting"> Hi <%=session.getAttribute("Name")%>. You have logged in as a Customer.</SPAN>
<jsp:include page="include/Links.jsp" />
<!-- Heading of the page goes here -->
<TR><TD class="subHeading" align="center">Your order has been placed. It will be shipped in the next few days.</TD></TR>
<TR><TD> </TD></TR>
<TR>
<TD>
<!-- 5th table starts here working area -->
<TABLE border=0 cellPadding=0 cellSpacing=0 width=970 >
<TBODY>
<TR><TD colspan=3 class="mainHeading" align="center">Shopping Cart</TD></TR>
<TR><TD colspan=3> </TD></TR>
<TR>
<TD valign="top" width="15%" noWrap> </TD>
<TD vAlign=top width="75%">
<!-- 7th table starts here (shopping cart)-->
<TABLE border=1 borderColor="#9BCDFF" cellPadding=2 cellSpacing=0 width="100%">
<TBODY>
<TR align="center">
<TD class="subHeading" width="2%">S.No</TD>
<TD class="subHeading" width="25%">Product Name</TD>
<TD class="subHeading" width="18%">Manufacturer Name</TD>
<TD class="subHeading" width="20%">Category Desc</TD>
<TD class="subHeading" width="15%">Price</TD>
<TD class="subHeading" width="10%">Quantity</TD>
<TD class="subHeading" width="13%">Sub total (in Dollars)</TD>
</TR>
<%
// Get all the keys stored in the Hashtable in an Enumeration.
Enumeration enumCart = shoppingCart.keys();
// Initialize Serial Number
int serial = 0;
// Initialize Total cost of Order
int total = 0;
// Iterate through the Hashtable
while (enumCart.hasMoreElements()){
Object key = enumCart.nextElement();
serial++;
// Get the first Product from the Hashtable and display it
ShoppingCartProduct scProduct = (ShoppingCartProduct)shoppingCart.get(key);
%>
<TR align="center" height="25">
<TD class="data"><%=serial%></TD>
<TD class="data"><%=scProduct.getProductName()%></TD>
<TD class="data"><%=scProduct.getManufacturerName()%></TD>
<TD class="data"><%=scProduct.getCategoryDesc()%></TD>
<TD class="data"><%=scProduct.getProductPrice()%></TD>
<TD class="data"><%=scProduct.getQuantityOrdered()%></TD>
<TD class="data" align="right"><%=scProduct.getTotalPrice()%></TD>
</TR>
<%
total = total + Integer.parseInt(scProduct.getTotalPrice());
}
%>
</TBODY>
</TABLE>
<!-- 7th table ends here (shopping cart)-->
</TD>
<TD width="10%"> </TD>
</TR>
<TR>
<TD colspan=2 align="right">
<span class="subHeading">Total: </span>
<span class="data"><%=total%> $</span>
</TD>
<TD width="10%"> </TD>
</TR>
<TR><TD colspan=3> </TD></TR>
<TR>
<TD colspan=3 align="center"> <a href="ControllerServlet?Event=SignOut"><img src="images/signOut.gif" border=0></a>
</TD>
</TR>
<TR><TD colspan=3> </TD></TR>
</TBODY>
</TABLE>
<!-- 5th table ends here working area-->
</TD>
</TR>
<TR>
<TD vAlign=top align=left noWrap> </TD>
</TR>
<TR>
<TD vAlign=top align=left ><image src="images/line.gif" height="3" width="970"></TD>
</TR>
<TR>
<TD height=19 vAlign=top align="left"><font face="Arial, Helvetica" size=-2>
© Copyright 2002 Oracle Corporation.
All rights reserved.</font> </TD>
</TR>
</TABLE>
<!-- Main table ends here-->
</form>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -