⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewallorders.jsp

📁 ORACLE AQ sample 演示的如何出列
💻 JSP
字号:
<%--
  *  @author   Rajat Gupta
  *  @version  1.0
  *
  *  Development Environment        : Oracle9i JDeveloper
  *  Name of the Application        : ViewAllOrders.jsp
  *  Creation/Modification History  :
  *
  *     Rajat Gupta     22-Jan-2002     Created
  *
  *  Overview of Application        :
  *    This JSP is accessible to the Retail Administrator. It displays all
  *    the orders made by the customer and the order status with some other
  *    parameters.
--%>

<%@ page language="java" %>
<%@ page errorPage="Exception.jsp" %>
<HTML><HEAD>
<script language="JavaScript1.1">
  // This function is called on submitting the Form. It first checks if any
  // radio box has been selected. If it is selected, then the form is submitted
  // and the products present in this order is retrived and showed to the Administrator.
  function displayProducts(){
    if (document.AllOrderForm.NoOrders.value == 1){
      if (isChecked()){
        document.AllOrderForm.action = "ControllerServlet?Event=DisplayProducts";
        document.AllOrderForm.submit();
      }else{
        alert("Please Select an Order To View");
      }
    }else{
      alert("There are no orders to Display");
    }
  }

  // This function checks if a radio box is selected or not.
  function isChecked(){
    var flag = false;
    if (document.AllOrderForm.ShowProducts.length > 1){
      for (i=0; i<document.AllOrderForm.ShowProducts.length; i++){
        if(document.AllOrderForm.ShowProducts[i].checked == true){
          flag = true;
        }
      }
    }else{
      if(document.AllOrderForm.ShowProducts.checked == true){
        flag = true;
      }
    }
    return flag;
  }

</script>

<TITLE>Advanced Queuing Sample - Administrator--View All Orders</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">

<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff  text=#000000>
<form name="AllOrderForm" method="post">
<%
   // Get information about all the orders in a Vector
   Vector orders = (Vector)request.getAttribute("Orders");

   // Get the size of the Vector
   int size = orders.size();
 %>

<!-- Main table -->
  <jsp:include page="include/Top.jsp" /><SPAN
                    class="greeting"> Hi <%=session.getAttribute("Name")%>. You have logged in as a Retail Administrator.</SPAN>
    <jsp:include page="include/Links.jsp" />
      <!-- Heading of the page goes here -->

     <TR><TD class="mainHeading" align="center">Orders List</TD></TR>
     <TR><TD>&nbsp;</TD></TR>
     <TR>
        <TD>
            <!-- 5th table starts here working area -->
            <TABLE border=0 cellPadding=0 cellSpacing=0 width=970 >
              <TBODY>
              <%
                if (size == 0){
              %>
              <input type="hidden" name="NoOrders" value="0">
              <TR>
                 <TD class="subHeading" colspan=3><center>
                    No Orders made yet.
                 </center></TD>
              </TR>
              <%
               }else{
              %>
              <input type="hidden" name="NoOrders" value="1">
              <TR>
                <TD valign="top" width="15%" noWrap>&nbsp;</TD>
                <TD vAlign=top width="75%">
                  <!-- 6th table starts here-->
                  <TABLE border=1 borderColor="#9BCDFF" cellPadding=2 cellSpacing=0 width="100%">
                    <TBODY>
                    <TR align="center">
                      <TD class="subHeading" width="3%">&nbsp;</TD>
                      <TD class="subHeading" width="2%">S.No</TD>
                      <TD class="subHeading" width="10%">Order Id</TD>
                      <TD class="subHeading" width="18%">Customer Name</TD>
                      <TD class="subHeading" width="14%">Order Date</TD>
                      <TD class="subHeading" width="8%">Order Total (in Local Currency)</TD>
                      <TD class="subHeading" width="45%">Status</TD>
                    </TR>
                    <%
                      // Iterate through the Vector and get the String Array from it.
                      // The String array contains various information about the
                      // order which are to be displayed.
                      for (int i=0; i<size; i++){
                        String[] orderArr = (String[])orders.elementAt(i);
                    %>
                    <TR align="center" height="25">
                      <TD>
                        <input type="radio" name="ShowProducts" value="<%=orderArr[0]%>">
                      </TD>
                      <TD class="data"><%=i+1%></TD>
                      <TD class="data"><%=orderArr[0]%></TD>
                      <TD class="data"><%=orderArr[1]%></TD>
                      <TD class="data"><%=orderArr[2]%></TD>
                      <TD class="data"><%=orderArr[3] + " " + orderArr[5] %></TD>
                      <TD class="data"><%=orderArr[4]%></TD>
                    </TR>
                    <%
                      }
                    }
                    %>
                   </TBODY>
                  </TABLE>

            <!-- 6th table ends here -->
                </TD>
                <TD width="10%">&nbsp;</TD>
              </TR>
              <TR><TD colspan=3>&nbsp;</TD></TR>
              <TR>
                <TD colspan=3 align="center"><img src="images/displayPrds.gif" border=0 onMouseUp="displayProducts();">
                </TD>
              </TR>
              </TBODY>
            </TABLE>
            <!-- 5th table ends here working area-->
        </TD>
      </TR>
      <TR>
        <TD vAlign=top align=left noWrap>&nbsp;</TD>
      </TR>
      <TR>
        <TD vAlign=top align=left ><image src="images/line.gif" height="3" width="970"></TD>
      </TR>
      <TR>
        
    <TD height=19 vAlign=top align="left"><font face="Arial, Helvetica" size=-2> 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &copy; Copyright 2002 Oracle Corporation. 
      All rights reserved.</font> </TD>
      </TR>
    </TABLE>
    <!-- Main table ends here-->
</form>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -