forked from kishanrajput23/Java-Projects-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorderitems.jsp
91 lines (57 loc) · 1.21 KB
/
orderitems.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
<jsp:useBean id="user" scope="session" class="obs.User"/>
<%@page import="java.sql.*"%>
<html>
<style>
a.topic {font:700 11pt verdana;color:white}
td {font:10pt verdana}
th {font:700 10pt verdana;background-color:green;color:white}
</style>
<body bgcolor="beige">
<h1>Order Items </h1>
<%
String ordid = request.getParameter("ordid");
String status = request.getParameter("status");
String cmd = "select oi.isbn,title, oi.price,qty, oi.price * qty amount from orderitem oi, books b where b.isbn = oi.isbn and ordid = " + ordid;
Connection con = user.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(cmd);
%>
<p>
<table width="100%" cellpadding=2 border=1>
<tr>
<th> ISBN
<th> Title
<th> Price
<th> Quantity
<th> Amount
</tr>
<%
while ( rs.next())
{
%>
<tr>
<td> <%=rs.getInt(1)%>
<td> <%= rs.getString(2)%>
<td> <%= rs.getInt(3)%>
<td> <%= rs.getString(4)%>
<td> <%= rs.getString(5)%>
</tr>
<%
}
rs.close();
st.close();
con.close();
%>
</table>
<p>
<%
if ( status.equals("n"))
{
%>
<a href="deleteorder.jsp?ordid=<%=ordid%>">Cancel This Order</a>
<%
}
%>
<a href="javascript:history.back()">Back </a>