-
Notifications
You must be signed in to change notification settings - Fork 0
/
trackOrder.jsp
127 lines (108 loc) · 4.61 KB
/
trackOrder.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page import="java.util.ArrayList"%>
<%@ page import="order.*"%>
<%@ page import="java.text.*"%>
<head>
<title>Track Order</title>
<link rel="icon" type="image/png" href="css/images/favicon-16x16.png" sizes="16x16" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<script type="text/javascript" src="js/searchProduct.js"></script>
</head>
<body onload="init()">
<!-- Shell -->
<div class="shell">
<%@include file="global/header.jsp"%> <!-- include from gloabl -->
<div id="main">
<div class="cl"> </div>
<div id="content">
<br>
<br>
<%
String trackOrderValue = (String)request.getAttribute("trackOrderValue");
if(trackOrderValue=="false"){%>
<h2> Wrong Order Number or No Order information found for provided input number</h2>
<br>
<br>
<%}%>
<%if(trackOrderValue=="true"){
ArrayList<orderInfo> orderdata = new ArrayList();
orderdata = (ArrayList<orderInfo>)request.getAttribute("orderdata");
int totalOrderValue=0;%>
<h2> Your Order Information: </h2>
<br>
<%for(int i=0; i<orderdata.size();i++) {
orderInfo totalOrderInfo = (orderInfo)orderdata.get(i);%>
<%totalOrderValue+=totalOrderInfo.getProductPrice();%>
<%}
String orderStatus = (String)request.getAttribute("orderStatus");%>
<%orderInfo uniqueOrderInfo = (orderInfo)orderdata.get(0);
String DATE_FORMAT = "MM/dd/yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
String deliverydate = sdf.format(uniqueOrderInfo.getDeliveryDate());%>
<p>Order Number : <%=uniqueOrderInfo.getOrderNumber()%></p>
<br>
<p>Shipping Address : <%=uniqueOrderInfo.getShippingAddress()%></p>
<br>
<p>User ID : <%=uniqueOrderInfo.getUserID()%></p>
<br>
<p>Total Amount Paid : $<%=totalOrderValue%></p>
<br>
<p> Delivery Date: <%=deliverydate%></p>
<br>
<p> Order Status: <%=orderStatus%></p>
<br>
<table frame='box' rules='rows'>
<tr><td></td><td>Product Name</td><td>Size</td><td>Price</td><td>Quantity</td>
</td><td></tr>
<%for(int i=0; i<orderdata.size();i++) {
orderInfo orderBean = (orderInfo)orderdata.get(i);%>
<tr>
<td>
<a href="viewProduct.jsp?productID=<%=orderBean.getProductID()%>">
<img src="css/images/img_<%=orderBean.getProductID()%>.jpg" width = '75' height = '75'>
</a>
</td>
<td><%=orderBean.getProductModel()%> </td>
<td><%=orderBean.getProductSize()%> </td>
<td>$<%=orderBean.getProductPrice()%> </td>
<td><%=orderBean.getProductQuantity()%> </td>
<td> </td>
</tr>
<%}%>
</table>
<br>
<br>
<h2> Track another order </h2>
<br>
<%}%>
<h2>You can track your order status here </h2>
<br>
<br>
<form action="trackOrder">
<table>
<tr>
<td align="center">
Please input your unique Order Number here (starts with A#):
<input type="text" name="orderNumber" required>
</td>
</tr>
<tr>
<td align="center">
<input type='submit'class="search-submit" value='Track Order' />
</td>
</tr>
</table>
</form>
<br>
<br>
<br>
</div>
<%@include file="global/sidebar.jsp"%> <!-- include from gloabl of sidebar before end main -->
</div> <!-- end Main-->
<%@include file="global/footer.jsp"%> <!-- include from gloabl of footer before end shell -->
</div>
<!-- End Shell -->
</body>
</html>