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");
      out.write("\n\n");

      // Get the current user's ac
      WTAccountCredentials ac = WTAccountCredentials.current();
      SecureInfoManagerImpl sim = new SecureInfoManagerImpl();

      // Setup for permission checking
      boolean editInterfaces = false;
      if (sim.canEditEntity(ProtectedResourceConstants.PR_INTERFACES, ac)) editInterfaces = true;
      pageContext.setAttribute("editInterfaces", new Boolean(editInterfaces));

      out.write("  \n");

      String hostIP = null;
      try {
        hostIP = InetAddress.getLocalHost().getHostAddress();
        //    out.print(hostIP);

      } catch (UnknownHostException ex) {
        throw new Exception("Could not determine the local host address", ex);
      }

      out.write("\n\nvar javaScriptVar=\"");
      out.print(hostIP);
      out.write("\";\nvar javaScriptVar2=\"");
      out.print(editInterfaces);
      out.write("\";\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);
    }
  }
  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/xml;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");
      out.write("\n");

      HttpSession user = request.getSession(true);
      Notification newNotice = (Notification) user.getAttribute("newNotice");
      List exclude = new ArrayList();
      exclude.add(NotificationWizardServlet.WT_VENDOR_NAME); // Exclude WebTelemetry

      out.print(buildTree(newNotice, exclude));
      out.write("\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);
    }
  }
  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("\r\n\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

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

      GenericConditionChip theChip =
          (GenericConditionChip) request.getAttribute(AbstractChip.CHIP_KEY);

      out.write("\r\n<td class=\"attribute\">\r\n\t<div class=\"attribute\">");
      out.print(theChip.getName());
      out.write(
          "</div>\r\n</td>\r\n<td class=\"locale\">\r\n\t<div class=\"locale\">&nbsp;</div>\r\n</td>\r\n<td class=\"comparator\">\r\n\t<div class=\"comparator\">");
      theChip.getOperatorEditor().render(pageContext);
      out.write("</div>\r\n</td>\r\n<td class=\"condition\">\r\n\t<div class=\"condition\">\r\n");

      if (theChip.getValueEditor() != null) {
        theChip.getValueEditor().render(pageContext);
      } else {

        out.write("\r\n\t\t\t&nbsp;\r\n");
      }

      out.write("\r\n\t</div>\r\n</td>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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, 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\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

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

      final AbstractAutocompleterToolbarActionChip theChip =
          (AbstractAutocompleterToolbarActionChip) request.getAttribute(AbstractChip.CHIP_KEY);

      final String label = (theChip.getLabel() == null ? "" : localized(theChip.getLabel()));
      final String tooltip =
          (theChip.getTooltip() == null ? label : localized(theChip.getTooltip()));
      final String width =
          theChip.getWidth() != null && theChip.getWidth().length() > 0
              ? theChip.getWidth()
              : "200px";
      final String value = theChip.getValue() != null ? "value=\"" + theChip.getValue() + "\"" : "";

      final String contextMenu =
          theChip.hasVisibleContextMenuEntries()
              ? "(new Menu("
                  + theChip.createMenuEntriesForJS(theChip.getMenuEntries())
                  + ", event, null, null, { uniqueName: '"
                  + theChip.getUniqueName()
                  + "'} )).show(); return false;"
              : "return false;";

      out.write("\r\n\r\n<td title=\"");
      out.print(tooltip);
      out.write("\" class=\"toolbar-autocomplete\" oncontextmenu=\"");
      out.print(contextMenu);
      out.write(
          "\">\r\n\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td class=\"label\">");
      out.print(label);
      out.write(":</td>\r\n\t\t\t<td><input type=\"text\" \r\n\t\t\t\t\t\t id=\"");
      out.print(theChip.getInputID());
      out.write("\" \r\n\t\t\t\t\t\t style=\"width:");
      out.print(width);
      out.write(";\"\r\n\t\t\t\t\t\t name=\"");
      out.print(theChip.getEventID(AbstractAutocompleterToolbarActionChip.VALUE));
      out.write("\" \r\n\t\t\t\t\t\t ");
      out.print(value);
      out.write("/><div id=\"");
      out.print(theChip.getMatchesID());
      out.write("\" class=\"autocomplete\"></div></td>\r\n\t\t</tr>\r\n\t</table>\r\n</td>\r\n");

      final String options =
          "{ paramName: '"
              + AbstractAutocompleterToolbarActionChip.SEARCH
              + "',"
              + "afterUpdateElement: function(inputElement, selectedListItem) "
              + "{ if( selectedListItem.nodeName == \"LI\" )"
              + "{ setEvent('"
              + theChip.getCommandID(AbstractAutocompleterToolbarActionChip.SELECT)
              + "', domQuery('span.hidden', selectedListItem)[0].firstChild.nodeValue);setScrollAndSubmit(); }"
              + "else "
              + "{	inputElement.value = \"\"; }},"
              + "onShow:       function(element, update)"
              + "{ if(!update.style.position || update.style.position=='absolute')"
              + "{	update.style.position = 'absolute'; Position.clone(element, update, { setHeight: false, setWidth:false, offsetTop: element.offsetHeight }); }"
              + "Effect.Appear(update,{duration:0.15}); } }";
      final String tenantIDStr =
          Registry.getCurrentTenant() instanceof SlaveTenant
              ? ";tenantID=" + Registry.getCurrentTenant().getTenantID()
              : "";

      out.write("\r\n<script language=\"JavaScript1.2\">\r\n\t\r\n\tnew Ajax.Autocompleter(\"");
      out.print(theChip.getInputID());
      out.write("\", \"");
      out.print(theChip.getMatchesID());
      out.write("\", \"prototype");
      out.print(tenantIDStr);
      out.write('?');
      out.print(PrototypeServlet.CHIPID);
      out.write('=');
      out.print(theChip.getID());
      out.write('"');
      out.write(',');
      out.write(' ');
      out.print(options);
      out.write(");\r\n\r\n</script>\r\n\t\t\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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);
    }
  }
Exemplo n.º 5
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");
      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);
    }
  }
