📄 query.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*"%>
<%
request.setCharacterEncoding("gb2312");
%>
<%@ page import="java.util.Vector"%>
<jsp:useBean id="databean" scope="session" class="ConnBean.conn" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>订单查询</title>
</head>
<link href="../images/style.css" rel="stylesheet">
<body>
<table width="300" height="340" border="1" align="center"
cellpadding="0" cellspacing="0" bordercolor="#0000ff">
<tr>
<td valign="top">
<table width="800" height="127" border="0" align="center"
cellpadding="0" cellspacing="00">
<tr align="center" valign="middle" background="../images/top1.gif">
<td height="42" colspan="8" nowrap class="head">
<font color="#FF0000">
<%if (session.getAttribute("user") == null) {
out.print("<script language=\"JavaScript\">alert(\"登录后才能进行订单查询!\");location.href=\"../index.jsp\"</script>");
} else {
out.println(session.getAttribute("user"));
}%> </font> ,您所查询订单情况如下所示<input name="Submit2" type="button" value="返回首页"
onclick="javascript:location.href='../logindindex.jsp';">
<input name="Submit2" type="button" value="后退"
onclick="javascript:history.back();">
</td>
</tr>
<tr align="center" valign="middle" bgcolor="#4ad7fa">
<td align="center" height="22" colspan="8" nowrap class="head">
<font size="5" face="华文行楷" class="bgcolor">
订 单 查 询 </font>
</td>
</tr>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="21" class="bgcolor">
<strong> 书名 </strong>
</td>
<td width="80" height="21" class="bgcolor">
<strong> 数量 </strong>
</td>
<td width="120" height="21" class="bgcolor">
<strong> 单项累计 </strong>
</td>
<td width="120" height="21" class="bgcolor">
<strong> 是否发货 </strong>
</td>
<td width="120" height="21" class="bgcolor">
<strong> 订单总额 </strong>
</td>
</tr>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="10" class="bgcolor">
</td>
</tr>
<%
String subid = request.getParameter("subid");
int num = 0;
try {
String sql = "select * from userorderlist where OrderlistNo='"
+ subid + "'";
String sum = null;
String issendout = null;
ResultSet rs = databean.executeQuery(sql);
if (rs.next()) {
sum = rs.getString("TotalPrice");
issendout = rs.getString("IsSendout");
String str = "select * from orderlist where OrderlistNo='"
+ subid + "'";
ResultSet rst = databean.executeQuery(str);
while (rst.next()) {
%>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="21" class="bgcolor">
<%=rst.getString("BookName")%>
</td>
<td width="80" height="21" class="bgcolor">
<%=rst.getString("Number")%>
</td>
<td width="120" height="21" class="bgcolor">
¥
<%=rst.getString("Price")%>
</td>
<%
}
%>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="20" class="bgcolor">
</td>
</tr>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="21" class="bgcolor">
</td>
<td width="80" height="21" class="bgcolor">
</td>
<td width="120" height="21" class="bgcolor">
</td>
<td align="center" width="120" height="21" class="bgcolor">
<font color="#FF0000">
<%
out.print(issendout);
%>
</font>
</td>
<td align="center" width="120" height="21" class="bgcolor">
<font color="#FF0000">
¥ <%
out.print(sum);
%>
</font>
</td>
</tr>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="60" class="bgcolor">
</td>
</tr>
<tr align="center" valign="middle" class="bgcolor">
<td width="260" height="21" class="bgcolor">
</td>
<td width="80" height="21" class="bgcolor">
</td>
<td width="120" height="21" class="bgcolor">
</td>
<td align="center" width="120" height="21" class="bgcolor">
<font> </font>
</td>
<td align="center" width="120" height="21" class="bgcolor">
<font color="#FFcc00">
<%
out.print("No:" + subid);
%>
</font>
</td>
</tr>
<%
} else {
out.print("<script language=\"JavaScript\">alert(\"订单不存在,重新操作!\");location.href=\"listserch.jsp\"</script>");
}
} catch (SQLException e) {
e.printStackTrace();
}
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -