?? indentlist.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page session="true" %>
<%
if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
response.sendRedirect("error.htm");
} %>
<%@ page import="org.pan.web.book.*" %>
<%@ page import="org.pan.util.strFormat" %>
<jsp:useBean id="myIndentlist" scope="page" class="org.pan.web.purchase" />
<jsp:useBean id="mybook" scope="page" class="org.pan.web.booksmn" />
<jsp:useBean id="user" scope="page" class="org.pan.web.usermn" />
<%
String mesg = "";
long Id=0;
String submit= request.getParameter("submit");
if (submit!=null && !submit.equals("")){
if (myIndentlist.update(request))
mesg = "更新訂單狀態成功!";
else
mesg = "更新訂單狀態出錯!";
}
if (request.getParameter("indentid")==null || request.getParameter("indentid").equals("")) {
mesg = "你要查看的訂單清單不存在!";
} else {
try {
Id = Long.parseLong(request.getParameter("indentid"));
if (!myIndentlist.getOneIndent(Id) || !myIndentlist.getIndentList(Id)){
mesg = "你要查看的訂單清單不存在!";
}
} catch (Exception e){
mesg = "你要查看的訂單清單不存在!";
}
}
%>
<html>
<head>
<title>好易多網上書店管理系統 查看訂購清單資料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function openScript(url,name, width, height){
var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
</script>
<link rel="stylesheet" href="books.css" type="text/css">
</head>
<body bgcolor="#FFCC99" text="#000000" onload="javascript:window.focus();" >
<div align="center">
<% if(!mesg.equals("")){
out.println(mesg);
} else {
indent Ident = (indent) myIndentlist.getMy_indent().elementAt(0);
%>
<p>好易多書店圖書訂單<%= Ident.getIndentNo() %> 清單:</p>
<table width="95%" border="1" cellspacing="1" cellpadding="1" bordercolor="#CC9966">
<tr align="center">
<td>圖書名稱</td>
<td>作者</td>
<td>圖書類別</td>
<td>單價(元)</td>
<td>數量</td>
</tr>
<%
float totalprice =0;
int totalamount = 0;
for (int i=0; i<myIndentlist.getIndent_list().size();i++){
indentlist idList = (indentlist) myIndentlist.getIndent_list().elementAt(i);
if (mybook.getOnebook((int)idList.getBookNo()) ){
books bk = (books) mybook.getBooklist().elementAt(0);
%>
<tr align="center">
<td><%= bk.getBookName() %></td>
<td><%= bk.getAuthor() %></td>
<td><%= bk.getClassname() %></td>
<td><%= bk.getPrince() %></td>
<td><%= idList.getAmount() %></td>
</tr>
<% totalprice = totalprice + bk.getPrince() * idList.getAmount();
totalamount = totalamount + idList.getAmount();
} %>
<% }%><tr align="center">
<td colspan=5 >購買的總金額是:<%= totalprice %>元,總數量是<%= totalamount%>本</td> </tr>
</table>
<br>
<table width="95%" border="1" cellspacing="2" cellpadding="1" bordercolor="#CC9966">
<tr>
<td width="40%" align="right">下單用戶:</td>
<td width="60%"><%
if (user.getUserinfo(Ident.getUserId()) ) {
shopuser userinfo = (shopuser)user.getUserlist().elementAt(0); %>
<a href="#" onclick="openScript('showuser.jsp?userid=<%= Ident.getUserId() %>','showuser',450,500)"><%= userinfo.getUserName() %></a>
<%} else {
out.println("該用戶已被刪除");
}
%></td>
</tr>
<tr>
<td width="40%" align="right">下單時間:</td>
<td width="60%"><%= Ident.getSubmitTime() %></td>
</tr>
<tr>
<td width="40%" align="right">交貨時間:</td>
<td width="60%"><%= Ident.getConsignmentTime() %> </td>
</tr>
<tr>
<td width="40%" align="right">總金額:</td>
<td width="60%"><%= Ident.getTotalPrice() %> </td>
</tr>
<tr>
<td width="40%" align="right">下單時IP:</td>
<td width="60%"><%= Ident.getIPAddress() %> </td>
</tr>
<tr>
<td width="40%" align="right">用戶備注:</td>
<td width="60%"><%= strFormat.toHtml(Ident.getContent()) %> </td>
</tr>
<form name="form1" method="post" action="indentlist.jsp" >
<tr>
<td width="40%" align="right">是否付款:</td>
<td width="60%">
<input type="radio" name="payoff" value="1" <%if (!Ident.getIsPayoff()) out.print("checked") ; %>>
否<input type="radio" name="payoff" value="2" <%if (Ident.getIsPayoff()) out.print("checked") ; %>>
是</td>
</tr>
<tr>
<td width="40%" align="right">是否交貨:</td>
<td width="60%">
<input type="radio" name="sales" value="1" <%if (!Ident.getIsSales()) out.print("checked") ; %>>
否<input type="radio" name="sales" value="2" <%if (Ident.getIsSales()) out.print("checked") ; %>>
是</td>
</tr>
<tr>
<td width="40%" align="right"> </td>
<td width="60%">
<input type="hidden" name="indentid" value="<%= Id %>">
<input type="submit" name="submit" value="更新">
</td>
</tr>
</form>
</table>
<br>
<% } %>
<br><p><a href="javascript:window.close()">關閉窗口</a></p>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="center">多智能網絡有限公司開發<br>
CopyRight@2003 <br>
Email:<a href="mailto:pz990@163.net">pz990@163.net</a></td>
</tr>
</table>
</div>
</body>
</html>
<%mybook.close();
myIndentlist.close();
user.close();%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -