📄 orderlook.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- **************************************************************
**项目名称:网上书店管理端 ************************
**内容:订单查看 ************************
**此页作者:goodyear ************************
**完成日期:2004/4/26 ************************
**修改: 调试通过 ************************
**说明:
**************************************************************
-->
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*" %>
<%@ page import="page.page"%>
<HTML><HEAD><TITLE>网上商店</TITLE>
<STYLE>HTML {
TEXT-DECORATION: none
}
A:link {
COLOR: #000000; TEXT-DECORATION: underline
}
A:active {
COLOR: #000000; TEXT-DECORATION: underline
}
A:visited {
COLOR: #000000; TEXT-DECORATION: underline
}
A:hover {
COLOR: rgb(0,147,43); TEXT-DECORATION: underline
}
EM {
FONT-SIZE: 16pt; FONT-STYLE: normal; FONT-FAMILY: CourierNew
}
A {
FONT-SIZE: 9pt
}
TD {
FONT-SIZE: 9pt
}
P {
FONT-SIZE: 9pt
}
.hh INPUT {
BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid; BACKGROUND-COLOR: #ffffff
}
</STYLE>
<%
String admin=(String)session.getAttribute("name");
if(admin==null||admin==""){
%>
<script>
alert("你尚未登录");
</script>
<%
response.sendRedirect("login.jsp");
}
%>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD>
<BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff
leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<SCRIPT language=JavaScript>
<!--
function checkss()
{
if(checkspace(document.searchform.searchkey.value !='请输入关键字')) {
document.searchform.searchkey.focus();
alert("请输入查询关键字!");
return false;
}
if(checkspace(document.searchform.searchkey.value)) {
document.searchform.searchkey.focus();
alert("请输入查询关键字!");
return false;
}
document.searchform.submit();
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width=776 align=center border=0>
<TBODY>
<TR>
<TD><IMG height=63 src="images/guide_0.gif" width=238></TD>
<TD><IMG height=63 src="images/guide_1.gif" width=538></TD></TR>
<TD><IMG height=35 src="images/guide_2.gif" width=238></TD>
<TD background=images/guide_3.gif height=35>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=2 height=10><IMG height=13 src="images/space.gif"
width=10></TD></TR>
<TR>
<TD width="8%"> </TD>
<TD width="92%"><FONT color=#ffffff>■
订单处理</FONT></TD></TR></TBODY></TABLE></TD></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=776 align=center border=0 height="524">
<TBODY>
<TD vAlign=top width=195 bgColor=#ffffff height=48>
<TABLE height=48 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<td width="98%" height="48" bgcolor="#99CC66">
<p align="left"> <font face="黑体" size="4">
功能列表 </font>
</td></TR></TBODY></TABLE></TD>
<TD vAlign=top width=581 bgColor=#ffffff height=524 rowspan="2" bordercolor="#8EEB32">
<TABLE cellSpacing=0 cellPadding=0 width="101%" style="border-collapse: collapse; border-left-style: solid; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px; padding: 0; border-right-style:solid; border-bottom-style:solid" bordercolor="#99CC66" height="518">
<TBODY>
<tr>
<FORM id=Form1 name=searchform
action=dealOrder.jsp method=post>
<TD bgColor=#bede9e height=25 align=top>
<DIV align=center>
<IMG height=16
src="images/search.gif" width=64 align=middle>
<INPUT onfocus="this.value=''" value=请输入关键字 name=searchkey size="20">
<SELECT
id=action name=action size="1"> <OPTION value=1 selected>订单号</OPTION>
<option value="2">用户名</option>
</SELECT> <INPUT id=Submit1 style="BORDER-RIGHT: #333333 1px solid; BACKGROUND-POSITION: 0% 50%; BORDER-TOP: #333333 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 12px; BACKGROUND-ATTACHMENT: scroll; BORDER-LEFT: #333333 1px solid; COLOR: #333333; LINE-HEIGHT: normal; BORDER-BOTTOM: #333333 1px solid; BACKGROUND-REPEAT: repeat; FONT-STYLE: normal; HEIGHT: 18px; BACKGROUND-COLOR: #cee7ef; FONT-VARIANT: normal" onclick="return checkss();" type=submit value=立即查询 name=Submit>
</DIV></TD></FORM></TR>
<TD vAlign=top width=581 bgColor=#ffffff height=400>
<TABLE cellSpacing=4 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD height=389><FONT color=#000000>
<SCRIPT>
function cm(nn){
qus=confirm("确实要删除吗?")
if(qus!=0){
window.location='order1.php?step=del&orderid='+nn;
}
}
</SCRIPT>
</FONT>
<div align="center">
<TABLE cellSpacing=0 cellPadding=0 width="567"
border=0>
<TBODY>
<TR bgColor=#99cc66>
<TD width=70 height=24>
<DIV align=center><FONT color=#000000>订单号</FONT></DIV></TD>
<TD width=66>
<DIV align=center>姓名</DIV></TD>
<TD width=87 height=24>
<DIV align=center><font color="#000000">图书名</font></DIV></TD>
<TD width=51 height=24>
<DIV align=center><font color="#000000">册数</font></DIV></TD>
<TD width=44 height=24>
<DIV align=center><font color="#000000">单价</font></DIV></TD>
<TD width=83 height=24>
<DIV align=center>日期</DIV></TD>
<TD width=57 height=24>
<DIV align=center>付款</DIV></TD>
<TD width=46 height=24>
<DIV align=center>配送</DIV></TD>
<TD width=45 height=24>
<DIV align=center>取消</DIV></TD></TR>
<%
////分页信息
page myPage=(page)session.getValue("myPage"); //获得page对象
if(myPage==null) //第一次进入查询
{
myPage=new page();
myPage.pageSize = 10; //设置每张网页显示两笔记录
myPage.pageID = 1; //设置欲显示的页数
myPage.recordCount = 0; //ResultSet的记录笔数
myPage.pageCount = 0; //ResultSet分页后的总页数
}
String orderID=request.getParameter("orderID"); //订单ID
int ShowPage=0; //显示的页号
String sql=new String();
////查询条件
sql="SELECT o.orderID,o.logName,o.orderDate,b.bookName,i.bookNum,i.unitPrice,i.itemID FROM item i,myorder o,book b WHERE";
sql=sql+" o.orderID=i.orderID and i.bookID=b.bookID and o.orderID='"+orderID+"'";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:bookStore");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery(sql);
rs.last(); //将指标移至最后一笔记录
//取得ResultSet中记录的笔数
myPage.recordCount = rs.getRow();
//计算显示的页数
myPage.pageCount = ((myPage.recordCount % myPage.pageSize) == 0 ? (myPage.recordCount/myPage.pageSize) : (myPage.recordCount/myPage.pageSize)+1);
////没有找到满足条件的
if(myPage.recordCount<=0) //没有找到
{
%>
<td width="70">
<p>
<p>
<p>
<p align=center><font color=red size=4>没有找到满足条件的图书!!!</font>
<p>
<p>
<p>
<%
}
else
{
////分页处理
String ToPage = request.getParameter("ToPage");
if(ToPage==null)
ToPage="1";
//判断是否可正确取得ToPage参数,
//可取得则表示JSP网页应显示特定分页记录的语句
if(ToPage != null)
{
ShowPage = Integer.parseInt(ToPage); //取得指定显示的分页页数
//下面的if语句将判断用户输入的页数是否正确
if(ShowPage > myPage.pageCount)
{ //判断指定页数是否大于总页数, 是则设置显示最后一页
ShowPage = myPage.pageCount;
}
else if(ShowPage <= 0)
{ //若指定页数小于0, 则设置显示第一页的记录
ShowPage = 1;
}
myPage.pageID=ShowPage;
session.setAttribute("myPage",myPage);
}
//计算欲显示页的第一笔记录位置
rs.absolute((ShowPage - 1) * myPage.pageCount + 1);
%>
<%
//利用For循环配合myPage.pageSize属性输出一页中的记录
for(int i = 1; i <= myPage.pageSize; i++)
{
int bookNum=rs.getInt("bookNum");
String itemID=rs.getString("itemID");
%>
<TR bgColor=#f3f3f3>
<TD width=70 height=20>
<DIV align=center><FONT color=#000000><%=rs.getString("orderID")%> </FONT></DIV></TD>
<TD width=66>
<DIV align=center><%=rs.getString("logName")%></DIV></TD>
<TD width=87 height=20 align="left">
<DIV align=left><%=rs.getString("bookName")%></DIV></TD>
<TD class=hh width=51 height=20>
<DIV align=center><%=bookNum%></DIV></TD>
<TD class=bb width=44 height=20>
<DIV align=center><FONT color=#000000>¥ <%=rs.getDouble("unitPrice")%> </FONT></DIV></TD>
<TD class=bb width=83 height=20>
<DIV align=center> <%=rs.getDate("orderDate")%>
</DIV></TD>
<form name=order method=post action="orderPay.jsp" >
<TD class=bb width=57 height=20>
<input type=hidden value=<%=itemID%> name=itemID>
<DIV align=center><INPUT type=text value=0.00 length=5 name=receivedCash size="7">
</DIV></TD>
<TD class=bb width=46 height=20>
<DIV align=center><INPUT type=submit value=确定 name=Button>
</DIV></TD>
<TD class=bb width=45 height=20>
<DIV align=center><INPUT onclick="window.open('orderDel.jsp?itemID=<%=itemID%>','browseorder','width=776,height=500')" type=button value=取消 name=Button22>
</DIV></TD></TR>
</form>
<%
//下面的if判断语句用于防止输出最后一页记录时,
//将记录指标移至最后一笔记录之后
if(!rs.next()) //判断是否到达最后一笔记录
break; //跳出for循环
} //for循环结束
} //else结束,没有搜到
%>
<%
}
catch(Exception e)
{
out.println(e.toString());
}
%>
</TBODY></TABLE></div>
<BR>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center
border=0>
<TBODY>
<TR bgColor=#99cc66>
<TD width="42%" height=12>
</TD>
<TD vAlign=center width="58%" height=12>
<DIV align=right><FONT
color=#ffffff>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -