forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder_detail.jsp
More file actions
117 lines (115 loc) · 4.53 KB
/
order_detail.jsp
File metadata and controls
117 lines (115 loc) · 4.53 KB
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
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="conn" scope="page" class="com.tools.ConnDB"/>
<jsp:include page="safe.jsp"/>
<%
String username="";
username=(String)session.getAttribute("username");
if(username.equals("")){
out.println("<script language='javascript'>alert('请先登录!');window.location.href='index.jsp';</script>");
}else{
if (request.getParameter("ID")!=null){
int ID=Integer.parseInt(request.getParameter("ID"));
ResultSet rs_main=conn.executeQuery("select * from tb_order where orderID="+ID);
int orderID=0;
String address="";
String postcode="";
String tel="";
String bz="";
int goodID=0;
String goodsname="";
float nowprice=0;
int number=0;
if(rs_main.next()){
orderID=rs_main.getInt("orderID");
address=rs_main.getString("address");
postcode=rs_main.getString("postcode");
tel=rs_main.getString("tel");
bz=rs_main.getString("bz");
if (bz.equals("")){
bz="无";
}
}
%>
<html>
<head>
<title>MR网络购物中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS/style.css" rel="stylesheet">
</head>
<body>
<jsp:include page="navigation.jsp"/>
<jsp:include page="login_u.jsp"/>
<jsp:include page="ad.jsp"/>
<table width="788" height="236" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="193" height="182" valign="top" bgcolor="#FFFFFF">
<jsp:include page="search.jsp"/>
<jsp:include page="goodsType.jsp"/>
</td>
<td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="45" valign="top" background="images/sub_order.gif"> </td>
</tr>
<tr>
<td height="10" valign="top"> </td>
</tr>
<tr valign="top">
<td height="134" align="center">
<table width="90%" height="131" border="0" cellpadding="0" cellspacing="0" class="tableBorder_LTR_dashed">
<tr>
<td width="16%" style="padding:5px;">订 单 号: <%=orderID%></td>
</tr>
<tr>
<td style="padding:5px;">地 址: <%=address%></td>
</tr>
<tr>
<td style="padding:5px;">邮政编码: <%=postcode%></td>
</tr>
<tr>
<td style="padding:5px;">电 话: <%=tel%></td>
</tr>
<tr>
<td style="padding:5px;">备 注: <%=bz%></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#CCCCCC" class="tableBorder_dashed">
<tr align="center" bgcolor="#eeeeee">
<td width="21%" height="24">商品名称</td>
<td width="45%">商品名称</td>
<td width="22%">单价</td>
<td width="12%">数量</td>
</tr>
<%ResultSet rs=conn.executeQuery("select * from V_order_detail where orderID="+orderID);
while(rs.next()){
goodID=rs.getInt("goodsID");
goodsname=rs.getString("goodsname");
nowprice=rs.getFloat("price");
number=rs.getInt("number");
%>
<tr align="center">
<td height="27"><%=goodsname%></td>
<td height="27"><%=goodsname%></td>
<td><%=nowprice%>(元)</td>
<td><%=number%></td>
</tr>
<%}%>
</table>
<table width="100%" height="49" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><a href="#" onClick="history.back(-1);"><img src="images/btn_return.GIF" width="52" height="20"></a></td>
</tr>
</table></td>
<td width="3%" valign="top"> </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<jsp:include page="copyright.jsp"/>
</body>
</html>
<%conn.close();
}}
%>