adm_order.jsp
上传用户:tanyanyong
上传日期:2013-06-23
资源大小:1355k
文件大小:4k
源码类别:

电子政务应用

开发平台:

MultiPlatform

  1. <%@ page session="true" %>
  2. <%
  3. if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
  4. response.sendRedirect("error.htm");
  5. } %>
  6. <%@ page import="bookshop.book.*" %>
  7. <%@ page import="bookshop.run.op_user" %>
  8. <jsp:useBean id="shop" scope="page" class="bookshop.run.op_buy" />
  9. <jsp:useBean id="user" scope="page" class="bookshop.run.op_user" />
  10. <%
  11. int pages=1;
  12. String mesg = "";
  13. if (request.getParameter("action")!=null && request.getParameter("action").equals("del")){
  14. try {
  15. long id = Long.parseLong(request.getParameter("indentid"));
  16. if (shop.delete(id)) {
  17. mesg = "删除订单资料成功!";
  18. } else {
  19. mesg = "删除订单出错!";
  20. }
  21. } catch (Exception e) {
  22. mesg ="你要删除的数据参数出错!";
  23. }
  24. }
  25. if (request.getParameter("page")!=null && !request.getParameter("page").equals("")) {
  26. String requestpage = request.getParameter("page");
  27. try {
  28. pages = Integer.parseInt(requestpage);
  29. } catch(Exception e) {
  30. mesg = "你要找的页码错误!";
  31. }
  32. shop.setPage(pages);
  33. }
  34. %>
  35. <script language="javascript">
  36.   function openScript(url,name, width, height){
  37. var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
  38. }
  39. </script>
  40. <%@include file="/bookshop/inc/adm_head.inc"%>
  41. <tr><td align="center">隽隽书店目前所有订单情况</td></tr>
  42. <tr></tr>
  43. <tr>
  44. <% if (!mesg.equals("")) out.println("<font color=red>" + mesg + "</font><br>");%>
  45.         <table width="778" border="1" cellspacing="1" cellpadding="1" bgcolor="#E4EDFB"  bordercolor="white" align="center">
  46.           <tr align="center" bgcolor="#DEF3CE"> 
  47.             <td>订单编号</td>
  48.             <td>用户名</td>
  49.             <td>下单时间</td>
  50. <td>交货时间</td>
  51.             <td>总金额</td>
  52. <td>订货IP</td>
  53. <td>付款</td>
  54.             <td>发货</td>
  55.             <td>查看</td>
  56.           </tr>
  57. <%
  58.   if (shop.getOrder()) {
  59. for(int i=0 ; i<shop.getAllorder().size(); i++){
  60. order Ident = (order) shop.getAllorder().elementAt(i); %>
  61.   <tr>
  62.             <td><%= Ident.getOrderId() %></td>
  63.             <td align="center"><%
  64. if (user.getUserinfo(Ident.getUserId())&&user.getUserlist().size()>0) {
  65. user userinfo = (user)user.getUserlist().elementAt(0); %>
  66. <a href="#" onclick="openScript('user_detail.jsp?userid=<%= Ident.getUserId() %>','showuser',450,500)"><%= userinfo.getUserName() %></a>
  67. <%} else {
  68. out.println("该用户已被删除");
  69. }
  70. %></td>
  71.             <td align="center"><%= Ident.getSubmitTime() %></td>
  72. <td align="center"><%= Ident.getConsignmentTime() %></td>
  73.             <td align="center"><%= Ident.getTotalPrice() %></td>
  74. <td align="center"><%= Ident.getIPAddress() %></td>
  75. <td align="center">
  76. <% if (Ident.getIsPayoff() )
  77. out.print("已付清");
  78. else
  79. out.print("未付");
  80. %></td>
  81.             <td align="center">
  82. <% if (Ident.getIsSales())
  83. out.print("已发货");
  84. else 
  85. out.print("未发货");
  86. %></td>
  87.             <td align="center"><a href="#"  onclick="openScript('order_detail.jsp?indentid=<%= Ident.getOrderId() %>','indent',500,500)" >详细情况</a>&nbsp;<a href="adm_order.jsp?action=del&indentid=<%= Ident.getId()%>&page=<%= shop.getPage() %>" onclick="return(confirm('你真的要删除吗?'))">删除</a></td>
  88.           </tr>
  89. <% }
  90.   }
  91. %>
  92.         </table>
  93.  <table width="778" border="0" cellspacing="1" cellpadding="1" bgcolor="#E4EDFB"  bordercolor=#CC0000 align="center">
  94.           <tr>
  95.             <td align="right">当前页第<%= shop.getPage() %>页 <a href="adm_order.jsp">首页</a>&nbsp; 
  96.               <% if (shop.getPage()>1) {%>
  97.               <a href="adm_order.jsp?page=<%= shop.getPage()-1 %>">上一页</a>&nbsp; 
  98.               <% } %>
  99.               <% if (shop.getPage()<shop.getPageCount()-1) {%>
  100.               <a href="adm_order.jsp?page=<%= shop.getPage()+1 %>">下一页</a>&nbsp; 
  101.               <% } %>
  102.               <a href="adm_order.jsp?page=<%= shop.getPageCount() %>">未页</a>&nbsp;</td>
  103.           </tr>
  104.         </table>
  105. </tr>
  106. <%@include file="/bookshop/inc/adm_tail.inc"%>