Exemplo n.º 6
0
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final java.lang.String _jspx_method = request.getMethod();
    if (!"GET".equals(_jspx_method)
        && !"POST".equals(_jspx_method)
        && !"HEAD".equals(_jspx_method)
        && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      response.sendError(
          HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
      return;
    }

    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("<html>\n");
      out.write("\t<head>\n");
      out.write("\t\t\n");
      out.write("\t\t\n");
      out.write("\t\t<link rel=\"stylesheet\" href=\"bootstrap/dist/css/bootstrap.css\">\n");
      out.write("\t</head>\n");
      out.write("\t<body>\n");
      out.write("\t\t<div id=\"wrapper\">\n");
      out.write("\t\t\t<nav class=\"navbar navbar-default\">\n");
      out.write("\t\t\t  <div class=\"container-fluid\">\n");
      out.write("\t\t\t    <!-- Brand and toggle get grouped for better mobile display -->\n");
      out.write("\t\t\t    <div class=\"navbar-header\">\n");
      out.write(
          "\t\t\t    \t<a href=\"servlet/Deco\" type=\"submit\" value=\"Deconnexion\"> Se déconnecter </a>\n");
      out.write("    \t\t\t</div>\n");
      out.write("    \t\t</div>\n");
      out.write("\n");
      out.write("\t\t\t<h1> Bonjour ");
      out.print(session.getAttribute("login"));
      out.write(" ! </h1></div>\n");
      out.write("\t\t\t\n");
      out.write("\t\t\t\t<ul>\n");
      out.write("\t\t\t\t");

      String shortPath = request.getContextPath() + "/users/" + session.getAttribute("login");
      String longPath =
          request.getServletContext().getRealPath("/") + "/users/" + session.getAttribute("login");
      String[] files = new File(longPath).list();

      for (String s : files) {
        out.write("\n");
        out.write("\t\t\t\t\t\t<li> <a download=\"");
        out.print(s);
        out.write("\" href=\"");
        out.print(shortPath);
        out.write('/');
        out.print(s);
        out.write('"');
        out.write('>');
        out.write(' ');
        out.print(s);
        out.write(" </a> </li>\n");
        out.write("\t\t\t\t");
      }
      out.write("\n");
      out.write("\t\t\t\t</ul>\n");
      out.write("\n");
      out.write("\t\t\t<div class=\"col-md-4 col-md-offset-4\">\n");
      out.write(
          "\t\t\t\t<form method=\"POST\" action=\"servlet/Upload\" enctype=\"multipart/form-data\"  >\n");
      out.write(
          "\t\t            <div class=\"form-group\"><label>File Input <input type=\"file\" name=\"file\" id=\"file\" /></div>\n");
      out.write(
          "\t\t            <input type=\"submit\" value=\"Upload\" name=\"upload\" class=\"btn btn-primary btn-lg btn-block\">\n");
      out.write("\t\t        </form>\n");
      out.write("\t   \t\t</div>\n");
      out.write("\t\t</div>\n");
      out.write("\t</body>\n");
      out.write("</head>\n");
      out.write("\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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\n");

      // This JSP handles cross context communications from wt-monitor
      // to wt-core for use in accessing wt-core functionality that is
      // needed in WTnav-tree.jsp.

      // Assign a pooled DB connection handle
      Context ctx = new InitialContext();
      DataSource ds = (DataSource) ctx.lookup(WTConstants.WATCHTOWERDB_CONN);
      int iIndex = 6100;
      GraphViewManager graphman = new GraphViewManager(ds);
      // Vector views = graphman.getViews();

      Vector views = new Vector();
      WTOrganization[] orgs = null;

      WTAccountCredentials ac =
          (WTAccountCredentials)
              request.getSession().getAttribute(WTAccountCredentials.SESSION_ATTRIBUTE_AC);
      if (ac != null) {
        // WTOrganization[] orgs = null;
        int selectedOrg = ac.getCurrentManagedId();

        boolean siteUser = ac.getIsSiteUser();
        int userId = ac.getUserId();

        // Get list of organizations for the current user
        if (siteUser) {
          try {
            orgs = DAOImpl.OrgDAO.getWTOrganization();
          } catch (Exception e) {
            e.printStackTrace();
          }
        } else {
          if (!(userId < 0)) {
            try {
              orgs = DAOImpl.OrgDAO.getWTOrganizationsByUser(userId);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        }

        // Get the list of actively managed nodes
        if (selectedOrg == WTAccountCredentials.ALL_ORGS) {
          if (siteUser) {
            views = graphman.getViews();
          } else {
            if (orgs != null) {
              int[] orgsIds = new int[orgs.length];
              for (int i = 0; i < orgs.length; i++) {
                orgsIds[i] = orgs[i].getID();
              }
              views = graphman.getViews(orgsIds);
            }
          }
        } else {
          views = graphman.getViews(selectedOrg);
        }
      }

      // My Graph Views is an experimental feature and is commented out until all kinks are worked
      // out. LS

      String strOutput = null;
      // 	if( views.size()==0 ) {
      //		strOutput = "nav.add(6100, 6000, 'My Graph Views', '/wt-monitor/report/index.jsp', 'My
      // Customized Graph Views', 'mainContentsFrame', icon16_basedir + 'bs_chart.gif',
      // icon16_basedir + 'bs_chart.gif', '');\r\n";
      //	} else {
      //		strOutput = "nav.add(6100, 6000, 'My Graph Views', '', 'My Customized Graph Views',
      // 'mainContentsFrame', icon16_basedir + 'bs_chart.gif', icon16_basedir + 'bs_chart.gif',
      // '');\r\n";
      //	}
      //	for (int i=0; i<views.size(); i++)
      //	{
      //		iIndex++;
      //		String strViewName = ((GraphViewJB)views.elementAt(i)).getName();
      //		int strOrgId = ((GraphViewJB)views.elementAt(i)).getOrgId();
      //		String orgName = null;
      //       for(int j=0;j<orgs.length;j++){
      //	        if(orgs[j].getID() != -1 && orgs[j].getID() == strOrgId){
      //	        	orgName = orgs[j].getName();
      //	        }
      //		}
      //
      //		strOutput +="nav.add(" + iIndex +
      //		            ", 6100, '" + strViewName +
      //		            "', 'javascript:
      // PopupCenteredWindow(\\'/wt-core/jsp/sysmon/graphview/GraphView.jsp?view=" + strViewName +
      // "&orgname="+orgName +"&start=01&end=02" + "\\', \\'graphview\\', \\'yes\\', \\'yes\\',
      // \\'yes\\', \\'900\\', \\'1010\\'); location.href=\\'/wt-monitor/wt-jsp/WTnav-tree.jsp\\';',
      // 'Open " + strViewName + " Graph View', '', icon16_basedir + 'bs_chart.gif', icon16_basedir
      // + 'bs_chart.gif', '');\r\n";
      // }

      out.write("\n\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n\n");
      out.print(strOutput);
      out.write("\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);
    }
  }
  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("\r\n\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

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

      final IconChip theChip = (IconChip) request.getAttribute(AbstractChip.CHIP_KEY);
      final boolean explorable = theChip.isExplorable();
      final String iconURI = explorable ? theChip.getIconURI() : theChip.getNonExplorableIconURI();
      final String iconLabel = theChip.getIconTitle();
      final String iconTooltip = theChip.getIconTooltip();
      final String altTxt =
          iconTooltip != null ? " alt=\"" + iconTooltip.replace("\"", "''") + "\" " : "";
      final String toolTipTxt =
          iconTooltip != null ? " title=\"" + iconTooltip.replace("\"", "''") + "\" " : "";

      final int[] box = theChip.getBoxSize();
      final int boxWidth = box != null && box[0] > 0 ? box[0] : -1;
      final boolean useWidth = boxWidth > 0;
      final int boxHeight = box != null && box[1] > 0 ? box[1] : -1;
      final boolean useHeight = boxHeight > 0;

      final List menuEntries = theChip.getMenuEntries();
      final String contextMenu =
          theChip.hasVisibleContextMenuEntries()
              ? "(new Menu("
                  + theChip.createMenuEntriesForJS(menuEntries)
                  + ", event, null, null, { uniqueName: '"
                  + theChip.getUniqueName()
                  + "'} )).show(); return false;"
              : "return false;";

      final String widthStyle = useWidth ? "width:" + boxWidth + "px;" : "";
      final String heightStyle = useHeight ? "height:" + (boxHeight / 2) + "px;" : "";

      out.write("\r\n<table id=\"box_");
      out.print(theChip.getID());
      out.write(
          "\"\r\n\t\t cellpadding=\"0\"\r\n\t\t cellspacing=\"0\"\r\n\t\t border=\"0\"\r\n\t\t ");
      out.print(toolTipTxt);
      out.write("\r\n\t\t oncontextmenu=\"");
      out.print(contextMenu);
      out.write("\"\r\n\t\t class=\"iconChip\"\r\n  \t\t onMouseover=\"");
      out.print(explorable ? "this.style.backgroundColor = '#ffffff'; return true;" : "");
      out.write("\"\r\n  \t\t onMouseout=\"");
      out.print(explorable ? "this.style.backgroundColor = '#f2f2f5'; return true;" : "");
      out.write("\"\r\n  \t\t >\r\n\t<tr>\r\n\t\t<td>\r\n\t\t\t<div style=\"");
      out.print(heightStyle);
      out.write(' ');
      out.print(widthStyle);
      out.write(
          "\">\r\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\r\n");
      if (explorable) {

        out.write(
            "\r\n\t\t\t\t\t\t\t\t<a href=\"#\" hidefocus=\"true\"\r\n\t\t\t\t\t\t\t\t\tonFocus=\"document.getElementById('box_");
        out.print(theChip.getID());
        out.write(
            "').style.backgroundColor = '#ffffff'; return true;\"\r\n\t\t\t\t\t\t\t\t\tonblur=\"document.getElementById('box_");
        out.print(theChip.getID());
        out.write(
            "').style.backgroundColor = '#f2f2f5'; return true;\"\r\n\t\t\t\t\t\t\t\t\tonclick=\"setEvent('");
        out.print(theChip.getCommandID(IconChip.CLICK));
        out.write(
            "', 'true' ); setScrollAndSubmit();return false;\"\r\n\t\t\t\t\t\t\t\t\tonmouseover=\"window.status='open'; return true;\" \r\n\t\t\t\t\t\t\t\t\tonMouseOut=\"window.status=''; return true;\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<img src=\"");
        out.print(iconURI);
        out.write("\" \r\n\t\t\t\t\t\t\t\t\t\t  ");
        out.print(altTxt);
        out.write(" \r\n\t\t\t\t\t\t\t\t\t\t  ");
        out.print(heightStyle);
        out.write("\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t<!--<img src=\"");
        out.print(iconURI);
        out.write('"');
        out.write(' ');
        out.print(altTxt);
        out.write(" />-->\r\n\t\t\t\t\t\t\t\t</a>\r\n");
      } else {

        out.write("\r\n\t\t\t\t\t\t\t\t<img src=\"");
        out.print(iconURI);
        out.write("\" \r\n\t\t\t\t\t\t\t\t\t  ");
        out.print(altTxt);
        out.write(" \r\n\t\t\t\t\t\t\t\t\t  ");
        out.print(heightStyle);
        out.write("\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t<!--<img src=\"");
        out.print(iconURI);
        out.write('"');
        out.write(' ');
        out.print(altTxt);
        out.write(" />-->\r\n");
      }

      out.write(
          "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class=\"smallText\" style=\"");
      out.print(heightStyle);
      out.print(widthStyle);
      out.write("\">\r\n\t\t\t<small>");
      out.print(iconLabel);
      out.write("</small>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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,
              "ReportErrorPage.jsp?page=EditTargetReportForm.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");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request, response, "header.jsp", out, false);
      out.write(' ');
      out.write('\n');
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\t<!-- files for JqxWidget grid  -->\n");
      out.write(
          "    <link rel=\"stylesheet\" href=\"js/jqwidgets/styles/jqx.base.css\" type=\"text/css\" />\n");
      out.write(
          "    <link rel=\"stylesheet\" href=\"js/jqwidgets/styles/jqx.darkblue.css\" type=\"text/css\" />\n");
      out.write(
          "\t<link rel=\"stylesheet\" href=\"js/jqwidgets/styles/jqx.ui-redmond.css\" type=\"text/css\" />\n");
      out.write("\t\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/gettheme.js\"></script>\n");
      out.write("\t<script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n");
      out.write("    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxcore.js\"></script>\n");
      out.write("    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxdata.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxbuttons.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxscrollbar.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxlistbox.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxcalendar.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxdatetimeinput.js\"></script>\n");
      out.write("    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.filter.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.selection.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.sort.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.pager.js\"></script>\n");
      out.write(
          "     <script type=\"text/javascript\" src=\"js/jqwidgets/jqxmenu.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxlistbox.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxdropdownlist.js\"></script>\n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxdata.export.js\"></script> \n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.export.js\"></script> \n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.aggregates.js\"></script>  \n");
      out.write(
          "    <script type=\"text/javascript\" src=\"js/jqwidgets/jqxgrid.grouping.js\"></script> \n");
      out.write("\n");
      out.write("\n");
      out.write("\t\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("\n");
      out.write("\n");
      out.write("<script src=\"js/editCustomer_details.js\"> </script> \n");
      out.write("\n");
      out.write("<script type=\"text/javascript\" src=\"js/popup.js\"></script>\n");
      out.write("<style>\n");
      out.write("hr {\n");
      out.write("color: #f00;\n");
      out.write("background-color: #f00;\n");
      out.write("height: 3px;\n");
      out.write("}\n");
      out.write("#selected_order{\n");
      out.write("width: 40%;\n");
      out.write("max-height: 300px;\n");
      out.write("border: 1px solid black; \n");
      out.write("background-color: #ECFB99;\n");
      out.write("float: right;\n");
      out.write("margin-top: 30px;\n");
      out.write("overflow: auto;\n");
      out.write("margin-right: 2%;\n");
      out.write("padding: 5px;\n");
      out.write("}\n");
      out.write("</style>\n");
      out.write("<script>\n");
      out.write("\t\n");
      out.write("\tfunction checkField(){\n");
      out.write("\t\tif(document.myform.chckall.checked==true){\n");
      out.write("\t\t\tshowHint();\n");
      out.write("\t\t}\n");
      out.write("\t\telse{\t\tvar c_date1,c_date2,u_date2,u_date1;\n");
      out.write("\t\t\t\tif(!($(\"#createDate2\").jqxDateTimeInput('disabled'))){\n");
      out.write("\t\t\t\tc_date1 = $('#createDate1').jqxDateTimeInput('getText');\n");
      out.write("\t\t\t\tc_date2 = $('#createDate2').jqxDateTimeInput('getText');\n");
      out.write("\t\t\t}\n");
      out.write("\t\t\t\n");
      out.write("\t\t\tif(!($(\"#updateDate2\").jqxDateTimeInput('disabled'))){\n");
      out.write("\t\t\t\tu_date1 = $('#updateDate1').jqxDateTimeInput('getText');\n");
      out.write("\t\t\t\tu_date2 = $('#updateDate2').jqxDateTimeInput('getText');\n");
      out.write("\t\t\t}\t    \n");
      out.write("\t\t    showHint();\t\t  \n");
      out.write("\t    }\n");
      out.write("\t}\n");
      out.write("\tfunction showMsg(){\n");
      out.write("\t  \t document.myform.action=\"HomeForm.jsp\";\n");
      out.write("\t   \t document.myform.submit();\n");
      out.write("\t}\n");
      out.write("\tfunction Clear(){\n");
      out.write("\t\t\n");
      out.write("\t\ttry{\n");
      out.write("\t\t\tdocument.getElementById(\"order_number\").focus();\n");
      out.write("\t\t} catch (exp){}\n");
      out.write("\t\t\n");
      out.write("\t\t\n");
      out.write("\t\t\n");
      out.write("\t\tdocument.myform.custCode.value=\"\";\n");
      out.write("\t\tdocument.myform.phonenumber.value=\"\";\n");
      out.write("\t\tdocument.myform.custName.value=\"\";\n");
      out.write("\t\tdocument.myform.nameString.value=\"\";\t\t\n");
      out.write("\t\tdocument.myform.Building.value=\"\";\n");
      out.write("\t\tdocument.myform.Building_no.value=\"\";\n");
      out.write("\t\tdocument.myform.wing.value=\"\";\n");
      out.write("\t\tdocument.myform.block.value=\"\";\n");
      out.write("\t\tdocument.myform.add1.value=\"\";\n");
      out.write("\t\tdocument.myform.add2.value=\"\";\n");
      out.write("\t\tdocument.myform.area.value=\"\";\n");
      out.write("\t\tdocument.myform.station.value=\"\";\n");
      out.write("\t\t\n");
      out.write("\t\tdocument.myform.selmonth.value=\"\";\n");
      out.write("\t\t\n");
      out.write(
          "\t\t$(\"#createDate1\").jqxDateTimeInput({theme:'ui-redmond',width: '250px', height: '25px',max:new Date(),formatString: \"yyyy-MM-dd\"});\n");
      out.write(
          "\t\t$(\"#createDate2\").jqxDateTimeInput({theme:'ui-redmond',width: '250px', height: '25px',min:new Date(),max:new Date(),formatString: \"yyyy-MM-dd\",value:new Date()});\n");
      out.write("\t\t$(\"#createDate2\").jqxDateTimeInput({disabled: true});\n");
      out.write("\t\t\n");
      out.write("\t\t\n");
      out.write(
          "\t\t$(\"#updateDate1\").jqxDateTimeInput({theme:'ui-redmond',width: '250px', height: '25px',max:new Date(),formatString: \"yyyy-MM-dd\"});\n");
      out.write(
          "\t\t$(\"#updateDate2\").jqxDateTimeInput({theme:'ui-redmond',width: '250px', height: '25px',min:new Date(),max:new Date(),formatString: \"yyyy-MM-dd\",value:new Date()});\n");
      out.write("\t\t$(\"#updateDate2\").jqxDateTimeInput({disabled: true});\n");
      out.write("\t\t\n");
      out.write("\t\t$('#createDate1').on('close', function (event) {\n");
      out.write("\t\t // Some code here. \n");
      out.write("\t\t \t$(\"#createDate2\").jqxDateTimeInput({disabled: false});\n");
      out.write(
          "\t\t \t$(\"#createDate2\").jqxDateTimeInput({min: $('#createDate1').jqxDateTimeInput('getDate')});\n");
      out.write(" \t\t}); \t\n");
      out.write(" \t\t\n");
      out.write(" \t\t$('#updateDate1').on('close', function (event) {\n");
      out.write("\t\t // Some code here. \n");
      out.write("\t\t \t$(\"#updateDate2\").jqxDateTimeInput({disabled: false});\n");
      out.write(
          "\t\t \t$(\"#updateDate2\").jqxDateTimeInput({min: $('#updateDate1').jqxDateTimeInput('getDate')});\n");
      out.write(" \t\t}); \t\n");
      out.write("\t\t\n");
      out.write("\t\tfunEnabled();\n");
      out.write("\t}\n");
      out.write("\t\n");
      out.write("function ckeckEmpty(){\n");
      out.write("\tif(document.getElementById(\"order_number\").value == \"\"){\n");
      out.write("\t\talert(\"Please Enter Order Number\");\n");
      out.write("\t\tdocument.getElementById(\"order_number\").focus();\n");
      out.write("\t\treturn false;\n");
      out.write("\t} else {\n");
      out.write("\t\treturn true;\n");
      out.write("\t}\n");
      out.write("}\n");
      out.write("\n");
      out.write("\n");
      out.write("</script>\n");

      String call_type = request.getParameter("call_type");
      if (call_type == null) {
        call_type = "";
      }
      if (call_type.equals("search_payment")) {
        String m = "<< Show List";

        out.write("\n");
        out.write("\t\t\t<div id=\"selected_order\">\n");
        out.write("\t\t\t\t<b>Selected orders</b>\n");
        out.write(
            "\t\t\t\t<form action=\"PrintSelectedCustPayment.jsp\" method=\"get\" id=\"submit_form\">\n");
        out.write(
            "\t\t\t\t<table style=\"width: 100%;border-collapse: collapse;\" border=1 id=\"selected_order_table\">\n");
        out.write("\t\t\t\t<tr>\n");
        out.write("\t\t\t\t\t<th style=\"width: 20%;\">Order Number</th>\n");
        out.write("\t\t\t\t\t<th style=\"width: 35%;\">Cust Name</th>\n");
        out.write("\t\t\t\t\t<th style=\"width: 20%;\">Balance</th>\n");
        out.write("\t\t\t\t\t<th style=\"width: 25%;\">&nbsp;</th>\n");
        out.write("\t\t\t\t</tr>\n");
        out.write("\t\t\t\t</table>\n");
        out.write("\t\t\t\t<table style=\"width: 100%;\" border=1 id=\"insert_table\">\n");
        out.write("\t\t\t\t</table>\n");
        out.write(
            "\t\t\t\t <input type=\"text\" readonly=\"readonly\" name=\"order_count\" id=\"order_count_id\" size=\"3\" value=\"0\" style=\"background-color :#ECFB99 ;\"/> orders selected to print.\n");
        out.write(
            "\t\t\t\t<input type=\"submit\" onclick=\" return printSelectedInformation()\" value=\"Print\" style=\"float: right;\"/>\n");
        out.write("\t\t\t\t</form>\n");
        out.write("\t\t\t</div>\n");
        out.write("\t\t");
      }
      if (!call_type.equals("search_payment") || !call_type.equals("communication")) {

        out.write("\n");
        out.write("<center>\n");
      }
      out.write("\n");
      out.write("<fieldset style=\"width: 55%;\"><legend>\n");

      String msg = request.getParameter("msg");
      if (call_type.equals("receive_payment")) {
        out.print("<h3>Search Customer To Receive Payment</h3>");
      } else if (call_type.equals("search_payment")) {
        out.print("<h3>Search Customer To See Pending</h3>");
      } else if (call_type.equals("communication")) {
        out.print("<h3>Search Customer To Communicate</h3>");
      } else {
        out.print("<h3>Search Customer</h3>");
      }

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

      if (call_type.equals("receive_payment")) {

        out.write("\n");
        out.write(
            "\t\t<input type = \"radio\" name = \"radio\" onclick=\"ChangeCriteria('order')\" checked=\"checked\"/>Search By Order Number\n");
        out.write(
            "\t\t<input type = \"radio\" name = \"radio\" onclick=\"ChangeCriteria('cust')\"/>Search By Customer Detail\n");
        out.write("\t");
      }
      if (call_type.equals("receive_payment")) {

        out.write("\n");
        out.write("\t<br/><br/>\n");
        out.write("<form id=\"myform1\" action=\"SearchCustUsingOrderNo.jsp\" method=\"get\">\n");
        out.write("\t");

        if (msg != null) {
          out.print("<i><font color=red>No Matching Record Found</font></i><br/><br/>");
        }

        out.write("\n");
        out.write(
            "\tEnter Order Number :&nbsp;&nbsp;<input type = \"text\" name = \"order_number\" value=\"\" id =\"order_number\" onkeypress=\"return isNumberKey(event)\"/>\n");
        out.write(
            "\t<input type = \"submit\" value=\"Search\" onclick=\"return ckeckEmpty();\"/>\n");
        out.write("\n");
        out.write("<br/>\n");
        out.write("</form>\n");
        out.write("<form name=\"myform\" method=\"post\" id=\"myform\" style=\"display: none\">\n");
      } else {
        out.write("\n");
        out.write("<form name=\"myform\" method=\"post\" id=\"myform\" >\n");
      }
      out.write("\n");
      out.write("\t<table style=\"width: 100%;\">\n");
      out.write("\t\t<tr style=\"width: 100%;\">\n");
      out.write(
          "\t\t\t<td align=\"center\" colspan=3><b><font color=\"blue\">&nbspA</font>ll Customers List &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n");
      out.write(
          "\t\t\t<input type=\"CheckBox\" name=\"chckall\" accesskey=\"a\" onClick=\"funEnabled();\"></td>\n");
      out.write("\t\t</tr>\t\t\n");
      out.write("\t\t<tr style=\"width: 100%;\">\n");
      out.write("\t\t\t<td colspan=3>\n");
      out.write("\t\t\t<div id=\"div4\" style=\"width: 100%;\" >\n");
      out.write("\t\t\t\t<table>\t\t\t\t\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\">\n");
      out.write("\t\t\t\t\t\t\t<b><font color=\"blue\">C</font>ustomer Code</b>\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 29%;\"><input style=\"width: 97%;\" type=\"text\" name=\"custCode\" accesskey=\"c\"></td>\n");
      out.write("\t\t\t\t\t\t");
      if (call_type.equals("search_payment") || call_type.equals("communication")) {
        out.write("\n");
        out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
        out.write("\t\t\t\t\t\t\n");
        out.write("\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\">\n");
        out.write("\t\t\t\t\t\t\t<b>O<font color=\"blue\">r</font>der Number</b>\n");
        out.write("\t\t\t\t\t\t</td>\n");
        out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
        out.write(
            "\t\t\t\t\t\t<td style=\"width: 29%;\"><input style=\"width: 97%;\" type=\"text\" name=\"ordernumber\" accesskey=\"c\"></td>\n");
        out.write("\t\t\t\t\t\t");
      }
      out.write("\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Customer <font color=\"blue\">N</font>ame</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 29%;\"><input style=\"width: 97%;\" type=\"text\" name=\"custName\"  align=\"right\" accesskey=\"n\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">P</font>hone Number</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 29%;\"><input style=\"width: 97%;\" type=\"text\" name=\"phonenumber\" size=\"22\" align=\"right\" colspan=\"2\" accesskey=\"p\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>M<font color=\"blue\">o</font>bile Number</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type=\"text\" name=\"mobilenumber\" size=\"22\" align=\"right\" colspan=\"2\" accesskey=\"o\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Na<font color=\"blue\">m</font>e String</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" style=\"width: 100%;\" type=\"text\" name=\"nameString\" size=\"22\"  align=\"right\" accesskey=\"m\" colspan=\"2\"></td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">B</font>uilding</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type=\"text\" name=\"Building\" accesskey=\"b\" align=\"right\"></b></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Building <font color=\"blue\">N</font>o.</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type=\"text\" name=\"Building_no\"  size=\"22\"  accesskey=\"o\"></b></td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t    <td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">W</font>ing</b></td>\n");
      out.write("\t\t\t\t\t    <td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t    <td><input style=\"width: 97%;\" type =\"text\" name=\"wing\" accesskey=\"w\" ></td>\n");
      out.write("\t\t\t\t\t    \n");
      out.write("\t\t\t\t\t    <td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t    \n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">F</font>lat No.</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type =\"text\" name=\"block\"  size=\"22\" accesskey=\"f\" align=\"right\">\n");
      out.write("\t\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Addr<font color=\"blue\">e</font>ss1</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type =\"text\" accesskey=\"e\" name=\"add1\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>A<font color=\"blue\">d</font>dress2</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t\t<td><input style=\"width: 97%;\" type =\"text\" accesskey=\"d\" name=\"add2\" size=\"22\"></td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr >\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>A<font color=\"blue\">r</font>ea</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write("\t\t\t\t\t\t<td>\n");
      out.write("\t\t\t\t\t\t");

      String name;
      try {
        Context initContext = new InitialContext();
        Context envContext = (Context) initContext.lookup("java:/comp/env");
        // DataSource ds = (DataSource)envContext.lookup("jdbc/js");
        DataSource ds = (DataSource) envContext.lookup("jdbc/re");
        Connection conn = ds.getConnection();
        Statement stmt = conn.createStatement();
        ResultSet rs =
            stmt.executeQuery(
                "select value from code_table where category='AREA' order by value asc");

        out.write("\n");
        out.write("\t\t\t\t\t\t\t<SELECT style=\"width: 97%;\" name=\"area\">\n");
        out.write("\t\t\t\t\t\t\t\t<OPTION VALUE=\"\"> Select Area </OPTION>\n");
        out.write("\t\t\t\t\t\t");

        while (rs.next()) {
          name = rs.getString(1);

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

        out.write("\n");
        out.write("\t\t\t\t\t\t\t</SELECT>\n");
        out.write("\t\t\t\t\t\t</td>\t\n");
        out.write("\t\t\t\t\t\t\n");
        out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
        out.write("\t\t\t\n");
        out.write(
            "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Payment Type</b></td>\n");
        out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
        out.write("\t\t\t\t\t\t<td>\n");
        out.write("\t\t\t\t\t\t\t<SELECT style=\"width: 97%;\" name=\"payment\" align=\"left\">\n");
        out.write("\t\t\t\t\t\t\t\t<OPTION selected VALUE=\"\"> Select Type </OPTION>\n");
        out.write("\t\t\t\t\t\t\t\t<OPTION VALUE=\"NoType\"> No Type </OPTION>\n");
        out.write("\t\t\t\t\t\t");

        ResultSet rs2 =
            stmt.executeQuery("SELECT payment_type_code, payment_type_desc FROM payment_type");
        while (rs2.next()) {

          out.write("\t\n");
          out.write("\t\t\t\t\t\t\t\t<OPTION VALUE=\"");
          out.print(rs2.getString(1));
          out.write('"');
          out.write('>');
          out.write(' ');
          out.print(rs2.getString(2));
          out.write(" </OPTION>\n");
          out.write("\t\t\t\t\t\t");
        }
        rs2.close();
        stmt.close();
        conn.close();
      } catch (Exception e) {
        e.getMessage();
        e.printStackTrace();
      }

      out.write("\n");
      out.write("\t\t\t\t\t\t\t</SELECT>\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Create<font color=\"blue\">D</font>ate</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write("\t\t\t\t\t\t<td>\n");
      out.write(
          "\t\t\t\t\t\t\t<!-- <input type =\"text\" accesskey=\"d\" name=\"c_date1\" size=\"15\" style=\"width: 79%;\">\n");
      out.write(
          "\t\t\t\t\t\t\t<input type=\"button\" onClick=\"c1.popup('c_date1');\" value=\"...\" style=\"width: 15%;\"/> -->\n");
      out.write("\t\t\t\t\t\t\t<div id='createDate1'></div>\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>And</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write("\t\t\t\t\t\t<td> \n");
      out.write(
          "\t\t\t\t\t\t\t<!-- <input type =\"text\" name=\"c_date2\" size=\"15\" style=\"width: 79%;\">\n");
      out.write(
          "\t\t\t\t\t\t\t<input type=\"button\" onClick=\"c1.popup('c_date2');\" value=\"...\" style=\"width: 15%;\"/> -->\n");
      out.write("\t\t\t\t\t\t\t<div id='createDate2'></div>\n");
      out.write("\t\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">U</font>pdate Date</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write("\t\t\t\t\t\t<td>\n");
      out.write(
          "\t\t\t\t\t\t\t<!-- <input type =\"text\" accesskey=\"u\" name=\"u_date1\" size=\"15\" style=\"width: 79%;\"/>\n");
      out.write(
          "\t\t\t\t\t\t\t<input type=\"button\" onClick=\"c1.popup('u_date1');\" value=\"...\" style=\"width: 15%;\"/> -->\n");
      out.write("\t\t\t\t\t\t\t<div id=\"updateDate1\"></div>\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>And</b></td>\n");
      out.write("\t\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write("\t\t\t\t\t\t<td> \n");
      out.write(
          "\t\t\t\t\t\t\t<!-- <input type =\"text\" name=\"u_date2\" size=\"15\" style=\"width: 79%;\"/>\n");
      out.write(
          "\t\t\t\t\t\t\t<input type=\"button\" onClick=\"c1.popup('u_date2');\" value=\"...\" style=\"width: 15%;\"/> -->\n");
      out.write("\t\t\t\t\t\t\t<div id='updateDate2'></div>\n");
      out.write("\t\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t\t</tr>\n");
      out.write("\t\t\t\t\t<tr>\n");
      out.write(
          "\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b><font color=\"blue\">S</font>tation</b></td>\n");
      out.write("\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t<td><input style=\"width: 97%;\" type =\"text\"  size=\"22\" accesskey=\"d\" name=\"station\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t<td style=\"width: 8%;\" align=\"left\"></td>\n");
      out.write("\t\t\t\t\t\t\n");
      out.write("\t\t\t\t\t<td style=\"width: 15%;\" align=\"left\"><b>Last Order Days</b></td>\n");
      out.write("\t\t\t\t\t<td style=\"width: 1%;\" align=\"left\">:</td>\n");
      out.write(
          "\t\t\t\t\t<td><input style=\"width: 97%;\" type=\"text\" name=\"selmonth\"/></td></tr>\n");
      out.write("\t\t\t\t</table></div>\n");
      out.write("\t\t\t</td>\n");
      out.write("\t\t</tr>\n");
      out.write("\t\t\t\n");
      out.write("\t\t<tr>\n");
      out.write("\t\t\t<td align=\"center\" colspan=4>\n");
      out.write(
          "\t\t\t\t<input type=\"submit\" name=\"search\"  title=\"Press <Enter>\" value=\"Search <Enter>\" accesskey=\"s\" onclick=\"checkField();return false;\"/>\n");
      out.write(
          "\t\t\t\t<input type=\"reset\" name=\"clear\" title=\"Press <Alt+c>\" tabindex=\"1\" value=\"Clear <Alt+c>\" accesskey=\"c\" onclick=\"document.getElementById('txtHint').innerHTML='';\"/>\n");
      out.write(
          "\t\t\t\t<INPUT type=BUTTON value=\"Cancel <Alt+c>\" accesskey=\"c\" onClick=\"showMsg();\"/></center>\n");
      out.write("\t\t\t</td>\n");
      out.write("\t\t</tr>\n");
      out.write("\t</table>\n");
      out.write("\t</fieldset>\n");
      out.write("\t<input  type=\"hidden\" name=\"hchckall\" value=\"1\">\n");
      out.write("\t<input type=\"hidden\" name=\"call_type\" value=\"");
      out.print(call_type);
      out.write("\"/>\n");
      out.write("<script>\n");
      out.write("function funEnabled(){\n");
      out.write("\t    if (document.myform.chckall.checked==true){\n");
      out.write("\t\t\tdocument.getElementById('div4').style.visibility=\"hidden\";\n");
      out.write("\t\t\tdocument.myform.hchckall.value=1;\t\t\n");
      out.write("\t\t\t$(\"#createDate2\").jqxDateTimeInput({disabled: true});\n");
      out.write("\t\t\t$(\"#updateDate2\").jqxDateTimeInput({disabled: true});\n");
      out.write("\t\t\t\n");
      out.write("\t\t}\n");
      out.write("\t\telse{\n");
      out.write("\t\t\tdocument.getElementById('div4').style.visibility=\"visible\";\n");
      out.write("\t\t\tdocument.myform.hchckall.value=0;\t\t\t\n");
      out.write("\t\t}\n");
      out.write("\t}\n");
      out.write("window.onload =Clear;\n");
      out.write("\n");
      out.write("function ChangeCriteria(str){\n");
      out.write("\tif(str == \"cust\"){\n");
      out.write("\t\tdocument.getElementById(\"myform\").style.display='block';\n");
      out.write("\t\tdocument.getElementById(\"myform1\").style.display='none';\n");
      out.write("\t}else if(str == \"order\"){\n");
      out.write("\t\tdocument.getElementById(\"myform\").style.display='none';\n");
      out.write("\t\tdocument.getElementById(\"myform1\").style.display='block';\n");
      out.write("\t\tdocument.getElementById(\"txtHint\").innerHTML=\"\";\n");
      out.write("\t\tdocument.getElementById(\"order_number\").focus();\n");
      out.write("\t\tdocument.getElementById(\"order_number\").value=\"\";\n");
      out.write("\t}\n");
      out.write("}\n");
      out.write("function isNumberKey(evt) {\n");
      out.write("\tvar charCode = (evt.which) ? evt.which : event.keyCode;\n");
      out.write("\tif (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))\n");
      out.write("\t\treturn false;\n");
      out.write("\telse\n");
      out.write("\t\treturn true;\n");
      out.write("}\n");
      out.write("</script>\n");
      out.write(
          "\t<hr><center><div id=\"txtHint\" class=\"ddm1\" style=\"background-color: white;width: 100%;max-height: 400px;overflow: auto;\"></div></center>\n");
      out.write("\t<br><br>\n");
      out.write(
          "\t<p><h1><center><div id=\"waitMessage\"  style=\"cursor: sw-resize;\"></center></div></h1></p>\n");

      String fromFromName = "";
      if (request.getParameter("fromForm") != null) fromFromName = request.getParameter("fromForm");
      // CustPmtHstry

      out.write("\n");
      out.write("\t<input type=\"hidden\" name=\"fromForm\" value=\"");
      out.print(fromFromName);
      out.write("\">\n");
      out.write("</form>\n");
      out.write("\n");
      out.write(
          "<div id=\"dispdiv\" align=\"center\" style=\"border:1px solid black; padding:25px; text-align:center; display:none; background-color:#FFF; overflow:auto; height:300px; width=200px;\"> </div>\n");
      out.write("</body>\n");
      out.write("</html>\n");
    } 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, 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\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

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

      GenericTRChip theChip = (GenericTRChip) request.getAttribute(AbstractChip.CHIP_KEY);

      out.write("\r\n<tr ");
      out.print((theChip.getHeight() != null ? " height=\"" + theChip.getHeight() + "\"" : ""));
      out.print((theChip.getWidth() != null ? " width=\"" + theChip.getWidth() + "\"" : ""));
      out.write('>');
      out.write('\r');
      out.write('\n');

      for (final Iterator it = theChip.getChildren().iterator(); it.hasNext(); ) {
        final GenericTDChip chip = (GenericTDChip) it.next();
        chip.render(pageContext);
      }

      out.write("\r\n</tr>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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);
    }
  }
Exemplo n.º 12
0
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final java.lang.String _jspx_method = request.getMethod();
    if (!"GET".equals(_jspx_method)
        && !"POST".equals(_jspx_method)
        && !"HEAD".equals(_jspx_method)
        && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      response.sendError(
          HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
      return;
    }

    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=EUC-KR");
      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");
      out.write("\r\n");
      out.write("\r\n");

      // String savePath = "C:\\Program Files\\Wowza Media Systems\\Wowza Streaming Engine
      // 4.2.0\\content\\safeme";
      String savePath =
          "C:\\Program Files (x86)\\Wowza Media Systems\\Wowza Streaming Engine 4.3.0\\content\\safeme";
      int sizelimit = 50 * 1024 * 1024;
      try {
        out.print("<br>");
        out.print("SavePath : " + savePath);
        MultipartRequest multi =
            new MultipartRequest(request, savePath, sizelimit, new DefaultFileRenamePolicy());

        // MultipartRequest를 다양하게 활용하기 위한 방법(확장..)
        /* Enumeration formNames = multi.getFileNames(); //폼의 이름 변경
        String formName = (String)formNames.nextElement(); //자료가 많을 경우엔 while문을 사용
        String fileName = multi.getFilesystemName(formName); //파일의 이름 얻기 */

        // multi.getFile("images");
      } catch (Exception e) {
        out.print("<br>");
        out.print("<br>");
        out.print("예외 상황 발생..!");
        out.print("<br>예외상황 : ");
        out.print(e);
      } finally {
        out.print("<br>");
        out.print("저장완료!");
      }

      out.write("\r\n");
      out.write("<p></p>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              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);
    }
  }