forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoods_detail.jsp
More file actions
84 lines (82 loc) · 3.25 KB
/
goods_detail.jsp
File metadata and controls
84 lines (82 loc) · 3.25 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
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="conn" scope="page" class="com.tools.ConnDB"/>
<%
String username=(String)session.getAttribute("username");
int ID=-1;
ID=Integer.parseInt(request.getParameter("ID"));
if(ID>0){
ResultSet rs=conn.executeQuery("select ID,GoodsName,Introduce,nowprice,picture from tb_goods where ID="+ID);
int goodsID=-1;
String goodsName="";
String introduce="";
float nowprice=(float)0.0;
String picture="";
if(rs.next()){
goodsID=rs.getInt(1);
goodsName=rs.getString(2);
introduce=rs.getString(3);
nowprice=rs.getFloat(4);
picture=rs.getString(5);
}
%>
<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_goodsDetail.gif"> </td>
</tr>
<tr>
<td height="10" valign="top"> </td>
</tr>
<tr valign="top">
<td height="134" align="center">
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#CFCFCF">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#F5F5F5"> </td>
</tr>
<tr>
<td width="37%" rowspan="4" align="center"><img src="images/goods/<%=picture%>" width="120" height="80"></td>
<td width="63%" height="30"> 产品名称:<span class="word_orange"><%=goodsName%></span></td>
</tr>
<tr>
<td height="30"> 单价:<%=nowprice%>(元) </td>
</tr>
<tr>
<td height="30"> 产品说明:<%=introduce%></td>
</tr>
<tr>
<td height="30"><a href="#" onClick="history.back(-1);"> <img src="images/btn_return.GIF" width="52" height="20"></a>
<%if (username!=null && username!=""){%>
<a href="cart_add.jsp?goodsID=<%=goodsID%>"><img src="images/btn_buy.GIF" width="52" height="20"></a>
<%}%></td>
</tr>
<tr>
<td height="30" colspan="2" rowspan="4" align="center" bgcolor="#F5F5F5"> </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<jsp:include page="copyright.jsp"/>
</body>
</html>
<%conn.close();
}else{
out.println("<script lanage='javascript'>alert('您的操作有误');window.location.href='index.jsp';");
}%>