public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request,
          response,
          "sessionBoth.jsp"
              + (("sessionBoth.jsp").indexOf('?') > 0 ? '&' : '?')
              + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(
                  "formName", request.getCharacterEncoding())
              + "="
              + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(
                  "editItemDetails.jsp", request.getCharacterEncoding()),
          out,
          false);
      out.write(" \n");
      out.write("\n");
      out.write("\n");

      int site_id = 0;
      DecimalFormat df = new DecimalFormat("###,###.00");
      try {
        site_id = (Integer) session.getAttribute("GlobalSiteId");
        System.out.print("In : " + site_id);
      } catch (Exception e) {
        e.printStackTrace();
      }
      String i_code = "";
      String ig_code = "";
      String i_name = "";
      String i_mrp = "";
      String i_mrp2 = "";
      String i_rate = "";
      String i_rate2 = "";
      String flag = "";
      String paramList = "";
      String changeParamList = "";
      String i_tickflag = "";
      String ibarcode = request.getParameter("ibarcode");
      i_code = request.getParameter("icodeStartWith");
      ig_code = request.getParameter("igcodeStartWith");

      i_name = request.getParameter("inameStartWith");
      i_mrp = request.getParameter("imrpStartWith");
      i_rate = request.getParameter("irateStartWith");
      i_mrp2 = request.getParameter("imrp2StartWith");
      i_rate2 = request.getParameter("irate2StartWith");
      flag = request.getParameter("flag");
      i_tickflag = request.getParameter("i_tickflg");

      item.ManageItem mi;
      mi = new item.ManageItem("jdbc/js");

      mi.listItem(
          i_code, ig_code, i_name, i_mrp, i_mrp2, i_rate, i_rate2, i_tickflag, ibarcode, site_id);

      out.write("\n");
      out.write("       <style>\n");
      out.write("       #id #tr:hover td{\n");
      out.write("       \t\tbackground-color: white;\n");
      out.write("       \t\tcursor: pointer;\n");
      out.write("       }\n");
      out.write("       #id td{\n");
      out.write("       \t\tpadding: 3px 0px 3px 5px;\n");
      out.write("       }\n");
      out.write("       </style>\n");
      out.write(
          "       <table border=\"1\" name=\"t\" id=\"id\" class=\"item3\" cellspacing = 0 cellpadding = 0 style=\"border-collapse: collapse; width: 96%;background-color: #ECFB99;\" bordercolor=black>\n");
      out.write("      \n");
      out.write("    \t <thead>\n");
      out.write("     \t\t  \t<tr align=\"left\">\n");
      out.write("\t\t\t\t<td><b>Item Code</b></td>\n");
      out.write("\t\t\t\t<td><b>Change Quantity</b></td>\n");
      out.write("\t\t\t\t<td><b>Item Group</b></td>\n");
      out.write("\t\t\t\t<td><b>Item  Name</b></td>\n");
      out.write("\t\t\t\t<td><b>Item  Barcode</b></td>\n");
      out.write("\t\t\t\t<td><b>Item Weight</b></td>\n");
      out.write("\t\t\t\t<td><b>Item MRP</b></td>\n");
      out.write("\t\t\t\t<td><b>Item Rate</b></td>\n");
      out.write("\t\t\t\t<td><b>Deal Flag</b></td>\n");
      out.write("\t\t\t\t<td><b>Ticker Flag</b></td>\n");
      out.write("\t\t\t\t<td><b>Is bachka</b></td>\n");
      out.write("\t\t\t\t<td><b>Mix Item</b></td>\n");
      out.write("\t\t\t\t<td><b>Item History</b></td>\n");
      out.write("\t\t\t</tr>\n");
      out.write("     \t</thead>\t\n");
      out.write("\t\t<tbody>\n");

      while (mi.rs.next()) {
        if (flag.equals("1")) {
          paramList =
              "EditItemForm.jsp?icode="
                  + mi.rs.getString(1)
                  + "&igcode="
                  + mi.rs.getString(7)
                  + "&iname="
                  + mi.rs.getString(3)
                  + "&iweight="
                  + mi.rs.getString(4)
                  + "&imrp="
                  + mi.rs.getString(5)
                  + "&irate="
                  + mi.rs.getString(6)
                  + "&id_type="
                  + mi.rs.getString(10)
                  + "&id_flag="
                  + mi.rs.getString(9)
                  + "&id_qty="
                  + mi.rs.getString(11)
                  + "&id_amt="
                  + mi.rs.getString(12)
                  + "&i_comm="
                  + mi.rs.getString(13)
                  + "&i_tickflag="
                  + mi.rs.getString(14)
                  + "&ibarcode="
                  + mi.rs.getString(15)
                  + "&box_qty="
                  + mi.rs.getInt(16)
                  + "&is_bachka="
                  + mi.rs.getString("is_bachka")
                  + "&is_mixture="
                  + mi.rs.getString("mix_item")
                  + "&groupCodeValue="
                  + mi.rs.getString("item_group_code");
        } else {
          paramList =
              "ItemDetails.jsp?icode="
                  + mi.rs.getString(1)
                  + "&igcode="
                  + mi.rs.getString(7)
                  + "&iname="
                  + mi.rs.getString(3)
                  + "&iweight="
                  + mi.rs.getString(4)
                  + "&imrp="
                  + mi.rs.getString(5);
        }
        changeParamList =
            "ChangeQuantityItemForm.jsp?icode="
                + mi.rs.getString(1)
                + "&igcode="
                + mi.rs.getString(7)
                + "&iname="
                + mi.rs.getString(3)
                + "&iweight="
                + mi.rs.getString(4)
                + "&imrp="
                + mi.rs.getString(5)
                + "&irate="
                + mi.rs.getString(6)
                + "&id_type="
                + mi.rs.getString(10)
                + "&id_flag="
                + mi.rs.getString(9)
                + "&id_qty="
                + mi.rs.getString(11)
                + "&id_amt="
                + mi.rs.getString(12)
                + "&i_comm="
                + mi.rs.getString(13)
                + "&i_tickflag="
                + mi.rs.getString(14)
                + "&ibarcode="
                + mi.rs.getString(15);

        out.write("\n");
        out.write("\t\t\t  <tr id=\"tr\" align=\"left\">\t\t\n");
        out.write("\t\t\t\t<td align=\"left\"><a  href=\"");
        out.print(paramList);
        out.write('"');
        out.write('>');
        out.print(mi.rs.getString(1));
        out.write("</a></td>\n");
        out.write("    \t \t\t<td><a href=\"");
        out.print(changeParamList);
        out.write("\">Change Quantity</a></td>\n");
        out.write("    \t \t\t<td>");
        out.print(mi.rs.getString(7));
        out.write("</td>\n");
        out.write("    \t \t\t<td>");
        out.print(mi.rs.getString(3));
        out.write("</td>\n");
        out.write("    \t \t\t<td>");
        out.print(mi.rs.getString(15));
        out.write("</td>\n");
        out.write("    \t \t\t<td>");
        out.print(mi.rs.getString(4));
        out.write("</td>\n");
        out.write("    \t \t\t<td>");
        out.print(df.format(mi.rs.getFloat(5)));
        out.write("</td>\n");
        out.write("    \t \t\t<td>");
        out.print(df.format(mi.rs.getFloat(6)));
        out.write("</td>\n");
        out.write("    \t \t\t");
        out.write("\n");
        out.write("    \t \t\t<td>\n");

        String msg1 = mi.rs.getString(9);
        if (msg1.equals("N")) {
          out.println("No");
        } else {
          out.println("Yes");
        }

        out.write("  \n");
        out.write("          \t\t</td><td>\n");

        String msg2 = mi.rs.getString(14);
        if (msg2.equals("N")) {
          out.println("No");
        } else {
          out.println("Yes");
        }

        out.write("  \n");
        out.write("            \t</td>\n");
        out.write("            \t<td>");
        out.print(mi.rs.getString("is_bachka"));
        out.write("</td>\n");
        out.write("            \t<td>");
        out.print(mi.rs.getString("mix_item"));
        out.write("</td><td> \n");

        String msg = mi.rs.getString(8);
        if (!msg.equals("NH")) {

          out.write("                       \n");
          out.write("            \t    <a  href=\"ItemHistoryForm.jsp?icode=");
          out.print(mi.rs.getString(1));
          out.write("\">history\n");
        }

        out.write("\t\t\t\n");
        out.write("\t\t\t\t\n");
        out.write("            \t \n");
        out.write("\t\t\t    </td></tr>\n");
        out.write("\t\t\t\n");
      }
      mi.closeAll();

      out.write("\n");
      out.write("\t\t\t <style type=\"text/css\">\n");
      out.write("\t\t\t a:link {color: blue}\n");
      out.write("\t\t\t a:hover {background: blue;color: white}\n");
      out.write("\t\t\t a:active {background: blue;color: white}\n");
      out.write("\t\t\t </style>\n");
      out.write("\n");
      out.write("\t</tbody>\n");
      out.write("</table>\n");
      out.write("\t\t\t\n");
      out.write("    \t");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html");
      pageContext =
          _jspxFactory.getPageContext(
              this,
              request,
              response,
              "ErrorPage.jsp?page=OrderProcessingSend.jsp",
              true,
              8192,
              true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write('\n');
      out.write('\n');
      out.write("\n");
      out.write(" \n");
      out.write(" \n");
      out.write("\t\t<script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n");
      out.write("\t");

      session.getAttribute("UserName").toString();
      // System.out.println("session bachka maapping : "+session +" \n user
      // "+session.getAttribute("UserName").toString());

      out.write('\n');
      out.write(' ');
      out.write('\n');

      // DecimalFormat df = new DecimalFormat("###,###.00");
      int cnt = 1;
      String orderNo = "";
      String custCode = "";
      String custName = "";
      String buildingNo = "";
      String block = "";
      String wing = "";
      String building = "";
      String area = "";
      String orderDate = "";
      String lastModifiedDate = "";
      String totalItems = "";
      String totalValueMrp = "";
      String totalValuePrice = "";
      String bagsNo = "";
      String discountAmt = "";
      String advanceAmt = "";
      String balanceAmt = "";
      String changeAmt = "";
      String paidAmt = "";
      String expectedAmt = "";
      String deliveryStaffName = "";
      String statusCode = "";
      String delchgs = "";
      String payment = "";
      double adamt = 0.0f;
      String ord_comm_amt = "";
      String submitTypeValue = "",
          startTime = "",
          orderNoArr = "",
          code = "",
          desc = "",
          deliveryPerson = "",
          divCount = "";
      String coinArray = "", commArray = "";
      boolean subFlag = true;
      int divId = 0, count = 0;
      submitTypeValue = request.getParameter("subValue");
      String sendValue = request.getParameter("send");
      DecimalFormat df = new DecimalFormat("###,###.00");
      order.ManageOrder mo;
      mo = new order.ManageOrder("jdbc/js");
      if (submitTypeValue.equals("Submitted3")) {
        mo.submittedOrdersList(submitTypeValue);
      } else if (submitTypeValue.equals("Checked3")) {
        mo.checkedOrdersList(submitTypeValue);
      } else if (submitTypeValue.equals("Both")) {
        mo.bothOrdersList();
      }

      mo.getDeliveryStaffList();

      out.write("\n");
      out.write("<center><h4>Orders List</h4>\n");
      out.write("\n");
      out.write("\t\n");
      out.write("      \n");
      out.write("<table >\n");
      out.write("\t<tr>\n");
      out.write("\t<td>\n");
      out.write("\t<table align=\"left\">\n");
      out.write(
          "\t\t<tr><td><font size=2 color=\"red\">Total Orders :</td><td><font size=2 color=\"red\"><b><div id=\"divtonosend\"></div></b></td></font></b></tr>\n");
      out.write(
          "\t\t<tr><td><font size=2 color=\"red\">Total Change :</td><td><font size=2 color=\"red\"><b><div id=\"divtotchange\"></div></td></tr>\n");
      out.write(
          "\t\t<tr><td><font size=2 color=\"red\">Total Comm.  :</td><td><font size=2 color=\"red\"><b><div id=\"divtotcomm\"></div></td></tr>\n");
      out.write(
          "\t\t<tr><td><font size=2 color=\"red\">Total  Bags   :</td><td><font size=2 color=\"red\"><b><div id=\"divtotbags\"></div></td></tr>\n");
      out.write("\t</table>\n");
      out.write("    </td>\n");
      out.write("    <td>\n");
      out.write("\t<table align=\"right\">\n");
      out.write("\t<tr>\n");
      out.write(
          "\t\t<td width=\"25%\" ><b><font size=2 color=\"red\">Delivery Person :</b></font></td>\n");
      out.write("\t\t<td>\n");
      out.write("\t\t\t<SELECT name=\"d_staff\" >\n");
      out.write("\t\t\t\t<OPTION VALUE='select' >Select staff\n");

      while (mo.rs1.next()) {
        code = mo.rs1.getString(1);
        desc = mo.rs1.getString(2);

        out.write("\n");
        out.write("\t\t\t\t<OPTION VALUE=\"");
        out.print(code);
        out.write('"');
        out.write(' ');
        out.write('>');
        out.print(desc);
        out.write('\n');
      }

      out.write("\t\t\n");
      out.write("\t\t</td>\n");
      out.write("\t\t<td>\n");
      out.write(
          "\t\t\t<INPUT type=BUTTON value='Send <Alt+n>' accesskey='n' onclick='funsend();'>\n");
      out.write("\t\t</td>\t\t\t\n");
      out.write("\t\t<td>\t\t\n");
      out.write(
          "\t\t\t<INPUT type=BUTTON value=\"Cancel <Alt+c>\" accesskey=\"c\" onClick=\"cancel();\"></center>\n");
      out.write("\t\t</td>\n");
      out.write("\t\t<td>\t\t\n");
      out.write(
          "\t\t\t<INPUT type=BUTTON value=\"Denomination <Alt+d>\" accesskey=\"d\" onClick=\"calculate();\"></center>\n");
      out.write("\t\t</td>\t\t\t\n");
      out.write("\t</tr>\n");
      out.write("\t</table>\n");
      out.write("\t</td>\n");
      out.write("</tr>\n");
      out.write("</table><br>\n");
      out.write("\n");
      out.write("<div>\n");
      out.write(
          "\t<table border=\"1\" id=\"sendid\" style=\"width=100%;display:none;border-collapse: collapse;\" >\n");
      out.write("\t<thead>\n");
      out.write("\t\t<tr>\t\n");
      out.write("\t\t\t    <td ><b>Area</b></td>\n");
      out.write("\t\t\t    <td ><b>Order</b></td>\t\t\n");
      out.write("\t\t\t\t<td><b>Customer</b></td>\t\t\t\t\t\n");
      out.write("\t\t\t\t<td ><b>Order Date</b></td>\t\t\t\n");
      out.write("\t\t\t\t<td ><b>Items</b></td>\n");
      out.write("\t\t\t\t<td><b>Payment</b></td>\n");
      out.write("\t\t\t\t\n");
      out.write("\t\t\t\n");
      out.write("\t\t\t\t\n");
      out.write("\t\t\t\t<td> <b>Total</b></td>\n");
      out.write("\t\t\t\t<td><b>Advance/Discount</b></td>\n");
      out.write("\t\t\t\t<td><b>Del Chgs</b></td>\n");
      out.write("\t\t\t\t<td><b>Balance</b></td>\t\n");
      out.write("\t\t\t\t<td><b>Change</b></td>\t\n");
      out.write("\t\t\t\t<td><b>Expected</b></td>\n");
      out.write("\t\t\t\t<td><b>Total Bags</b></td>\n");
      out.write("\t\t\t\t<td colspan=\"2\"><b>Action</b></td>\t\n");
      out.write("\t\t\t\t<td colspan=\"1\"><b>Comm Amt</b></td>\t\n");
      out.write("\t\t\t</tr>\n");
      out.write("\t</thead>\n");
      out.write("\t<tbody>\n");
      out.write("\t</tbody>\n");
      out.write("</table>\n");
      out.write("</div>\n");
      out.write("\n");
      out.write("\n");
      out.write("<br><hr color=\"red\">\n");
      out.write("<div id=\"searchTable\">        \n");
      out.write("<table >\n");
      out.write(
          "\t<tr><td width=\"25%\"><font size=2 color=\"red\">Total Orders :  <b><div id=\"divtono\"></div></b></font></b></td>\n");
      out.write("\t\n");
      out.write(
          "\t\t<td width=\"25%\" ><b><font size=2 color=\"red\">Order Number :</font></b></td>\n");
      out.write("\t\t<td>\n");
      out.write("\t\t\t <input type=\"text\" name=\"search\" size=\"7\" value=''>\n");
      out.write("\t\t</td>\t\n");
      out.write("\n");
      out.write("\t\t<td>\n");
      out.write(
          "\t\t\t<INPUT type=BUTTON value=\"Search <Alt+S>\" accesskey=\"s\" onClick=\"searchOno();\">\n");
      out.write("\t\t</td>\n");
      out.write("\t\t<td>\n");
      out.write(
          "\t\t\t<input type=\"reset\" name=\"clear\" accesskey=\"r\" value=\"Clear <Alt+r>\">\n");
      out.write("\t\t</td>\t\t\t\n");
      out.write("\t\t<td>\t\t\n");
      out.write(
          "\t\t\t<INPUT type=BUTTON value=\"Cancel <Alt+c>\" accesskey=\"c\" onClick=\"cancel();\"></center>\n");
      out.write("\t\t</td>\t\t\n");
      out.write("\t</tr>\n");
      out.write("</table><br>\n");
      out.write("</div>\n");
      out.write("<table border=\"1\" name=\"t\" id=\"id\" style=\"width=100%;\" >\n");
      out.write("\n");
      out.write("\t\t\t <tr>\t\n");
      out.write("\t\t\t    <td ><b>Area</b></td>\n");
      out.write("\t\t\t    <td ><b>Order</b></td>\t\t\n");
      out.write("\t\t\t\t<td><b>Customer</b></td>\t\t\t\t\t\n");
      out.write("\t\t\t\t<td ><b>Order Date</b></td>\t\t\t\n");
      out.write("\t\t\t\t<td ><b>Items</b></td>\n");
      out.write("\t\t\t\t<td><b>Payment</b></td>\n");
      out.write(
          "\t\t\t\t<td colspan=\"6\" align=\"center\"><b>Amounts</b></td>\t\t\t\t\t\t\t\t\t\t\t\n");
      out.write("\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t<td colspan=\"6\"></td>\n");
      out.write("\t\t\t\t<td> <b>Total</b></td>\n");
      out.write("\t\t\t\t<td><b>Advance/Discount</b></td>\n");
      out.write("\t\t\t\t<td><b>Del Chgs</b></td>\n");
      out.write("\t\t\t\t<td><b>Balance</b></td>\t\n");
      out.write("\t\t\t\t<td><b>Change</b></td>\t\n");
      out.write("\t\t\t\t<td><b>Expected</b></td>\n");
      out.write("\t\t\t\t<td><b>Bags</b></td>\n");
      out.write("\t\t\t\t<td colspan=\"2\"><b>Action</b></td>\t\n");
      out.write("\t\t\t</tr>\n");
      out.write("\t\t\t<tbody>\n");

      int i = 0, rowID = 0;
      while (mo.rs.next()) {
        i = 1;
        count++;
        divCount = count + "#";
        orderNo = mo.rs.getString("order_num");
        custCode = mo.rs.getString("custcode");
        custName = mo.rs.getString("custname");
        buildingNo = mo.rs.getString("building_no");
        block = mo.rs.getString("block");
        wing = mo.rs.getString("wing");
        building = mo.rs.getString("building");
        area = mo.rs.getString("area");
        orderDate = mo.rs.getString("order_date");
        lastModifiedDate = mo.rs.getString("lastmodifieddate");
        totalItems = mo.rs.getString("total_items");
        totalValueMrp = mo.rs.getString("total_value_mrp");
        totalValuePrice = mo.rs.getString("total_value");
        bagsNo = mo.rs.getString("bags");
        // System.out.println("bagsNo is:"+bagsNo);
        discountAmt = mo.rs.getString("discount_amt");
        advanceAmt = mo.rs.getString("advance_amt");
        balanceAmt = mo.rs.getString("balance_amt");
        changeAmt = mo.rs.getString("change_amt");
        paidAmt = mo.rs.getString("paid_amt");
        expectedAmt = mo.rs.getString("expected_amt");
        deliveryStaffName = mo.rs.getString("dstaff_name");
        statusCode = mo.rs.getString("status_code");

        delchgs = mo.rs.getString("other_charges");
        payment = mo.rs.getString("payment_type_desc");
        ord_comm_amt = df.format(mo.rs.getFloat("ord_comm_amt"));
        cnt = cnt + 1;
        // System.out.println("value of ord_comm_amt in jsp"+ord_comm_amt);
        // System.out.println("comm amt "+ord_comm_amt);

        out.write("      \t\n");
        out.write("\t\t\t<input type=\"hidden\" name=\"hcommAmt");
        out.print(cnt);
        out.write("\" value=\"");
        out.print(ord_comm_amt);
        out.write("\">\n");
        out.write("\t\t\t\n");
        out.write("  \t\t \t<tr id=\"row");
        out.print(rowID);
        out.write("\" class=\"");
        out.print(orderNo);
        out.write("\">\n");
        out.write("  \t\t \t\t<td align=\"center\" title=\"");
        out.print(mo.rs.getString(12));
        out.write(',');
        out.print(mo.rs.getString(13));
        out.print(mo.rs.getString(14));
        out.write(',');
        out.print(mo.rs.getString(15));
        out.write(',');
        out.print(mo.rs.getString(8));
        out.write('"');
        out.write('>');
        out.write('\n');

        out.println(area);

        out.write("    \n");
        out.write("     \t\t\t</td>\n");
        out.write("\t      \t\t\t<td id=\"orderNum");
        out.print(rowID);
        out.write("\" align=\"center\" title=\"");
        out.print(mo.rs.getString(12));
        out.write(',');
        out.print(mo.rs.getString(13));
        out.print(mo.rs.getString(14));
        out.write(',');
        out.print(mo.rs.getString(15));
        out.write(',');
        out.print(mo.rs.getString(8));
        out.write("\">\n");
        out.write("\t      \t\t\t<a href=\"Javascript:AddRow('");
        out.print(custName);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(orderNo);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(area);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(orderDate);
        out.write("',\n");
        out.write("\t      \t\t\t'");
        out.print(totalItems);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(totalValuePrice);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(advanceAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(discountAmt);
        out.write("',\n");
        out.write("\t      \t\t\t'");
        out.print(balanceAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(delchgs);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(adamt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(payment);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(changeAmt);
        out.write("',\n");
        out.write("\t      \t\t\t'");
        out.print(expectedAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(bagsNo);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(cnt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(statusCode);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(ord_comm_amt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(rowID);
        out.write("');\">\n");

        out.println(orderNo);

        out.write("\n");
        out.write("\t\t\t\t</td><td align=\"center\" >\t\n");

        out.println(custName);

        out.write("\n");
        out.write("\t\t\t\t</td><td align=\"center\" >\t\n");

        out.println(orderDate);

        out.write("       \t      \t\t      \t\t\t\t\t\t\t\n");
        out.write("\t      \t\t</td><td align=\"center\" >\n");

        out.println(totalItems);

        out.write("\n");
        out.write("\t      \t\t</td><td align=\"center\">\n");
        if (payment.equals("Credit")) {

          out.write("\t\n");
          out.write("\t\t\t\t<a href=\"ChangePaymentTypeForm.jsp?orderNo=");
          out.print(orderNo);
          out.write('"');
          out.write('>');
          out.write('\n');

          out.println(payment);

          out.write("\n");
          out.write("\t\t\t\t</a>\n");

        } else {
          out.println(payment);
        }

        out.write("\n");
        out.write("\t      \t\t</td><td align=\"center\" >\n");

        out.println(totalValuePrice);

        out.write("    \t\t\t\t\t\n");
        out.write("\t      \t\t</td><td align=\"center\" >\n");

        if (advanceAmt != null && discountAmt != null) {
          adamt = Double.parseDouble(advanceAmt) - Double.parseDouble(discountAmt);
        }
        out.println(adamt);

        out.write("\n");
        out.write("\t\t\t\t</td><td align=\"center\" >\n");

        out.println(delchgs);

        out.write("      \t\n");
        out.write("\t \t\t\t</td><td align=\"center\" >\n");

        out.println(balanceAmt);

        out.write("      \t\n");
        out.write("\t \t\t\t</td><td align=\"center\" id=\"change");
        out.print(rowID);
        out.write("\" >\n");

        out.println(changeAmt);

        out.write("      \t\n");
        out.write("\t \t\t\t</td><td align=\"center\" >\n");

        out.println(expectedAmt);

        out.write("      \t\n");
        out.write("\t \t\t\t</td><td align=\"center\" id=\"bag");
        out.print(rowID);
        out.write('"');
        out.write('>');
        out.write('\n');

        out.println(bagsNo);

        out.write("      \t\n");
        out.write("\t \t\t\t</td>\n");
        out.write("\t \t\t\t\n");
        out.write("\t \t\t\t<td align=\"center\" id=\"send");
        out.print(rowID);
        out.write("\">\n");
        out.write("\t  \t\t\t\t<a href=\"Javascript:AddRow('");
        out.print(custName);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(orderNo);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(area);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(orderDate);
        out.write("',\n");
        out.write("\t  \t\t\t\t'");
        out.print(totalItems);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(totalValuePrice);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(advanceAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(discountAmt);
        out.write("',\n");
        out.write("\t  \t\t\t\t'");
        out.print(balanceAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(delchgs);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(adamt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(payment);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(changeAmt);
        out.write("',\n");
        out.write("\t  \t\t\t\t'");
        out.print(expectedAmt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(bagsNo);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(cnt);
        out.write("',\n");
        out.write("\t  \t\t\t\t'");
        out.print(statusCode);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(ord_comm_amt);
        out.write('\'');
        out.write(',');
        out.write('\'');
        out.print(rowID);
        out.write("');\">\n");
        out.write("\t  \t\t\t\t\n");

        out.println("Send");

        out.write("\t\t\t\t\n");
        out.write("\t\t\t\t</td><td align=\"center\" id=\"TA");
        out.print(rowID);
        out.write("\">\n");
        out.write("\t\t\t\t<a href=\"DeliveryDetailsForm.jsp?orderNo=");
        out.print(orderNo);
        out.write("&subValue=");
        out.print(statusCode);
        out.write("\" title=\"");
        out.print(mo.rs.getString(12));
        out.write(',');
        out.print(mo.rs.getString(13));
        out.print(mo.rs.getString(14));
        out.write(',');
        out.print(mo.rs.getString(15));
        out.write(',');
        out.print(mo.rs.getString(8));
        out.write("\" >\n");

        out.println("T.A.");

        if (divId == 0) {
          orderNoArr = orderNo;
          commArray = orderNo + "|" + ord_comm_amt;

        } else {
          orderNoArr = orderNoArr + "|" + orderNo;
          commArray = commArray + "|" + orderNo + "|" + ord_comm_amt;
        }
        divId++;
        rowID++;

        out.write("\n");
        out.write("\t \t  </a></td><td style=\"display: none;\">\n");
        out.write("\t \t  ");
        out.print(ord_comm_amt);
        out.write("\t\n");
        out.write("\t \t  </td>\n");
        out.write("\t \t  </tr>\n");
        out.write("\t \t  ");
      }
      mo.getcoininfo();
      while (mo.rs2.next()) {
        coinArray = coinArray + "|" + mo.rs2.getString(1);
      }

      mo.closeAll();
      System.out.println("\n\n row ID " + rowID);

      out.write("\n");
      out.write("               \n");
      out.write("</tbody>\n");
      out.write("\n");
      out.write("<input type=\"hidden\" name=\"horderArray\">\n");
      out.write("<input type=\"hidden\" name=\"hcommArray\"  value=\"");
      out.print(commArray);
      out.write("\">\n");
      out.write("<input type=\"hidden\" name=\"hcoinArray\" value=\"");
      out.print(coinArray);
      out.write("\">\n");
      out.write("<input type=\"hidden\" name=\"horderArr\" value=\"");
      out.print(orderNoArr);
      out.write("\">\t\n");
      out.write("<input type=\"hidden\" name=\"hchangeArray\" value=\"\">\t\t\n");
      out.write("<input type=\"hidden\" name=\"hcountorder\" value=\"");
      out.print(count);
      out.write("\">\t\n");
      out.write("\t\n");
      out.write("\t\n");
      out.write("<input type=\"hidden\" name=\"htotalchangeamt\" value=\"\">\n");
      out.write("<input type=\"hidden\" name=\"htotalordercnt\" value=\"\">\n");
      out.write("<input type=\"hidden\" name=\"htotalpaidamt\" value=\"\">\t\t\n");
      out.write("</table>\t  \n");
      out.write("\n");
      out.write("\n");
      out.write("\t      \t");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;

    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n\n");
      out.write("\n\n");

      PollerConfiguration pollconfig = getPollerConfiguration();
      org.opennms.netmgt.config.poller.Package pkg = null;

      int pkgIdx = -1;

      String pkgIdxStr = (String) request.getParameter("pkgidx");
      if (pkgIdxStr != null && pkgIdxStr.trim().length() > 0) {
        try {
          pkgIdx = Integer.parseInt(pkgIdxStr);
          if (pkgIdx >= 0) {
            if (pollconfig != null) {
              pkg = pollconfig.getPackage(pkgIdx);
            }
          }
        } catch (NumberFormatException ne) {
          ne.printStackTrace();
        }
      }

      if (pkg == null) {
        if ((org.opennms.netmgt.config.poller.Package) request.getSession().getAttribute("pkg")
            != null) {
          pkg = (org.opennms.netmgt.config.poller.Package) request.getSession().getAttribute("pkg");
        }
      }

      if (pkgIdx == -1) {
        pkgIdxStr = (String) request.getSession().getAttribute("pkgidx");
        if (pkgIdxStr != null && pkgIdxStr.trim().length() > 0) {
          try {
            pkgIdx = Integer.parseInt(pkgIdxStr);
          } catch (NumberFormatException ne) {
            ne.printStackTrace();
          }
        }
      }

      request.getSession().setAttribute("pkg", pkg);
      request.getSession().setAttribute("pkgidx", String.valueOf(pkgIdx));

      String title = " Poller Package Downtime Model";
      if (pkg != null) {
        title = " Poller Package - Downtime Model for: " + pkg.getName();
      }

      out.write("\n\n");
      out.write("<html>\n");
      out.write("<head>\n  ");
      out.write("<title>");
      out.print(title);
      out.write("</title>\n  ");
      out.write(
          "<link rel=\"stylesheet\" type=\"text/css\" href=\"/wt-portal/css/default.css\" />\n  ");
      out.write("<script type=\"text/javascript\" src=\"/wt-portal/javascript/WTtools.js\">");
      out.write("</script>\n\n");
      out.write(
          "<script language=javascript>\nfunction confirmDelete(msg)\n{\n\tvar agree=confirm(msg);\n\tif (agree)\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\nfunction addDowntime()\n{\n    var msg = \"\";\n    var error = false;\n    var begin = 0;\n    var end = 0;\n    var interval = 0;\n\n    dtbeginday = parseInt(document.downtime.dtbeginday.value) * 24 * 60 * 60 * 1000;\n    dtbeginhour = parseInt(document.downtime.dtbeginhour.value) * 60 * 60 * 1000;\n    dtbeginminute = parseInt(document.downtime.dtbeginminute.value) * 60 * 1000;\n    dtbeginsecond = parseInt(document.downtime.dtbeginsecond.value) * 1000;\n    dtbeginmillisecond = parseInt(document.downtime.dtbeginmillisecond.value);\n\n    dtendday = parseInt(document.downtime.dtendday.value) * 24 * 60 * 60 * 1000;\n    dtendhour = parseInt(document.downtime.dtendhour.value) * 60 * 60 * 1000;\n    dtendminute = parseInt(document.downtime.dtendminute.value) * 60 * 1000;\n    dtendsecond = parseInt(document.downtime.dtendsecond.value) * 1000;\n    dtendmillisecond = parseInt(document.downtime.dtendmillisecond.value);\n");
      out.write(
          "\n    dtintervalday = parseInt(document.downtime.dtintervalday.value) * 24 * 60 * 60 * 1000;\n    dtintervalhour = parseInt(document.downtime.dtintervalhour.value) * 60 * 60 * 1000;\n    dtintervalminute = parseInt(document.downtime.dtintervalminute.value) * 60 * 1000;\n    dtintervalsecond = parseInt(document.downtime.dtintervalsecond.value) * 1000;\n    dtintervalmillisecond = parseInt(document.downtime.dtintervalmillisecond.value);\n\n    document.downtime.dtbegin.value = dtbeginday + dtbeginhour + dtbeginminute + dtbeginsecond + dtbeginmillisecond;\n    document.downtime.dtend.value = dtendday + dtendhour + dtendminute + dtendsecond + dtendmillisecond;\n    document.downtime.dtinterval.value = dtintervalday + dtintervalhour + dtintervalminute + dtintervalsecond + dtintervalmillisecond;\n\n\tvar beginVal = trim(document.downtime.dtbegin.value);\n\tvar endVal = trim(document.downtime.dtend.value);\n\tvar intervalVal = trim(document.downtime.dtinterval.value);\n\n    if (beginVal == \"\") {\n        error = true;\n        msg += \"Must enter a numeric time value for \\\"begin\\\".\\n\";\n");
      out.write(
          "    }\n    if (endVal == \"\") {\n        error = true;\n        msg += \"\\nMust enter a numeric time value for \\\"end\\\".\\n\";\n    }\n    if (intervalVal  == \"\") {\n        error = true;\n        msg += \"\\nMust enter a numeric time value for \\\"interval\\\".\\n\";\n    }\n    if (isNaN(beginVal)) {\n        error = true;\n        msg += \"\\nMust enter a numeric time value for \\\"begin\\\".\\n\";\n    }\n    if (isNaN(endVal)) {\n        error = true;\n        msg += \"\\nMust enter a numeric time value for \\\"end\\\".\\n\";\n    }\n    if (isNaN(intervalVal)) {\n        error = true;\n        msg += \"\\nMust enter a numeric time value for \\\"interval\\\".\\n\";\n    }\n\n    if (!error) {\n        begin = parseInt(beginVal);\n        end = parseInt(endVal);\n        interval = parseInt(intervalVal);\n    \n        if (!(end > 0)) {\n            error = true;\n            msg = \"The end time must be greater than zero.\\n\";\n        }\n        if (!(interval > 0)) {\n            error = true;\n            msg += \"\\nThe 'interval' value must be greater than zero.\\n\";\n        }\n");
      out.write(
          "        if (!((end - begin) > 0)) {\n            error = true;\n            msg += \"\\nThe 'end' time must be greater than the 'begin'.\\n\";\n        }\n        if (!(interval ");
      out.write(
          "<= (end - begin))) {\n            error = true;\n            msg += \"\\nThe 'interval' time must be less than the difference of the 'begin' and the 'end'.\\n\";\n        }\n    }\n\n    if (error) {\n        alert (msg);\n        return;\n    }\n    else\n    {\n        document.downtime.target = \"pollerDetailFrame\";\n    \tdocument.downtime.action.value = 'adddt';\n    \tdocument.downtime.submit();\n    }\n}\n\nfunction removeDowntime(dtidx)\n{\n    if (confirmDelete('Are you sure you want to delete this downtime model?')) {\n        document.downtime.target = \"pollerDetailFrame\";\n        document.downtime.action.value = 'removedt';\n        document.downtime.dtidx.value = dtidx;\n    \tdocument.downtime.submit();\n    }\n}\n\nfunction updateDowntime()\n{\n    document.downtime.target = \"_parent\";\n    document.downtime.action.value = 'updatedt';\n\tdocument.downtime.submit();\n}\n\nfunction restoreDefaultDowntime()\n{\n    if (confirmDelete('Are you sure you want to restore the default downtime model? All your changes will be lost.')) {\n        document.downtime.target = \"pollerDetailFrame\";\n");
      out.write(
          "        document.downtime.action.value = 'restoredt';\n    \tdocument.downtime.submit();\n    }\n}\n");
      out.write("</script>\n");
      out.write("</head>\n");
      out.write("<body>\n\n\t");
      String breadcrumb1 = "<a href='admin/index.jsp'></a>";
      out.write("\n\t");
      String breadcrumb2 = "Poller Packages";
      out.write("\n\t");
      JspRuntimeLibrary.include(
          request,
          response,
          "/includes/header.jsp"
              + "?"
              + "title="
              + java.net.URLEncoder.encode("" + title)
              + "&"
              + "location="
              + "admin"
              + "&"
              + "help="
              + "monitoringadmin%2Fpolling%2FWTHelp_PollerPackageDowntimeModel.html"
              + "&"
              + "noPopOut="
              + "true"
              + "&"
              + "breadcrumb="
              + java.net.URLEncoder.encode("" + breadcrumb1)
              + "&"
              + "breadcrumb="
              + java.net.URLEncoder.encode("" + breadcrumb2),
          out,
          false);
      out.write("\n");
      out.write("<!-- BEGIN FRAMING TABLE:open tags, keep at 100%-->\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t");
      out.write("<tr>\n\t\t");
      out.write("<td width=\"10\">");
      out.write(
          "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"1\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">");
      out.write("</td>\n\t\t");
      out.write("<td>\n");
      out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n\t");
      out.write("<form action=\"");
      out.print(WTTools.getMonServletURL(request));
      out.write("WTPollerPackages\" method=\"post\" name=\"downtime\" target=\"_parent\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"action\" value=\"\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"pkgidx\" value=\"\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"dtidx\" value=\"\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"dtbegin\" value=\"\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"dtend\" value=\"\">\n\t  ");
      out.write("<input type=\"hidden\" name=\"dtinterval\" value=\"\">\n\n");
      out.write("<table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n     ");
      out.write("<tr>\n        ");
      out.write("<td colspan=\"4\">");
      out.write("<b>Downtime Model:");
      out.write("</b>");
      out.write("<a class=\"tt\" href=\"javascript: towerTip(");
      out.print(WTTips.TIP_POLLER_MON_SERVICE);
      out.write(");\" title=\"Telemetry Tip\">");
      out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">");
      out.write("</a>");
      out.write("</td>\n    ");
      out.write("</tr>\n     ");
      out.write("<tr class=\"tableHeader\">\n        ");
      out.write("<td class=\"tableHeader\" width=\"25%\">Begin Time");
      out.write("<a class=\"tt\" href=\"javascript: towerTip(");
      out.print(WTTips.TIP_POLLER_DT_BEGIN);
      out.write(");\" title=\"Telemetry Tip\">");
      out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">");
      out.write("</a>");
      out.write("</td>\n        ");
      out.write("<td class=\"tableHeader\" width=\"25%\">End Time");
      out.write("<a class=\"tt\" href=\"javascript: towerTip(");
      out.print(WTTips.TIP_POLLER_DT_END);
      out.write(");\" title=\"Telemetry Tip\">");
      out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">");
      out.write("</a>");
      out.write("</td>\n        ");
      out.write("<td class=\"tableHeader\" width=\"25%\">Polling Interval");
      out.write("<a class=\"tt\" href=\"javascript: towerTip(");
      out.print(WTTips.TIP_POLLER_DT_INTERVAL);
      out.write(");\" title=\"Telemetry Tip\">");
      out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">");
      out.write("</a>");
      out.write("</td>\n        ");
      out.write("<td class=\"tableHeader\" width=\"25%\">Action");
      out.write("</td>\n    ");
      out.write("</tr>\n        ");

      long daymilli = 24 * 60 * 60 * 1000; // 86400000
      long hourmlli = 60 * 60 * 1000; // 3600000;
      long minutemilli = 60 * 1000; // 60000;
      long secondmilli = 1000;

      String pattern2digit = "00";
      DecimalFormat df2digit = new DecimalFormat(pattern2digit);

      String pattern3digit = "000";
      DecimalFormat df3digit = new DecimalFormat(pattern3digit);

      long begin = 0;
      long end = 0;
      long interval = 0;
      String delete = null;
      long addbegin = 0;
      if (pkg != null) {
        Downtime[] ds = pkg.getDowntime();
        if (ds != null) {
          for (int i = 0; i < ds.length; i++) {
            Downtime d = ds[i];

            begin = d.getBegin();
            end = d.getEnd();
            interval = d.getInterval();
            delete = d.getDelete();

            long dtbegin = begin;
            long dtend = end;
            long dtinterval = interval;
            addbegin = begin;

            long dtbeginday = 0;
            long dtbeginhour = 0;
            long dtbeginminute = 0;
            long dtbeginsecond = 0;
            long dtbeginmillisecond = 0;

            long dtendday = 0;
            long dtendhour = 0;
            long dtendminute = 0;
            long dtendsecond = 0;
            long dtendmillisecond = 0;

            long dtintervalday = 0;
            long dtintervalhour = 0;
            long dtintervalminute = 0;
            long dtintervalsecond = 0;
            long dtintervalmillisecond = 0;

            if (dtbegin > 0) {
              dtbeginday = dtbegin / daymilli;
              dtbegin -= (dtbeginday * daymilli);
            }
            if (dtbegin > 0) {
              dtbeginhour = dtbegin / hourmlli;
              dtbegin -= (dtbeginhour * hourmlli);
            }
            if (dtbegin > 0) {
              dtbeginminute = dtbegin / minutemilli;
              dtbegin -= (dtbeginminute * minutemilli);
            }
            if (dtbegin > 0) {
              dtbeginsecond = dtbegin / secondmilli;
              dtbegin -= (dtbeginsecond * secondmilli);
            }
            if (dtbegin > 0) {
              dtbeginmillisecond = dtbegin;
            }

            if (dtend > 0) {
              dtendday = dtend / daymilli;
              dtend -= (dtendday * daymilli);
            }
            if (dtend > 0) {
              dtendhour = dtend / hourmlli;
              dtend -= (dtendhour * hourmlli);
            }
            if (dtend > 0) {
              dtendminute = dtend / minutemilli;
              dtend -= (dtendminute * minutemilli);
            }
            if (dtend > 0) {
              dtendsecond = dtend / secondmilli;
              dtend -= (dtendsecond * secondmilli);
            }
            if (dtend > 0) {
              dtendmillisecond = dtend;
            }

            if (dtinterval > 0) {
              dtintervalday = dtinterval / daymilli;
              dtinterval -= (dtintervalday * daymilli);
            }
            if (dtinterval > 0) {
              dtintervalhour = dtinterval / hourmlli;
              dtinterval -= (dtintervalhour * hourmlli);
            }
            if (dtinterval > 0) {
              dtintervalminute = dtinterval / minutemilli;
              dtinterval -= (dtintervalminute * minutemilli);
            }
            if (dtinterval > 0) {
              dtintervalsecond = dtinterval / secondmilli;
              dtinterval -= (dtintervalsecond * secondmilli);
            }
            if (dtinterval > 0) {
              dtintervalmillisecond = dtinterval;
            }

            out.write("\n                    ");
            out.write("<!--\n            \t\t");
            out.write("<TR>\n                \t\t");
            out.write("<TD align=\"center\">\n                \t\t");
            out.write("<INPUT name=\"dtbegin_");
            out.print(String.valueOf(i));
            out.write("\" type=\"text\" value=\"");
            out.print(begin);
            out.write("\" disabled>\n                \t\t");
            out.write("</TD>\n                \t\t");
            out.write("<TD align=\"center\">");
            out.write("<INPUT name=\"dtend_");
            out.print(String.valueOf(i));
            out.write("\" type=\"text\" value=\"");
            out.print(end);
            out.write("\" disabled>");
            out.write("</TD>\n                \t\t");
            out.write("<TD align=\"center\">");
            out.write("<INPUT name=\"dtinterval_");
            out.print(String.valueOf(i));
            out.write("\" type=\"text\" value=\"");
            out.print(interval);
            out.write("\" disabled>");
            out.write("</TD>\n                \t\t");
            out.write("<TD align=\"center\">");
            out.write("<INPUT name=\"dtdel_");
            out.print(String.valueOf(i));
            out.write("\" type=\"checkbox\" value=\"true\" ");
            if (delete != null && delete.equals("true")) {
              out.write("checked");
            }
            out.write(" disabled>");
            out.write("</TD>\n                \t\t");
            out.write("<TD align=\"center\">\n                            ");
            if ((i + 2) == ds.length) {
              out.write("\n                                ");
              out.write("<a HREF=\"javascript:removeDowntime('");
              out.print(i);
              out.write("')\" title=\"Remove Downtime Model\">Remove");
              out.write("</a>\n                            ");
            } else {
              out.write("\n                               &nbsp;\n                            ");
            }
            out.write("\n                        ");
            out.write("</TD>\n            \t\t");
            out.write("</TR>\n            \t\t-->\n\n                \t\t");
            if (i < (ds.length - 1)) {
              out.write("\n                           ");
              out.write("<tr class=\"");
              out.print(((i % 2) == 0) ? "tableRowLIght" : "tableRowDark");
              out.write("\">\n                \t\t");
              out.write("<td class=\"tableText\">\n                    \t\t");
              out.print(dtbeginday);
              out.write(" days ");
              out.print(df2digit.format(dtbeginhour));
              out.write(":");
              out.print(df2digit.format(dtbeginminute));
              out.write(":");
              out.print(df2digit.format(dtbeginsecond));
              out.write(":");
              out.print(df3digit.format(dtbeginmillisecond));
              out.write("\n                        ");
              out.write("</td>\n                \t\t");
              out.write("<td class=\"tableText\">\n                   \t\t    ");
              out.print(dtendday);
              out.write(" days ");
              out.print(df2digit.format(dtendhour));
              out.write(":");
              out.print(df2digit.format(dtendminute));
              out.write(":");
              out.print(df2digit.format(dtendsecond));
              out.write(":");
              out.print(df3digit.format(dtendmillisecond));
              out.write("\n                        ");
              out.write("</td>\n                \t\t");
              out.write("<td class=\"tableText\">\n                    \t\t");
              out.print(dtintervalday);
              out.write(" days ");
              out.print(df2digit.format(dtintervalhour));
              out.write(":");
              out.print(df2digit.format(dtintervalminute));
              out.write(":");
              out.print(df2digit.format(dtintervalsecond));
              out.write(":");
              out.print(df3digit.format(dtintervalmillisecond));
              out.write("\n                        ");
              out.write("</td>\n                        ");
              out.write("<td class=\"tableText\">\n                                 ");
              if (i == (ds.length - 2)) {
                out.write("\n                                     ");
                out.write("<a href=\"javascript:removeDowntime('");
                out.print(i);
                out.write("')\" title=\"Remove Downtime Model\">Remove");
                out.write("</a>");
                out.write("</td>\n                                 ");
              }
              out.write("\n                        ");
              out.write("</td>\n                \t\t");
            } else {
              out.write("\n\t\t\t\t\t\t");
              out.write("<tr>");
              out.write("<td colspan=\"3\">&nbsp;");
              out.write("</td>");
              out.write("</tr>\n                           ");
              out.write("<tr class=\"tableHeader\">\n                \t\t");
              out.write("<td class=\"tableHeader\" colspan=\"3\">\n                            ");
              if ((delete == null || !delete.equals("true")) && end == 0 && interval > 0) {
                out.write("\n                    \t\tAfter\n                    \t\t");
                out.write("<b>\n                \t\t    ");
                if (dtbeginday > 0) {
                  out.print(dtbeginday);
                  out.write(" days");
                }
                out.write("\n                \t\t    ");
                if (dtbeginhour > 0) {
                  out.print(dtbeginhour);
                  out.write(" hr");
                }
                out.write("\n                \t\t    ");
                if (dtbeginminute > 0) {
                  out.print(dtbeginminute);
                  out.write(" min");
                }
                out.write("\n                \t\t    ");
                if (dtbeginsecond > 0) {
                  out.print(dtbeginsecond);
                  out.write(" sec");
                }
                out.write("\n                \t\t    ");
                if (dtbeginmillisecond > 0) {
                  out.print(dtbeginmillisecond);
                  out.write(" ms");
                }
                out.write("\n                    \t\t");
                out.write(
                    "</b>\n                    \t\tthe system will continue to poll downed nodes at a\n                    \t\t");
                out.write("<b>\n                \t\t    ");
                if (dtintervalday > 0) {
                  out.print(dtintervalday);
                  out.write(" day");
                }
                out.write("\n                \t\t    ");
                if (dtintervalhour > 0) {
                  out.print(dtintervalhour);
                  out.write(" hr");
                }
                out.write("\n                \t\t    ");
                if (dtintervalminute > 0) {
                  out.print(dtintervalminute);
                  out.write(" min");
                }
                out.write("\n                \t\t    ");
                if (dtintervalsecond > 0) {
                  out.print(dtintervalsecond);
                  out.write(" sec");
                }
                out.write("\n                \t\t    ");
                if (dtintervalmillisecond > 0) {
                  out.print(dtintervalmillisecond);
                  out.write(" ms");
                }
                out.write("\n                            ");
                out.write(
                    "</b>\n                            interval.\n                            ");
              }
              out.write("\n                        ");
              out.write("</td>\n                                   ");
              if (i == (ds.length - 2)) {
                out.write("\n                                   ");
              } else {
                out.write("\n                                      ");
                out.write("<td class=\"tableHeader\">&nbsp;");
                out.write("</td>\n                                   ");
              }
              out.write("\n                \t\t");
            }
            out.write("\n            \t\t");
            out.write("</tr>\n            \t\t");
          }
        }
      }

      out.write("\n        ");
      out.write("<!--\n    \t");
      out.write("<TR>\n        \t");
      out.write("<TD align=\"center\">");
      out.write("<INPUT name=\"dtbegin\" type=\"text\" value=\"");
      out.print(begin);
      out.write("\" readonly>");
      out.write("</TD>\n        \t");
      out.write("<TD align=\"center\">");
      out.write("<INPUT name=\"dtend\" type=\"text\" value=\"\">");
      out.write("</TD>\n        \t");
      out.write("<TD align=\"center\">");
      out.write("<INPUT name=\"dtinterval\" type=\"text\" value=\"\">");
      out.write("</TD>\n        \t");
      out.write("<TD align=\"center\">");
      out.write("<INPUT name=\"dtdel\" type=\"checkbox\" value=\"true\" disabled>");
      out.write("</TD>\n        \t");
      out.write("<TD align=\"center\">");
      out.write("<a HREF=\"javascript:addDowntime()\" title=\"Add Downtime Model\">Add Downtime");
      out.write("</a>");
      out.write("</TD>\n    \t");
      out.write("</TR>\n    \t-->\n    \t");

      long dtbeginday = 0;
      long dtbeginhour = 0;
      long dtbeginminute = 0;
      long dtbeginsecond = 0;
      long dtbeginmillisecond = 0;

      long dtendday = 0;
      long dtendhour = 0;
      long dtendminute = 0;
      long dtendsecond = 0;
      long dtendmillisecond = 0;

      long dtintervalday = 0;
      long dtintervalhour = 0;
      long dtintervalminute = 0;
      long dtintervalsecond = 0;
      long dtintervalmillisecond = 0;

      if (addbegin > 0) {
        dtbeginday = addbegin / daymilli;
        addbegin = addbegin - (dtbeginday * daymilli);
      }
      if (addbegin > 0) {
        dtbeginhour = addbegin / hourmlli;
        addbegin = addbegin - (dtbeginhour * hourmlli);
      }
      if (addbegin > 0) {
        dtbeginminute = addbegin / minutemilli;
        addbegin = addbegin - (dtbeginminute * minutemilli);
      }
      if (addbegin > 0) {
        dtbeginsecond = addbegin / secondmilli;
        addbegin = addbegin - (dtbeginsecond * secondmilli);
      }
      if (addbegin > 0) {
        dtbeginmillisecond = addbegin;
      }

      out.write("\n    \t");
      out.write("<tr class=\"tableRowLight\">\n        \t");
      out.write("<td>\n        \t  ");
      out.write("<input type=\"hidden\" name=\"dtbeginday\" value=\"");
      out.print(dtbeginday);
      out.write("\">\n        \t  ");
      out.write("<input type=\"hidden\" name=\"dtbeginhour\" value=\"");
      out.print(dtbeginhour);
      out.write("\">\n        \t  ");
      out.write("<input type=\"hidden\" name=\"dtbeginminute\" value=\"");
      out.print(dtbeginminute);
      out.write("\">\n        \t  ");
      out.write("<input type=\"hidden\" name=\"dtbeginsecond\" value=\"");
      out.print(dtbeginsecond);
      out.write("\">\n        \t  ");
      out.write("<input type=\"hidden\" name=\"dtbeginmillisecond\" value=\"");
      out.print(dtbeginmillisecond);
      out.write("\">\n        \t    ");
      out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Days: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.print(dtbeginday);
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Hours: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.print(dtbeginhour);
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Minutes: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.print(dtbeginminute);
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Seconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.print(dtbeginsecond);
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Milliseconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.print(dtbeginmillisecond);
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t    ");
      out.write("</table>\n        \t");
      out.write("</td>\n        \t");
      out.write("<td>\n        \t    ");
      out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Days: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtendday\">\n\t\t        ");
      for (int i = 0; i <= 365; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtendday == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Hours: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtendhour\">\n\t\t        ");
      for (int i = 0; i < 24; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtendhour == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Minutes: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtendminute\">\n\t\t        ");
      for (int i = 0; i < 60; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtendminute == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Seconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtendsecond\">\n\t\t        ");
      for (int i = 0; i < 60; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtendsecond == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Milliseconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtendmillisecond\">\n\t\t        ");
      for (int i = 0; i < 1000; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtendmillisecond == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t    ");
      out.write("</table>\n\n         \t");
      out.write("</td>\n        \t");
      out.write("<td>\n        \t    ");
      out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Days: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtintervalday\">\n\t\t        ");
      for (int i = 0; i <= 365; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtintervalday == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Hours: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtintervalhour\">\n\t\t        ");
      for (int i = 0; i < 24; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtintervalhour == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Minutes: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtintervalminute\">\n\t\t        ");
      for (int i = 0; i < 60; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtintervalminute == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Seconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtintervalsecond\">\n\t\t        ");
      for (int i = 0; i < 60; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtintervalsecond == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t        ");
      out.write("<tr class=\"tableRowLight\">\n        \t            ");
      out.write("<td nowrap>Milliseconds: ");
      out.write("</td>\n        \t            ");
      out.write("<td nowrap>");
      out.write("<select name=\"dtintervalmillisecond\">\n\t\t        ");
      for (int i = 0; i < 1000; i++) {
        out.write("\n\t\t            ");
        out.write("<option value=");
        out.print(i);
        out.write(" ");
        if (dtintervalmillisecond == i) {
          out.write("selected");
        }
        out.write(">");
        out.print(df3digit.format(i));
        out.write("\n                ");
      }
      out.write("\n\t\t      ");
      out.write("</select>");
      out.write("</td>\n        \t        ");
      out.write("</tr>\n        \t    ");
      out.write("</table>\n        \t");
      out.write("</td>\n         \t");
      out.write("<!--\n        \t");
      out.write("<TD align=\"center\">\n        \t");
      out.write("<INPUT name=\"dtdel\" type=\"checkbox\" value=\"true\" disabled>\n        \t");
      out.write("</TD>\n        \t-->\n        \t");
      out.write("<td align=\"center\" nowrap>");
      out.write("<a href=\"javascript:addDowntime()\" title=\"Add Downtime Model\">Add Downtime");
      out.write("</a>");
      out.write("</td>\n    ");
      out.write("</tr>\n    ");
      out.write("<tr class=\"tableRowLight\">\n        ");
      out.write("<td class=\"tableText\" colspan=\"4\">");
      out.write(
          "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">");
      out.write("</td>\n    ");
      out.write("</tr>\n     ");
      out.write("<tr>\n        ");
      out.write("<td colspan=\"4\">");
      out.write("<br />\n        ");
      out.write("<a href=\"javascript:restoreDefaultDowntime()\">");
      out.write(
          "<img src=\"/wt-portal/images/buttons/btn_restore_defaults.gif\" border=\"0\" alt=\"Restore Defaults\">");
      out.write("</a>\n        \n        ");
      out.write("<!--");
      out.write(
          "<input type=\"submit\" name=\"button\" onclick=\"return restoreDefaultDowntime()\" value=\"Restore Defaults\" title=\"Restore Downtime Model Defaults\">-->");
      out.write("<br />\n        ");
      out.write("</td>\n    ");
      out.write("</tr>\n");
      out.write("</table>\n");
      out.write("</form>\n");
      out.write("<!-- BEGIN FRAMING TABLE:close tags-->\n\t\t");
      out.write("</td>\n\t");
      out.write("</tr>\n");
      out.write("</table>\n");
      out.write("<!-- END FRAMING TABLE:close tags-->\n");
      out.write("<p>\n");
      JspRuntimeLibrary.include(
          request, response, "/includes/footer.jsp" + "?" + "location=" + "admin", out, false);
      out.write("\n\n  ");
      out.write("</body>\n");
      out.write("</html>\n");
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0) out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
Beispiel #4
0
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html; charset=utf-8");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      // エンコーディング
      response.setContentType("text/html; charset=utf-8");
      request.setCharacterEncoding("utf-8");
      DecimalFormat exFormat = new DecimalFormat("#,###,###,##0");

      Bean bean = new Bean();
      String searchitem = null;
      String searchcategory = null;

      if ((request.getAttribute("searchitem")) != null) {
        bean = (Bean) request.getAttribute("searchitem");
        searchitem = bean.getSearchitem();
      }

      if ((request.getAttribute("searchcategory")) != null) {
        bean = (Bean) request.getAttribute("searchcategory");
        searchcategory = bean.getSearchcategory();
      }

      out.write("\r\n");
      out.write("\r\n");

      if (session.getAttribute("login") == null) {
        response.sendRedirect("/toranoan/logout.jsp");
      }

      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("\t<title>出前出張サービス◆虎乃庵◆</title>\r\n");
      out.write(
          "\t<script type=\"text/javascript\" src=\"/toranoan/jquery-1.11.1.js\"></script>\r\n");
      out.write(
          "\t<script type=\"text/javascript\" src=\"/toranoan/jquery.validate.min.js\"></script>\r\n");
      out.write(
          "\t<script type=\"text/javascript\" src=\"/toranoan/controlledjquery.js\"></script>\r\n");
      out.write("<!-- <script src=\"http://code.jquery.com/jquery-1.11.1.min.js\"></script>\r\n");
      out.write(
          "\t <script src=\"http://jqueryvalidation.org/files/dist/jquery.validate.min.js\"></script> -->\r\n");
      out.write("<!-- <script type=\"text/javascript\">\r\n");
      out.write("\t\t$( \"#btn_sub\" ).validate({\r\n");
      out.write("\t\t  rules: {\r\n");
      out.write("\t\t    number: {\r\n");
      out.write("\t\t      // required: true,\r\n");
      out.write("\t\t      number: true\r\n");
      out.write("\t\t    }\r\n");
      out.write("\t\t  }\r\n");
      out.write("\t\t});\r\n");
      out.write("\t</script> -->\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write(
          "<form action=\"logout\" method=\"POST\" name=\"logout\" id=\"submitform_logout\">\r\n");
      out.write("\t<input type=\"button\" value=\"ログアウト\" id=\"btn_logout\">\r\n");
      out.write("</form>\r\n");
      out.write("<h1>虎乃庵</h1>\r\n");
      out.write(
          "<form action=\"search\" method=\"GET\" name=\"search\"  id=\"submitform_search\">\r\n");
      out.write("\t<table>\r\n");
      out.write("\t\t<tr>\r\n");
      out.write("\t\t\t<td>お品書き</td>\r\n");
      out.write("\t\t\t<td><input type=\"text\" name=\"searchitem\" size=\"40\"></td>\r\n");
      out.write("\t\t</tr>\r\n");
      out.write("\t\t<tr>\r\n");
      out.write("\t\t\t<td>カテゴリ</td>\r\n");
      out.write("\t\t\t<td>\r\n");
      out.write("\t\t\t<input type=\"radio\" name=\"searchcategory\" value=\"そば\">そば\r\n");
      out.write("\t\t\t<input type=\"radio\" name=\"searchcategory\" value=\"うどん\">うどん\r\n");
      out.write("\t\t\t<input type=\"radio\" name=\"searchcategory\" value=\"飲み物\">飲み物\r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("\t\t</tr>\r\n");
      out.write("\t</table>\r\n");
      out.write("\t<br>\r\n");
      out.write("\t<input type=\"button\" value=\"検索\" id=\"btn_search\">\r\n");
      out.write("</form>\r\n");
      out.write("<div id=\"loading\"></div>\r\n");
      out.write("<div id=\"result\"></div>\r\n");
      out.write("\r\n");
      out.write("<!-- ");

      if (searchitem == null && searchcategory == null) {
        searchitem = "指定なし";
        searchcategory = "指定なし";
      } else {
        if ("".equals(searchitem)) {
          if (searchcategory == null) {
            searchitem = "指定なし";
            searchcategory = "指定なし";
          } else {
            searchitem = "指定なし";
          }
        } else {
          if (searchcategory == null) {
            searchcategory = "指定なし";
          } else {
          }
        }

        out.write("\r\n");
        out.write("<br>\r\n");
        out.write("<h2>検索結果</h2>\r\n");
        out.write("----------------------------------------\r\n");
        out.write("<table>\r\n");
        out.write("\t<tr>\r\n");
        out.write("\t\t<td align=\"center\">");
        out.print("検索ワード: ");
        out.write("</td>\r\n");
        out.write("\t\t<td>");
        out.print(searchitem);
        out.write("</td>\r\n");
        out.write("\t</tr>\r\n");
        out.write("\t<tr>\r\n");
        out.write("\t\t<td align=\"center\">");
        out.print("カテゴリ: ");
        out.write("</td>\r\n");
        out.write("\t\t<td>");
        out.print(searchcategory);
        out.write("</td>\r\n");
        out.write("\t</tr>\r\n");
        out.write("</table>\r\n");
        out.write("----------------------------------------\r\n");
        out.write("<br>\r\n");
        out.write(
            "<form action=\"order\" method=\"POST\" name=\"order\" id=\"submitform_order\">\r\n");
        out.write(
            "\t<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" bordercolor=\"#333333\">\r\n");
        out.write("\t\t<tr bgcolor=\"#EE0000\">\r\n");
        out.write("\t\t\t<th><font color=\"#FFFFFF\">メニュー</font></th>\r\n");
        out.write("\t\t\t<th><font color=\"#FFFFFF\">値段</font></th>\r\n");
        out.write("\t\t\t<th><font color=\"#FFFFFF\">カテゴリー</font></th>\r\n");
        out.write("\t\t\t<th><font color=\"#FFFFFF\">温・冷</font></th>\r\n");
        out.write("\t\t\t<th><font color=\"#FFFFFF\">数量</font></th>\r\n");
        out.write("\t\t</tr>\r\n");

        List resultlist = (List) session.getAttribute("itemresult");
        for (int i = 0; i < resultlist.size(); i++) {

          out.write("\r\n");
          out.write("\t\t<tr>\r\n");

          Bean s = (Bean) resultlist.get(i);
          out.println(
              "<td>"
                  + s.getItem()
                  + "</td> <td align=\"right\">\\"
                  + exFormat.format(s.getPrice())
                  + "</td> <td align=\"center\">"
                  + s.getCategory()
                  + "</td> <td align=\"center\">"
                  + s.getHotcold()
                  + "</td><td><input type=\"number\" min=\"0\" name=\""
                  + s.getId()
                  + "_"
                  + s.getItem()
                  + "_"
                  + s.getPrice()
                  + "\"></td>");
        }

        out.write("\r\n");
        out.write("\t\t</tr>\r\n");
        out.write("\t</table>\r\n");
        out.write("\t<input type=\"button\" value=\"注文\" id=\"btn_order\">\r\n");
        out.write("</form>\r\n");
        out.write("<form action=\"./order.jsp\" method=\"GET\" id=\"submitform_check\">\r\n");
        out.write("\t\t<input type=\"button\" value=\"確認画面へ\" id=\"btn_check\">\r\n");
        out.write("</form>\r\n");
      }

      out.write(" -->\r\n");
      out.write("</body>\r\n");
      out.write("</html>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
 private NumberFormat getFormat() {
   NumberFormat f = DecimalFormat.getNumberInstance(Locales.getCurrent());
   f.setMinimumFractionDigits(2);
   f.setMaximumFractionDigits(2);
   return f;
 }