public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); ServletContext application; HttpSession session = request.getSession(); nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication); try { if (finance_db.conn((String) dbSession.getAttribute("unit_db_name"))) { String finance_cheque_id = request.getParameter("finance_cheque_id"); String sql = "delete from finance_bill where id='" + finance_cheque_id + "'"; finance_db.executeUpdate(sql); finance_db.commit(); finance_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { HttpSession session = request.getSession(); PrintWriter out = response.getWriter(); MakePdf mm = new MakePdf(); excel query = new excel(); getKeyColumn column = new getKeyColumn(); mm.setConfigFile("xml/stock/pdf_export.xml"); String sql = ""; String tablename = request.getParameter("tablename"); String condition = ""; String queue = ""; if (tablename.equals("stock_balance")) { queue = "order by chain_ID"; condition = "where address_group!=''"; } sql = "select * from " + tablename + " " + condition + " " + queue; int a = sql.indexOf("*"); String sqla = sql.substring(0, a) + "count(*) as A" + sql.substring(a + 1, sql.length()); mm.make( (String) dbSession.getAttribute("unit_db_name"), tablename, sqla, sql, "pdf_files/stock_data", 1500, session); int fileAmount = mm.fileAmount(); response.sendRedirect("stock/export/pdf_ok_a.jsp?file_amount=" + fileAmount + ""); } catch (Exception ex) { ex.printStackTrace(); } }
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 synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); nseer_db_backup1 stock_db = new nseer_db_backup1(dbApplication); try { if (stock_db.conn((String) dbSession.getAttribute("unit_db_name"))) { int i; int intRowCount; String sqll = "select * from stock_config_public_char where describe1='\u51fa\u5165\u5e93\u7406\u7531'"; ResultSet rs = stock_db.executeQuery(sqll); rs.next(); rs.last(); intRowCount = rs.getRow(); String[] del = new String[intRowCount]; del = (String[]) dbSession.getAttribute("del"); if (del != null) { for (i = 1; i <= intRowCount; i++) { String sql = "delete from stock_config_public_char where id='" + del[i - 1] + "'"; stock_db.executeUpdate(sql); } } stock_db.commit(); stock_db.close(); response.sendRedirect("stock/config/apply_gather_pay/reason.jsp"); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
public int doStartTag() throws JspException { try { HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); ModuleContext context = (ModuleContext) request.getSession().getAttribute("context"); String viewObject = request.getParameter("viewObject"); viewObject = (viewObject == null || viewObject.equals("")) ? "xava_view" : viewObject; View view = (View) context.get(request, viewObject); MetaReference metaReference = view.getMetaReference(reference).cloneMetaReference(); metaReference.setName(reference); String prefix = request.getParameter("propertyPrefix"); prefix = prefix == null ? "" : prefix; String application = request.getParameter("application"); String module = request.getParameter("module"); String referenceKey = Ids.decorate(application, module, prefix + reference); request.setAttribute(referenceKey, metaReference); String editorURL = "reference.jsp?referenceKey=" + referenceKey + "&onlyEditor=true&frame=false&composite=false&descriptionsList=true"; String editorPrefix = Module.isPortlet() ? "/WEB-INF/jsp/xava/" : "/xava/"; try { pageContext.include(editorPrefix + editorURL); } catch (ServletException ex) { Throwable cause = ex.getRootCause() == null ? ex : ex.getRootCause(); log.error(cause.getMessage(), cause); pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp"); } catch (Exception ex) { log.error(ex.getMessage(), ex); pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp"); } } catch (Exception ex) { log.error(ex.getMessage(), ex); throw new JspException(XavaResources.getString("descriptionsList_tag_error", reference)); } return SKIP_BODY; }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { // 实例化 HttpSession session = request.getSession(); ServletContext context = session.getServletContext(); String path = context.getRealPath("/"); counter count = new counter(dbApplication); SmartUpload mySmartUpload = new SmartUpload(); mySmartUpload.setCharset("UTF-8"); nseer_db_backup1 qcs_db = new nseer_db_backup1(dbApplication); if (qcs_db.conn((String) dbSession.getAttribute("unit_db_name"))) { mySmartUpload.initialize(pageContext); String file_type = getFileLength.getFileType((String) session.getAttribute("unit_db_name")); long d = getFileLength.getFileLength((String) session.getAttribute("unit_db_name")); mySmartUpload.setMaxFileSize(d); mySmartUpload.setAllowedFilesList(file_type); try { mySmartUpload.upload(); String qcs_id = mySmartUpload.getRequest().getParameter("qcs_id"); String config_id = mySmartUpload.getRequest().getParameter("config_id"); String[] item = mySmartUpload.getRequest().getParameterValues("item"); if (item != null) { String[] file_name = new String[mySmartUpload.getFiles().getCount()]; String[] not_change = new String[mySmartUpload.getFiles().getCount()]; java.util.Date now = new java.util.Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); String time = formatter.format(now); String standard_id = mySmartUpload.getRequest().getParameter("standard_id"); String sqla = "select attachment1 from qcs_intrmanufacture where qcs_id='" + qcs_id + "' and (check_tag='5' or check_tag='9')"; ResultSet rs = qcs_db.executeQuery(sqla); if (!rs.next()) { response.sendRedirect("draft/qcs/intrmanufacture_ok.jsp?finished_tag=1"); } else { String[] attachment = mySmartUpload.getRequest().getParameterValues("attachment"); String[] delete_file_name = new String[0]; if (attachment != null) { delete_file_name = new String[attachment.length]; for (int i = 0; i < attachment.length; i++) { delete_file_name[i] = rs.getString(attachment[i]); } } for (int i = 0; i < mySmartUpload.getFiles().getCount(); i++) { com.jspsmart.upload.SmartFile file = mySmartUpload.getFiles().getFile(i); if (file.isMissing()) { file_name[i] = ""; int q = i + 1; String field_name = "attachment" + q; if (!rs.getString(field_name).equals("")) not_change[i] = "yes"; continue; } int filenum = count.read( (String) dbSession.getAttribute("unit_db_name"), "qcsAttachmentcount"); count.write( (String) dbSession.getAttribute("unit_db_name"), "qcsAttachmentcount", filenum); file_name[i] = filenum + file.getFileName(); file.saveAs(path + "qcs/file_attachments/" + filenum + file.getFileName()); } String apply_id = mySmartUpload.getRequest().getParameter("apply_id"); String product_id = mySmartUpload.getRequest().getParameter("product_id"); String product_name = mySmartUpload.getRequest().getParameter("product_name"); String qcs_amount = mySmartUpload.getRequest().getParameter("qcs_amount"); String qcs_time = mySmartUpload.getRequest().getParameter("qcs_time"); String quality_way = mySmartUpload.getRequest().getParameter("quality_way"); String quality_solution = mySmartUpload.getRequest().getParameter("quality_solution"); String sampling_standard = mySmartUpload.getRequest().getParameter("sampling_standard"); String sampling_amount = mySmartUpload.getRequest().getParameter("sampling_amount"); String accept = mySmartUpload.getRequest().getParameter("accept"); String reject = mySmartUpload.getRequest().getParameter("reject"); String qualified = mySmartUpload.getRequest().getParameter("qualified"); String unqualified = mySmartUpload.getRequest().getParameter("unqualified"); String qcs_result = mySmartUpload.getRequest().getParameter("qcs_result"); String checker = mySmartUpload.getRequest().getParameter("checker"); String checker_id = mySmartUpload.getRequest().getParameter("checker_id"); String check_time = mySmartUpload.getRequest().getParameter("check_time"); String changer = mySmartUpload.getRequest().getParameter("changer"); String changer_id = mySmartUpload.getRequest().getParameter("changer_id"); String change_time = mySmartUpload.getRequest().getParameter("change_time"); String bodyab = new String( mySmartUpload.getRequest().getParameter("remark").getBytes("UTF-8"), "UTF-8"); String remark = exchange.toHtml(bodyab); sqla = "update qcs_intrmanufacture set apply_id='" + apply_id + "',product_id='" + product_id + "',product_name='" + product_name + "',qcs_amount='" + qcs_amount + "',qcs_time='" + qcs_time + "',quality_way='" + quality_way + "',quality_solution='" + quality_solution + "',sampling_standard='" + sampling_standard + "',sampling_amount='" + sampling_amount + "',accept='" + accept + "',reject='" + reject + "',qualified='" + qualified + "',unqualified='" + unqualified + "',changer_id='" + changer_id + "',qcs_result='" + qcs_result + "',changer='" + changer + "',change_time='" + change_time + "',remark='" + remark + "',check_tag='5'"; String sqlb = " where qcs_id='" + qcs_id + "'"; if (attachment != null) { for (int i = 0; i < attachment.length; i++) { sqla = sqla + "," + attachment[i] + "=''"; java.io.File file = new java.io.File(path + "qcs/file_attachments/" + delete_file_name[i]); file.delete(); } } for (int i = 0; i < mySmartUpload.getFiles().getCount(); i++) { if (not_change[i] != null && not_change[i].equals("yes")) continue; int p = i + 1; sqla = sqla + ",attachment" + p + "='" + file_name[i] + "'"; } String sql = sqla + sqlb; qcs_db.executeUpdate(sql); sql = "delete from qcs_intrmanufacture_details where qcs_id='" + qcs_id + "'"; qcs_db.executeUpdate(sql); String[] default_basis = mySmartUpload.getRequest().getParameterValues("default_basis"); String[] ready_basis = mySmartUpload.getRequest().getParameterValues("ready_basis"); String[] quality_method = mySmartUpload.getRequest().getParameterValues("quality_method"); String[] analyse_method = mySmartUpload.getRequest().getParameterValues("analyse_method"); String[] standard_value = mySmartUpload.getRequest().getParameterValues("standard_value"); String[] standard_max = mySmartUpload.getRequest().getParameterValues("standard_max"); String[] standard_min = mySmartUpload.getRequest().getParameterValues("standard_min"); String[] quality_value = mySmartUpload.getRequest().getParameterValues("quality_value"); String[] sampling_amount_d = mySmartUpload.getRequest().getParameterValues("sampling_amount_d"); String[] qualified_d = mySmartUpload.getRequest().getParameterValues("qualified_d"); String[] unqualified_d = mySmartUpload.getRequest().getParameterValues("unqualified_d"); String[] quality_result = mySmartUpload.getRequest().getParameterValues("quality_result"); String[] unqualified_reason = mySmartUpload.getRequest().getParameterValues("unqualified_reason"); for (int i = 0; i < item.length; i++) { if (!item[i].equals("")) { sql = "insert into qcs_intrmanufacture_details(qcs_id,item,default_basis,ready_basis,quality_method,analyse_method,standard_value,standard_max,standard_min,quality_value,sampling_amount_d,qualified_d,unqualified_d,quality_result,unqualified_reason,details_number) values('" + qcs_id + "','" + item[i] + "','" + default_basis[i] + "','" + ready_basis[i] + "','" + quality_method[i] + "','" + analyse_method[i] + "','" + standard_value[i] + "','" + standard_max[i] + "','" + standard_min[i] + "','" + quality_value[i] + "','" + sampling_amount_d[i] + "','" + qualified_d[i] + "','" + unqualified_d[i] + "','" + quality_result[i] + "','" + unqualified_reason[i] + "','" + i + "')"; qcs_db.executeUpdate(sql); } } response.sendRedirect("draft/qcs/intrmanufacture_ok.jsp?finished_tag=0"); } qcs_db.commit(); qcs_db.close(); } else { response.sendRedirect("draft/qcs/intrmanufacture_ok.jsp?finished_tag=7"); } } catch (Exception ex) { response.sendRedirect("draft/qcs/intrmanufacture_ok.jsp?finished_tag=6"); } } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
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 synchronized void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { ValidataNumber validata = new ValidataNumber(); nseer_db_backup1 crm_db = new nseer_db_backup1(dbApplication); if (crm_db.conn((String) dbSession.getAttribute("unit_db_name"))) { counter count = new counter(dbApplication); PrintWriter out = response.getWriter(); String product_amount = request.getParameter("product_amount"); String reasonexact = request.getParameter("reasonexact"); String which_time = request.getParameter("which_time"); int num = Integer.parseInt(product_amount); String reason = request.getParameter("reason"); String customer_ID = request.getParameter("customer_ID"); String customer_name = request.getParameter("customer_name"); String real_customer_mailing_address = request.getParameter("real_customer_mailing_address"); String real_contact_person = request.getParameter("real_contact_person"); String real_contact_person_tel = request.getParameter("real_contact_person_tel"); String real_contact_person_fax = request.getParameter("real_contact_person_fax"); String real_invoice_time = request.getParameter("real_invoice_time"); String real_invoice_type = request.getParameter("real_invoice_type"); String register = request.getParameter("register"); String register_ID = request.getParameter("register_ID"); String invoice_group = request.getParameter("invoice_group"); String register_time = request.getParameter("register_time"); double invoiced_subtotal_sum = 0.0d; double invoiced_subtotal_sum_all = 0.0d; int p = 0; for (int i = 1; i <= num; i++) { String tem_invoice_sum = "invoice_sum" + i; String invoice_sum2 = request.getParameter(tem_invoice_sum); if (invoice_sum2.equals("")) invoice_sum2 = "0"; StringTokenizer tokenTO2 = new StringTokenizer(invoice_sum2, ","); String invoice_sum = ""; while (tokenTO2.hasMoreTokens()) { String invoice_sum1 = tokenTO2.nextToken(); invoice_sum += invoice_sum1; } if (!validata.validata(invoice_sum)) { p++; } } if (p == 0) { int n = 0; if (n == 0) { String sql8 = "select * from crm_order where order_id='" + reasonexact + "' and (invoice_check_tag='9' or invoice_check_tag='5') and which_time='" + which_time + "'"; ResultSet rs8 = crm_db.executeQuery(sql8); if (rs8.next()) { for (int j = 1; j <= num; j++) { String tem_details_number = "details_number" + j; String tem_id = "id" + j; String id = request.getParameter(tem_id); String details_number = request.getParameter(tem_details_number); } String product_ID_control1 = request.getParameter("product_ID1"); String subtotal_control1 = request.getParameter("invoiced_subtotal1"); double subtotal_control = Double.parseDouble(subtotal_control1); for (int j = 1; j <= num; j++) { invoiced_subtotal_sum = 0; String tem_details_number = "details_number" + j; String tem_product_name = "product_name" + j; String tem_product_ID = "product_ID" + j; String tem_subtotal = "subtotal" + j; String tem_invoice_sum = "invoice_sum" + j; String tem_invoiced_subtotal = "invoiced_subtotal" + j; String tem_remark = "remark" + j; String tem_id = "id" + j; String id = request.getParameter(tem_id); String product_name = request.getParameter(tem_product_name); String product_ID = request.getParameter(tem_product_ID); String details_number = request.getParameter(tem_details_number); String subtotal = request.getParameter(tem_subtotal); String invoiced_subtotal = request.getParameter(tem_invoiced_subtotal); String invoice_sum2 = request.getParameter(tem_invoice_sum); if (invoice_sum2.equals("")) invoice_sum2 = "0"; StringTokenizer tokenTO1 = new StringTokenizer(invoice_sum2, ","); String invoice_sum = ""; while (tokenTO1.hasMoreTokens()) { String invoice_sum1 = tokenTO1.nextToken(); invoice_sum += invoice_sum1; } String remark = request.getParameter(tem_remark); if (product_ID.equals(product_ID_control1)) { if (invoice_sum != null && Double.parseDouble(invoice_sum) != 0) { subtotal_control += Double.parseDouble(invoice_sum); invoiced_subtotal_sum_all += Double.parseDouble(invoice_sum); String sql1 = "update crm_ordering set reason='" + reason + "',customer_ID='" + customer_ID + "',customer_name='" + customer_name + "',real_customer_mailing_address='" + real_customer_mailing_address + "',real_contact_person='" + real_contact_person + "',real_contact_person_tel='" + real_contact_person_tel + "',real_contact_person_fax='" + real_contact_person_fax + "',real_invoice_time='" + real_invoice_time + "',real_invoice_type='" + real_invoice_type + "',register='" + register + "',register_ID='" + register_ID + "',register_time='" + register_time + "',product_ID='" + product_ID + "',product_name='" + product_name + "',invoice_sum='" + invoice_sum + "',remark='" + remark + "',invoice_group='" + invoice_group + "' where id='" + id + "'"; crm_db.executeUpdate(sql1); if (subtotal_control == Double.parseDouble(subtotal)) { String sql2 = "update crm_order_details set invoiced_subtotal='" + subtotal_control + "',invoice_tag='1' where order_ID='" + reasonexact + "' and details_number='" + details_number + "'"; crm_db.executeUpdate(sql2); } else { String sql3 = "update crm_order_details set invoiced_subtotal='" + subtotal_control + "' where order_ID='" + reasonexact + "' and details_number='" + details_number + "'"; crm_db.executeUpdate(sql3); } } else if (Double.parseDouble(invoice_sum) == 0) { String sql7 = "delete from crm_ordering where id='" + id + "'"; crm_db.executeUpdate(sql7); } } else { if (invoice_sum != null && Double.parseDouble(invoice_sum) != 0) { product_ID_control1 = product_ID; subtotal_control = Double.parseDouble(invoiced_subtotal) + Double.parseDouble(invoice_sum); invoiced_subtotal_sum_all += Double.parseDouble(invoice_sum); String sql1 = "update crm_ordering set reason='" + reason + "',customer_ID='" + customer_ID + "',customer_name='" + customer_name + "',real_customer_mailing_address='" + real_customer_mailing_address + "',real_contact_person='" + real_contact_person + "',real_contact_person_tel='" + real_contact_person_tel + "',real_contact_person_fax='" + real_contact_person_fax + "',real_invoice_time='" + real_invoice_time + "',real_invoice_type='" + real_invoice_type + "',register='" + register + "',register_ID='" + register_ID + "',register_time='" + register_time + "',product_ID='" + product_ID + "',product_name='" + product_name + "',invoice_sum='" + invoice_sum + "',remark='" + remark + "',invoice_group='" + invoice_group + "' where id='" + id + "'"; crm_db.executeUpdate(sql1); if (subtotal_control == Double.parseDouble(subtotal)) { String sql2 = "update crm_order_details set invoiced_subtotal='" + subtotal_control + "',invoice_tag='1' where order_ID='" + reasonexact + "' and details_number='" + details_number + "'"; crm_db.executeUpdate(sql2); } else { String sql3 = "update crm_order_details set invoiced_subtotal='" + subtotal_control + "' where order_ID='" + reasonexact + "' and details_number='" + details_number + "'"; crm_db.executeUpdate(sql3); } } else if (Double.parseDouble(invoice_sum) == 0) { String sql7 = "delete from crm_ordering where id='" + id + "'"; crm_db.executeUpdate(sql7); } } } String sql2 = "update crm_order set invoice_check_tag='2' where order_ID='" + reasonexact + "'"; crm_db.executeUpdate(sql2); response.sendRedirect("draft/crm/invoice_ok.jsp?finished_tag=2"); } else { response.sendRedirect("draft/crm/invoice_ok.jsp?finished_tag=1"); } } else { response.sendRedirect("draft/crm/invoice_ok_a.jsp?order_ID=" + reasonexact + ""); } } else { response.sendRedirect("draft/crm/invoice_ok_b.jsp?order_ID=" + reasonexact + ""); } crm_db.commit(); crm_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); String path = request.getContextPath(); String basePath = request.getScheme() + "://" + ("xsaqjy".equals(request.getServerName()) ? "xsaqjy.ljgps.net" : request.getServerName()) + (request.getServerPort() == 80 ? "" : ":" + request.getServerPort()) + path + "/"; Long userno = (Long) session.getAttribute("userno"); // 获得当前登录用户的id用户号 if (userno == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); return; } Long admin = (Long) session.getAttribute("adminflag"); // 获得标记当前登录用户是否为数据管理员 if (admin == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); } Long dwtype = (Long) session.getAttribute("dwtype"); // 获得当前登录用户所在单位类型 0代表交警 1代表货运公司 if (dwtype == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); } String username = (String) request.getSession().getAttribute("username"); if (username == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); } List<String> list = (List<String>) session.getAttribute("list"); // 获得权限的集合 if (list == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); } Long userid = (long) Integer.parseInt((String) request.getSession().getAttribute("driverid")); if (userid == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); return; } Object u = request.getSession().getAttribute("onlineuser"); // 获得当前登录用户的对象 if (u == null) { response.sendRedirect(basePath + "page/admin/login.jsp"); } // 假如获得不到用户,就重新定向到登录页面 session.setAttribute("basePath", basePath); // 把basepath放到session中以便所有的页面使用 out.write("\r\n"); out.write("\r\n"); out.write("<!-- 获取当前日期,时间,星期 -->\r\n"); String week = ""; if (new Date().getDay() == 0) week = "星期日"; if (new Date().getDay() == 1) week = "星期一"; if (new Date().getDay() == 2) week = "星期二"; if (new Date().getDay() == 3) week = "星期三"; if (new Date().getDay() == 4) week = "星期四"; if (new Date().getDay() == 5) week = "星期五"; if (new Date().getDay() == 6) week = "星期六"; java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date(); // 得到当前系统时间 String date1 = formatter.format(currentTime); // 将日期时间格式化 String date2 = currentTime.toString(); // 将Date型日期时间转换成字符串形式 out.write("\r\n"); out.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<base href=\""); out.print(basePath); out.write("\" />\r\n"); out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n"); out.write("<title>机动车网上交通安全宣传教育监管平台</title>\r\n"); out.write( "<link href=\"page/admin/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n"); out.write( "<script type=\"text/javascript\" src=\"page/admin/javascript/jquery.min.js\"></script>\r\n"); out.write("<script type=\"text/javascript\">\r\n"); out.write("\t$(function() {\r\n"); out.write("\t\t//setMenuHeight\r\n"); out.write("\t\t$('.menu').height($(window).height() - 56 - 27 - 26);\r\n"); out.write("\t\t$('.sidebar').height($(window).height() - 56 - 27 - 26);\r\n"); out.write("\t\t$('.page').height($(window).height() - 56 - 27 - 26);\r\n"); out.write("\t\t$('.page iframe').width($(window).width() - 15 - 168);\r\n"); out.write("\t\t$('.subMenu a[href=\"#\"]').next('ul').toggle();\r\n"); out.write("\t\t//menu on and off\r\n"); out.write("\t\t$('.btn').click(function() {\r\n"); out.write("\t\t\t$('.menu').toggle();\r\n"); out.write("\r\n"); out.write("\t\t\tif ($(\".menu\").is(\":hidden\")) {\r\n"); out.write("\t\t\t\t$('iframe').width($(window).width() - 15 + 5);\r\n"); out.write("\t\t\t} else {\r\n"); out.write("\t\t\t\t$('iframe').width($(window).width() - 15 - 168);\r\n"); out.write("\t\t\t}\r\n"); out.write("\t\t});\r\n"); out.write(" \r\n"); out.write("\t\t//\r\n"); out.write("\t\t$('.subMenu a[href=\"#\"]').click(function() {\r\n"); out.write("\t\t\t$(this).next('ul').toggle();\r\n"); out.write("\t\t\treturn false;\r\n"); out.write("\t\t});\r\n"); out.write("\t});\r\n"); out.write("\t\r\n"); out.write("\tfunction clickmenu(topage){\r\n"); out.write("\t\t $('iframe')[0].src = topage;\r\n"); out.write("\t}\r\n"); out.write("</script>\r\n"); out.write("\r\n"); out.write("<!-- 后台页面权限的分配 -->\r\n"); out.write("<script type=\"text/javascript\">\r\n"); out.write("//页面初始化进行\r\n"); out.write("window.onload = function() \r\n"); out.write("{\r\n"); out.write("\tif(\""); out.print(admin); out.write("\" == \"1\")//数据管理员的id号设置为0,当id号为0时,拥有一切权限\r\n"); out.write("\t\t{\r\n"); out.write("\t\t\t$(\"li\").show();\r\n"); out.write("\t\t\t$(\"#otherreprimand\").remove();\r\n"); out.write("\t\t\t$(\"#driverreprimand\").remove();\r\n"); out.write("\t\t\t\r\n"); out.write("\t\t}\r\n"); out.write("\telse\r\n"); out.write("\t\t{\r\n"); out.write("\t\t$(\"li\").hide();\r\n"); out.write("\t\t$(\"#subMenu\").show();\r\n"); out.write("\t\t"); if (dwtype == 0) // 当登录的账号为交警部门时,默认的显示前台页面的8个模块对应的后台数据管理 { out.write("\r\n"); out.write("\t\t $(\"#firstpage\").show();\r\n"); out.write("\t\t\t$(\"#rulenmanage\").show();\r\n"); out.write("\t\t\t$(\"#edunmanage\").show();\r\n"); out.write("\t\t\t$(\"#baseinfo\").show();\r\n"); out.write("\t\t\t$(\"#policeorgmanage\").show();\r\n"); out.write("\t\t\t$(\"#companymanage\").show();\r\n"); out.write("\t\t\t$(\"#carmanage\").show();\r\n"); out.write("\t\t\t$(\"#drivermanage\").show();\r\n"); out.write("\t\t\t$(\"#rulenmanage\").show();\r\n"); out.write("\t\t\t$(\"#branchmanage\").show();\r\n"); out.write("\t\t\t$(\"#safenoticemanage\").show();\r\n"); out.write("\t\t\t$(\"#meetnoticemanage\").show();\r\n"); out.write("\t\t\t$(\"#interchangemanage\").show();\r\n"); out.write("\t\t\t$(\"#micromessagemanage\").show();\r\n"); out.write("\t\t\t$(\"#editpassword\").show();\r\n"); out.write("\t\t\t$(\"#reprimand\").show();\r\n"); out.write("\t\t\t$(\"#carlist\").show();\r\n"); out.write("\t"); } out.write("\r\n"); out.write("\t\r\n"); out.write("\t"); if (dwtype == 1) // 当登录的账号为货运部门时,默认显示货运公司对应的后台数据管理 { out.write("\r\n"); out.write("\t $(\"#firstpage\").show();\r\n"); out.write("\t\t$(\"#baseinfo\").show();\r\n"); out.write("\t\t$(\"#interchangemanage\").show();\r\n"); out.write("\t\t$(\"#editpassword\").show();\r\n"); out.write("\t\t$(\"#safelearn\").show();\r\n"); out.write("\t\t$(\"#otherreprimand\").show();\r\n"); out.write("\t\t$(\"#drivermanage\").show();\r\n"); out.write("\t\t$(\"#micromessagemanage\").show();\r\n"); out.write("\t\t$(\"#carmanage\").show();\r\n"); out.write("\t\t$(\"#companymanage\").show();\r\n"); } out.write("\r\n"); out.write("\r\n"); if (dwtype == 2) // 当登录的账号为货运部门的驾驶员时,默认显示货运公司驾驶员对应的后台数据管理 { out.write("\r\n"); out.write(" $(\"#firstpage\").show();\r\n"); out.write("\t$(\"#baseinfo\").show();\r\n"); out.write("\t$(\"#drivermanage\").show();\r\n"); out.write("\t$(\"#editpassword\").show();\r\n"); out.write("\t$(\"#interchangemanage\").show();\r\n"); out.write("\t$(\"#safelearn\").show();\r\n"); out.write("\t$(\"#micromessagemanage\").show();\r\n"); out.write("\t$(\"#driverreprimand\").show();\r\n"); } out.write("\r\n"); out.write("\t\t"); if (u != null) { String string = ""; for (int i = 0; i < list.size(); i++) { string = list.get(i); out.write("\r\n"); out.write("\t\t$(\"#"); out.print(string); out.write("\").show();\r\n"); out.write("\t\t"); } } out.write("\r\n"); out.write(" }\r\n"); out.write("}\r\n"); out.write("</script>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); out.write( "\t<table border=\"0\" width=\"100%\" height=\"100%\"style=\"margin: 0; padding: 0; background-color: #198bc9\">\r\n"); out.write("\t\t<tr>\r\n"); out.write("\t\t\t<td colspan=\"3\">\r\n"); out.write("\t\t\t\t<div id=\"header\">\r\n"); out.write( "\t\t\t\t<table border=\"0\" width=\"100%\" height=\"100%\" style=\"margin: 0; padding: 0;\">\r\n"); out.write("\t\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td width=\"50%\" style=\"text-align:left\">\r\n"); out.write("\t\t\t\t<div class=\"logo fleft\"> </div>\r\n"); out.write("\t\t\t\t</td>\r\n"); out.write("\t\t\t\t<td width=\"30%\"></td>\r\n"); out.write("\t\t\t\t<td width=\"20%\" style=\"text-align:right\">\r\n"); out.write("\t\t\t\t<div class=\"logoright fleft\" align=\"right\"> </div>\r\n"); out.write("\t\t\t\t</td>\r\n"); out.write("\t\t\t\t</tr>\r\n"); out.write("\t\t\t\t</table>\r\n"); out.write("\t\t\t\t\t</div>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t</tr>\r\n"); out.write("\t\t\r\n"); out.write("\t\t<tr>\r\n"); out.write("\t\t\t<td colspan=\"3\" align=\"left\">\r\n"); out.write("\t\t\t<div class=\"logofont\" style=\"margin-left:25px\">\r\n"); out.write( "\t\t\t<table border=\"0\" width=\"100%\" height=\"100%\" style=\"margin: 0; padding: 0;\">\r\n"); out.write("\t\t\t<tr><td align=\"left\">\r\n"); out.write("\t\t\t<font>用户:"); out.print(username); out.write(" 时间:"); out.print(date1); out.write(" "); out.print(week); out.write(" </font>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t\t<td align=\"right\">\r\n"); out.write( "\t\t\t<a href=\"loginout.action\"><font color=\"#FFFFF0\">退出 </font></a>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t\t</table>\r\n"); out.write("\t\t\t</div>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t</tr>\r\n"); out.write("\t\t\r\n"); out.write("\t\t<tr>\r\n"); out.write("\t\t\t<td width=\"168px\">\r\n"); out.write("\t\t\t\t<div class=\"menu fleft\">\r\n"); out.write("\t\t\t\t\t<ul>\r\n"); out.write("\t\t\t\t\t\t<li class=\"subMenuTitle\" id=\"subMenu\">机动车网安教后台管理</li>\r\n"); out.write("\t\t\t\t\t\t<li class=\"subMenu\" id=\"firstpage\">首页设置</li>\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"stationmanage\"><a href=\"#\">参数配置</a>\r\n"); out.write("\t\t\t\t\t\t\t<ul>\r\n"); out.write( "\t\t\t\t\t\t\t\t<li><a href=\"javascript:clickmenu('page/admin/page/config_viewConfigList.action')\">网站信息</a>\r\n"); out.write("\t\t\t\t\t\t\t\t</li>\r\n"); out.write("\t\t\t\t\t\t\t</ul></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"accountmanage\"><a href=\"#\">系统管理</a>\r\n"); out.write("\t\t\t\t\t\t\t<ul>\r\n"); out.write( "\t\t\t\t\t\t\t\t<li id=\"rolemanage\"><a href=\"javascript:clickmenu('page/admin/page/role_viewRoleList.action')\">角色管理</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t\t<li id=\"accountmanage\"><a href=\"javascript:clickmenu('page/admin/page/account_viewAccountList.action')\">账号管理</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t\t<li id=\"permisionmanage\"><a href=\"javascript:clickmenu('page/admin/page/permission_viewPermissionList.action')\">权限管理</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t\t<li id=\"areamanage\"><a href=\"javascript:clickmenu('page/admin/page/areaback_viewAreaList.action')\">地域管理</a></li>\r\n"); out.write("\t\t\t\t\t\t\t</ul>\r\n"); out.write("\t\t\t\t\t\t</li>\r\n"); out.write("\t\t\t\t\t\t\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"rulenmanage\"><a href=\"javascript:clickmenu('page/admin/page/ruleback_viewRuleList.action')\">交通法规</a></li>\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"edunmanage\"><a href=\"javascript:clickmenu('page/admin/page/eduback_viewEduList.action')\">宣教中心</a></li>\r\n"); out.write("\r\n"); out.write("\t\t\t\t\t <li class=\"subMenu\" id=\"baseinfo\"><a href=\"#\">基本信息</a>\r\n"); out.write("\t\t\t\t\t\t <ul>\r\n"); out.write( "\t\t\t\t\t\t <!-- <li id=\"policeorgmanage\"><a href=\"javascript:clickmenu('page/admin/page/orgback_viewPoliceOrgList.action')\">交警部门</a></li> -->\r\n"); out.write( "\t\t\t\t\t\t <li id=\"orgmanage\"><a href=\"javascript:clickmenu('page/admin/page/policeorgback_viewPoliceOrgList.action')\">交警部门</a></li>\r\n"); out.write( "\t\t\t\t\t\t <li class=\"subMenu\" id=\"carlist\"><a href=\"javascript:clickmenu('page/admin/page/policeback_viewPoliceList.action')\">交警信息</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t<li id=\"companymanage\"><a href=\"javascript:clickmenu('page/admin/page/companyback_viewCompanyList.action')\">企业安全组</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t<li id=\"carmanage\"><a href=\"javascript:clickmenu('page/admin/page/carback_viewCarList.action')\">车辆管理</a></li>\r\n"); out.write( "\t\t\t\t\t\t\t<li id=\"drivermanage\"><a href=\"javascript:clickmenu('page/admin/page/driverback_viewDriverList.action')\">驾驶员管理</a></li>\r\n"); out.write( "\t\t\t\t\t\t \t<li class=\"subMenu\" id=\"editpassword\"><a href=\"javascript:clickmenu('page/admin/page/account_viewPassword.action?id="); out.print(userid); out.write("')\">修改密码</a></li>\r\n"); out.write("\t\t\t\t\t\t </ul>\r\n"); out.write("\t\t\t\t\t </li>\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"rulenmanage\"><a href=\"javascript:clickmenu('page/admin/page/illegalback_viewIllegalList.action')\">违法查询</a></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"branchmanage\"><a href=\"javascript:clickmenu('page/admin/page/branchback_viewBranchList.action')\">快速处理点</a></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"safenoticemanage\"><a href=\"javascript:clickmenu('page/admin/page/safenoticeback_viewSafeNoticeList.action')\">安全提醒</a></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"meetnoticemanage\"><a href=\"javascript:clickmenu('page/admin/page/meetnoticeback_viewMeetNoticeList.action')\">会议通知</a></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"safelearn\"><a href=\"javascript:clickmenu('page/admin/page/safelearnback_viewEduList.action')\">安全教育学习</a></li>\r\n"); out.write("\t\t\t\t\t\t\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"reprimand\"><a href=\"javascript:clickmenu('page/admin/page/reprimandback_viewReprimandList.action')\">通报批评</a></li>\r\n"); out.write("\t\t\t\t\t\r\n"); out.write( "\t\t\t\t\t <li class=\"subMenu\" id=\"otherreprimand\"><a href=\"javascript:clickmenu('page/admin/page/otherreprimandback_viewReprimandList.action')\">通报批评</a></li>\r\n"); out.write("\t\t\t\t\t \r\n"); out.write( "\t\t\t\t\t <li class=\"subMenu\" id=\"driverreprimand\"><a href=\"javascript:clickmenu('page/admin/page/otherreprimandback_showDriverReprimand.action')\">通报批评</a></li>\r\n"); out.write("\t\t\t\t\t \r\n"); out.write( "\t\t\t\t\t <li class=\"subMenu\" id=\"interchangemanage\"><a href=\"javascript:clickmenu('page/admin/page/interchangeback_viewInterchangeList.action')\">问题答疑</a></li>\r\n"); out.write("\r\n"); out.write( "\t\t\t\t\t\t<li class=\"subMenu\" id=\"micromessagemanage\"><a href=\"javascript:clickmenu('page/admin/page/micromessage/micromessagelist.jsp')\">微博互动</a></li>\r\n"); out.write("\t\t\t\t\t\r\n"); out.write("\t\t\t\t\t</ul>\r\n"); out.write("\t\t\t\t\t\r\n"); out.write("\t\t\t\t</div>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t\t<td width=\"5px\">\r\n"); out.write("\t\t\t\t<div class=\"sidebar fleft\">\r\n"); out.write("\t\t\t\t\t<div class=\"btn\"></div>\r\n"); out.write("\t\t\t\t</div>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t\t<td class=\"page\"><iframe width=\"100%\" scrolling=\"auto\"\r\n"); out.write("\t\t\t\t\theight=\"100%\" FRAMEBORDER=0 style=\"border: medium none;\"\r\n"); out.write( "\t\t\t\t\tsrc=\"/TrafficPolice/page/admin/page/Startpage.jsp\" id=\"rightMain\"\r\n"); out.write("\t\t\t\t\tname=\"right\"></iframe>\r\n"); out.write("\t\t\t</td>\r\n"); out.write("\t\t</tr>\r\n"); out.write("\t\t<tr>\r\n"); out.write("\t\t\t<td colspan=\"3\"><div id=\"footer\"></div></td>\r\n"); out.write("\t\t</tr>\r\n"); out.write("\t</table>\r\n"); out.write("</body>\r\n"); out.write("\r\n"); out.write("</html>"); } catch (Throwable t) { if (!(t instanceof 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); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); PrintWriter out = response.getWriter(); ServletContext application; HttpSession session = request.getSession(); nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication); ValidataNumber validata = new ValidataNumber(); try { if (finance_db.conn((String) dbSession.getAttribute("unit_db_name"))) { String file_id = request.getParameter("file_id"); String balance_sum = request.getParameter("balance_sum"); String balance_sum1 = request.getParameter("balance_sum1"); if (validata.validata(balance_sum) && validata.validata(balance_sum1)) { String sql2 = "select id from finance_bill where tag='1' and file_id='" + file_id + "'"; ResultSet rs2 = finance_db.executeQuery(sql2); String sql = ""; if (rs2.next()) { sql = "update finance_bill set debit_subtotal='" + balance_sum1 + "' where tag='1' and file_id='" + file_id + "'"; } else { sql = "insert into finance_bill(debit_subtotal,file_id,tag) values('" + balance_sum1 + "','" + file_id + "','1')"; } finance_db.executeUpdate(sql); sql2 = "select id from finance_voucher where account_period='18' and chain_id='" + file_id + "'"; rs2 = finance_db.executeQuery(sql2); if (rs2.next()) { sql = "update finance_voucher set debit_subtotal='" + balance_sum + "' where account_period='18' and chain_id='" + file_id + "'"; } else { sql = "insert into finance_voucher(debit_subtotal,chain_id,account_period) values('" + balance_sum + "','" + file_id + "','18')"; } finance_db.executeUpdate(sql); finance_db.commit(); finance_db.close(); } else { out.println("1"); } } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
public Writer getErrorReport( Writer to, final HttpServletRequest request, CharTransformer escape) throws IOException { final Writer logMsg = new StringWriter(); final Writer tee = new org.mmbase.util.ChainedWriter(to, logMsg); Writer msg = tee; LinkedList<Throwable> stack = getStack(); String ticket = new Date().toString(); Map<String, String> props; try { props = org.mmbase.util.ApplicationContextReader.getProperties("mmbase_errorpage"); } catch (javax.naming.NamingException ne) { props = Collections.emptyMap(); log.info(ne); } if (request != null) { { msg.append("Headers\n----------\n"); // request properties for (Object name : Collections.list(request.getHeaderNames())) { msg.append( escape.transform( name + ": " + escape.transform(request.getHeader((String) name)) + "\n")); } } { msg.append("\nAttributes\n----------\n"); Pattern p = requestIgnore; if (p == null && props.get("request_ignore") != null) { p = Pattern.compile(props.get("request_ignore")); } for (Object name : Collections.list(request.getAttributeNames())) { if (p == null || !p.matcher((String) name).matches()) { msg.append( escape.transform(name + ": " + request.getAttribute((String) name) + "\n")); } } } if (Boolean.TRUE.equals(showSession) || (showSession == null && !"false".equals(props.get("show_session")))) { HttpSession ses = request.getSession(false); if (ses != null) { msg.append("\nSession\n----------\n"); Pattern p = sessionIgnore; if (p == null && props.get("session_ignore") != null) { p = Pattern.compile(props.get("session_ignore")); } for (Object name : Collections.list(ses.getAttributeNames())) { if (p == null || !p.matcher((String) name).matches()) { msg.append(escape.transform(name + ": " + ses.getAttribute((String) name) + "\n")); } } } } } msg.append("\n"); msg.append("Misc. properties\n----------\n"); if (request != null) { msg.append("method: ").append(escape.transform(request.getMethod())).append("\n"); msg.append("querystring: ").append(escape.transform(request.getQueryString())).append("\n"); msg.append("requesturl: ") .append(escape.transform(request.getRequestURL().toString())) .append("\n"); } if (Boolean.TRUE.equals(showMMBaseVersion) || (showMMBaseVersion == null && !"false".equals(props.get("show_mmbase_version")))) { msg.append("mmbase version: ").append(org.mmbase.Version.get()).append("\n"); } msg.append("status: ").append("").append(String.valueOf(status)).append("\n\n"); if (request != null) { msg.append("Parameters\n----------\n"); // request parameters Enumeration en = request.getParameterNames(); while (en.hasMoreElements()) { String name = (String) en.nextElement(); msg.append(name) .append(": ") .append(escape.transform(request.getParameter(name))) .append("\n"); } } msg.append("\nException ") .append(ticket) .append("\n----------\n\n") .append( exception != null ? (escape.transform(exception.getClass().getName())) : "NO EXCEPTION") .append(": "); int wroteCauses = 0; while (!stack.isEmpty()) { Throwable t = stack.removeFirst(); // add stack stacktraces if (t != null) { if (stack.isEmpty()) { // write last message always msg = tee; } String message = t.getMessage(); if (msg != tee) { to.append("\n=== skipped(see log) : ") .append(escape.transform(t.getClass().getName())) .append(": ") .append(message) .append("\n"); } msg.append("\n\n").append(escape.transform(t.getClass().getName() + ": " + message)); StackTraceElement[] stackTrace = t.getStackTrace(); for (StackTraceElement e : stackTrace) { msg.append("\n at ").append(escape.transform(e.toString())); } if (!stack.isEmpty()) { msg.append("\n-------caused:\n"); } wroteCauses++; if (wroteCauses >= MAX_CAUSES) { msg = logMsg; } } } // write errors to log if (status == 500) { try { if (props.get("to") != null && props.get("to").length() > 0) { javax.naming.Context initCtx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) initCtx.lookup("java:comp/env"); Object mailSession = envCtx.lookup("mail/Session"); Class sessionClass = Class.forName("javax.mail.Session"); Class recipientTypeClass = Class.forName("javax.mail.Message$RecipientType"); Class messageClass = Class.forName("javax.mail.internet.MimeMessage"); Object mail = messageClass.getConstructor(sessionClass).newInstance(mailSession); messageClass .getMethod("addRecipients", recipientTypeClass, String.class) .invoke(mail, recipientTypeClass.getDeclaredField("TO").get(null), props.get("to")); messageClass.getMethod("setSubject", String.class).invoke(mail, ticket); mail.getClass().getMethod("setText", String.class).invoke(mail, logMsg.toString()); Class.forName("javax.mail.Transport") .getMethod("send", Class.forName("javax.mail.Message")) .invoke(null, mail); tee.append("\nmailed to (").append(String.valueOf(props)).append(")"); } } catch (Exception nnfe) { tee.append("\nnot mailed (").append(String.valueOf(nnfe)).append(")"); if (log.isDebugEnabled()) { log.debug(nnfe.getMessage(), nnfe); } } log.error("TICKET " + ticket + ":\n" + logMsg); } return to; }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { HttpSession dbSession = request.getSession(); ServletContext dbApplication = dbSession.getServletContext(); nseer_db_backup1 design_db = new nseer_db_backup1(dbApplication); nseer_db_backup1 design_db1 = new nseer_db_backup1(dbApplication); ValidataNumber validata = new ValidataNumber(); ValidataTag vt = new ValidataTag(); counter count = new counter(dbApplication); if (design_db.conn((String) dbSession.getAttribute("unit_db_name")) && design_db1.conn((String) dbSession.getAttribute("unit_db_name"))) { String config_id = request.getParameter("config_id"); String product_ID = request.getParameter("product_ID"); String choice = request.getParameter("choice"); String checker_ID = request.getParameter("checker_ID"); String checker = request.getParameter("checker"); String check_time = request.getParameter("check_time"); String sql6 = "select id from design_workflow where type_id='02' and object_ID='" + product_ID + "' and ((check_tag='0' and config_id<'" + config_id + "') or (check_tag='1' and config_id='" + config_id + "'))"; ResultSet rs6 = design_db.executeQuery(sql6); if (!rs6.next() && vt.validata( (String) dbSession.getAttribute("unit_db_name"), "design_file", "product_ID", product_ID, "excel_tag") .equals("1")) { if (choice != null) { if (choice.equals("")) { String sql = "update design_file set price_change_tag='9' where product_ID='" + product_ID + "'"; design_db.executeUpdate(sql); sql = "delete from design_workflow where type_id='02' and object_ID='" + product_ID + "'"; design_db.executeUpdate(sql); } else { sql6 = "select id from design_workflow where type_id='02' and object_ID='" + product_ID + "' and config_id<'" + config_id + "' and config_id>='" + choice + "'"; rs6 = design_db.executeQuery(sql6); while (rs6.next()) { String sql = "update design_workflow set check_tag='0' where type_id='02' and id='" + rs6.getString("id") + "'"; design_db1.executeUpdate(sql); } } response.sendRedirect("design/price_change/check_delete_ok.jsp?finished_tag=0"); } else { response.sendRedirect("design/price_change/check_delete_ok.jsp?finished_tag=1"); } } else { response.sendRedirect("design/price_change/check_delete_ok.jsp?finished_tag=2"); } design_db.commit(); design_db1.commit(); design_db.close(); design_db1.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
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 \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\"> "); 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\"> "); 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); } }
public void getEnv(VariableTable vt) { Enumeration e = null; HttpServletRequest request = (HttpServletRequest) (pageContext.getRequest()); HttpSession session = request.getSession(false); String db_charset = "gb2312"; String url_charset = null; vt.remove("SESSION.LOGINID"); vt.remove("SESSION.LOGINNAME"); vt.remove("SESSION.LOGINROLE"); if (vt.exists("WEBCHART.DB_CHARSET")) { db_charset = vt.getString("WEBCHART.DB_CHARSET"); } if (vt.exists("WEBCHART.URL_CHARSET")) { url_charset = vt.getString("WEBCHART.URL_CHARSET"); } if (session != null) { e = session.getAttributeNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); Object value = session.getAttribute(name); vt.add(name, java.sql.Types.VARCHAR); if (value != null) vt.setValue(name, value.toString()); } vt.add("SESSION.ID", java.sql.Types.VARCHAR); vt.setValue("SESSION.ID", session.getId()); vt.add("SESSION.CREATE", java.sql.Types.VARCHAR); vt.setValue( "SESSION.CREATE", DBOperation.toString( new java.util.Date(session.getCreationTime()), "yyyy-MM-dd HH:mm:ss")); vt.add("SESSION.ACCESS", java.sql.Types.VARCHAR); vt.setValue( "SESSION.ACCESS", DBOperation.toString( new java.util.Date(session.getLastAccessedTime()), "yyyy-MM-dd HH:mm:ss")); } e = request.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = request.getParameter(name); ; String par_values[] = request.getParameterValues(name); name = name.toUpperCase(); if (name.equalsIgnoreCase("WEBCHART.SECURITY") || name.equalsIgnoreCase("WEBCHART.DEFAULTACCESS") || name.equalsIgnoreCase("WEBCHART.ALLOW") || name.equalsIgnoreCase("WEBCHART.DENY") || name.equalsIgnoreCase("WEBCHART.IPSECURITY") || name.equalsIgnoreCase("WEBCHART.IPACCESS") || name.equalsIgnoreCase("WEBCHART.IPALLOW") || name.equalsIgnoreCase("WEBCHART.IPDENY") || name.equalsIgnoreCase("WEBCHART.XSLDOC") || name.equalsIgnoreCase("WEBCHART.IMAGEONLY") || name.equalsIgnoreCase("WEBCHART.XMLDATA") || name.equalsIgnoreCase("WEBCHART.LOGSQL") || name.equalsIgnoreCase("WEBCHART.DATATYPE") || name.equalsIgnoreCase("WEBCHART.URLS") || name.equalsIgnoreCase("WEBCHART.TOPURLS") || name.equalsIgnoreCase("WEBCHART.TOPCURR") || name.equalsIgnoreCase("WEBCHART.LEFTURLS") || name.equalsIgnoreCase("WEBCHART.LEFTCURR") || name.equalsIgnoreCase("WEBCHART.INPUTS") || name.equalsIgnoreCase("WEBCHART.CACHE") || name.equalsIgnoreCase("WEBCHART.DATA") || name.equalsIgnoreCase("WEBCHART.CSS") || name.equalsIgnoreCase("WEBCHART.RELOAD") || name.equalsIgnoreCase("WEBCHART.EXPIRE") || name.equalsIgnoreCase("WEBCHART.DMLKEY") || name.equalsIgnoreCase("WEBCHART.ENGINE") || name.equalsIgnoreCase("WEBCHART.EXCELURL") || name.equalsIgnoreCase("WEBCHART.DBID") || name.equalsIgnoreCase("WEBCHART.DBIDSEED") || name.equalsIgnoreCase("WEBCHART.SECUREFIELDS") || name.equalsIgnoreCase("WEBCHART.KEEP_CACHE_IMAGE") || name.equalsIgnoreCase("WEBCHART.KEEP_CACHE_TIME") || name.startsWith("WEBCHART.SECUREMEMO") || name.startsWith("WEBCHART.QUERY_") || name.startsWith("WEBCHART.HEADHTML_") || name.startsWith("WEBCHART.DATAHTML_") || name.startsWith("WEBCHART.VARLIST_") || name.startsWith("WEBCHART.FORALL_") || name.startsWith("WEBCHART.XMLDATA_") || name.startsWith("WEBCHART.TABLE_") || name.startsWith("WEBCHART.COLUMN_") || name.startsWith("SESSION.")) continue; if (name.startsWith("WEBCHART.") && !name.equals("WEBCHART.DOCTYPE")) continue; vt.add(name, java.sql.Types.VARCHAR); if (par_values != null && par_values.length > 1) { StringBuffer temp = new StringBuffer(); for (int i = 0; i < par_values.length; i++) { if (par_values[i] != null && par_values[i].trim().length() > 0) { if (temp.length() > 0) { temp.append(","); } temp.append(par_values[i]); } } value = temp.toString(); } if (url_charset != null) { try { value = new String(value.getBytes(url_charset), db_charset); } catch (java.io.UnsupportedEncodingException uee) { } ; } vt.setValue(name, value); } vt.add("REQUEST.REMOTEADDR", java.sql.Types.VARCHAR); vt.setValue("REQUEST.REMOTEADDR", getClientIPAddr()); vt.add("REQUEST.REMOTEHOST", java.sql.Types.VARCHAR); vt.setValue("REQUEST.REMOTEHOST", request.getRemoteAddr()); vt.add("REQUEST.REFERER", java.sql.Types.VARCHAR); vt.setValue("REQUEST.REFERER", request.getHeader("Referer")); vt.add("REQUEST.QUERYSTRING", java.sql.Types.VARCHAR); vt.setValue("REQUEST.QUERYSTRING", request.getQueryString()); }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { HttpSession session = request.getSession(); PrintWriter out = response.getWriter(); nseer_db_backup1 fund_db = new nseer_db_backup1(dbApplication); nseer_db_backup1 fund_db1 = new nseer_db_backup1(dbApplication); if (fund_db.conn((String) dbSession.getAttribute("unit_db_name")) && fund_db1.conn((String) dbSession.getAttribute("unit_db_name"))) { counter count = new counter(dbApplication); ValidataRecordNumber vrn = new ValidataRecordNumber(); ValidataTag vt = new ValidataTag(); ValidataNumber validata = new ValidataNumber(); try { String time = ""; java.util.Date now = new java.util.Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); time = formatter.format(now); String apply_pay_ID = request.getParameter("apply_pay_ID"); String register_time = request.getParameter("register_time"); String register = request.getParameter("register"); String register_ID = request.getParameter("register_ID"); String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"), "UTF-8"); String remark = exchange.toHtml(bodyc); String amount = request.getParameter("amount"); String[] file_kind = request.getParameterValues("file_kind"); String[] cost_price_subtotal = request.getParameterValues("cost_price_subtotal"); int p = 0; String file_kinda = ","; for (int j = 1; j < file_kind.length; j++) { file_kinda += file_kind[j] + ","; if (cost_price_subtotal[j].equals("")) cost_price_subtotal[j] = "0"; StringTokenizer tokenTO4 = new StringTokenizer(cost_price_subtotal[j], ","); String cost_price_subtotal1 = ""; while (tokenTO4.hasMoreTokens()) { cost_price_subtotal1 += tokenTO4.nextToken(); } if (!validata.validata(cost_price_subtotal1)) { p++; } } int n = 0; for (int i = 1; i <= Integer.parseInt(amount); i++) { String tem_file_kind = "file_kind" + i; String file_kind2 = request.getParameter(tem_file_kind); if (file_kinda.indexOf(file_kind2) != -1) n++; } if (n == 0) { if (p == 0) { if (vt.validata( (String) dbSession.getAttribute("unit_db_name"), "fund_apply_pay", "apply_pay_ID", apply_pay_ID, "check_tag") .equals("5") || vt.validata( (String) dbSession.getAttribute("unit_db_name"), "fund_apply_pay", "apply_pay_ID", apply_pay_ID, "check_tag") .equals("9")) { String currency_name = ""; String personal_unit = ""; String chain_ID = ""; String chain_name = ""; String funder = ""; String funder_ID = ""; String sql11 = "select * from fund_apply_pay where apply_pay_ID='" + apply_pay_ID + "'"; ResultSet rs11 = fund_db.executeQuery(sql11); while (rs11.next()) { chain_ID = rs11.getString("chain_ID"); chain_name = rs11.getString("chain_name"); funder = rs11.getString("human_name"); funder_ID = rs11.getString("human_ID"); currency_name = rs11.getString("currency_name"); personal_unit = rs11.getString("personal_unit"); } int expenses_amount = 0; String sql6 = "select count(*) from fund_apply_pay_details where apply_pay_ID='" + apply_pay_ID + "'"; ResultSet rs6 = fund_db.executeQuery(sql6); if (rs6.next()) { expenses_amount = rs6.getInt("count(*)"); } double demand_cost_price_sum = 0.0d; for (int i = 1; i <= expenses_amount; i++) { String tem_cost_price_subtotal = "cost_price_subtotal" + i; String cost_price_subtotal2 = request.getParameter(tem_cost_price_subtotal); demand_cost_price_sum += Double.parseDouble(cost_price_subtotal2); sql6 = "update fund_apply_pay_details set cost_price_subtotal='" + cost_price_subtotal2 + "' where apply_pay_ID='" + apply_pay_ID + "' and details_number='" + i + "'"; fund_db.executeUpdate(sql6); } for (int i = 1; i < file_kind.length; i++) { StringTokenizer tokenTO1 = new StringTokenizer(file_kind[i], "/"); String file_chain_ID = ""; String file_chain_name = ""; while (tokenTO1.hasMoreTokens()) { file_chain_ID = tokenTO1.nextToken(); file_chain_name = tokenTO1.nextToken(); } StringTokenizer tokenTO4 = new StringTokenizer(cost_price_subtotal[i], ","); String cost_price_subtotal1 = ""; while (tokenTO4.hasMoreTokens()) { cost_price_subtotal1 += tokenTO4.nextToken(); } demand_cost_price_sum += Double.parseDouble(cost_price_subtotal1); expenses_amount++; String sql1 = "insert into fund_apply_pay_details(apply_pay_ID,details_number,file_chain_ID,file_chain_name,cost_price_subtotal) values ('" + apply_pay_ID + "','" + expenses_amount + "','" + file_chain_ID + "','" + file_chain_name + "','" + cost_price_subtotal1 + "')"; fund_db.executeUpdate(sql1); } String sql = "update fund_apply_pay set demand_cost_price_sum='" + demand_cost_price_sum + "',check_tag='2',register_time='" + register_time + "',register='" + register + "',remark='" + remark + "' where apply_pay_ID='" + apply_pay_ID + "'"; fund_db.executeUpdate(sql); response.sendRedirect("draft/fund/applyPayExpenses_ok.jsp?finished_tag=2"); } else { response.sendRedirect("draft/fund/applyPayExpenses_ok.jsp?finished_tag=3"); } } else { response.sendRedirect("draft/fund/applyPayExpenses_ok.jsp?finished_tag=6"); } } else { response.sendRedirect("draft/fund/applyPayExpenses_ok.jsp?finished_tag=7"); } } catch (Exception ex) { ex.printStackTrace(); } fund_db.commit(); fund_db1.commit(); fund_db.close(); fund_db1.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
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=utf-8"); pageContext = _jspxFactory.getPageContext( this, request, response, "/jsp/GeneralError.jsp", 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\n"); out.write("\n"); out.write("\n\n"); out.write("\n"); java.util.Date now = null; synchronized (pageContext) { now = (java.util.Date) pageContext.getAttribute("now", PageContext.PAGE_SCOPE); if (now == null) { try { now = (java.util.Date) java.beans.Beans.instantiate( this.getClass().getClassLoader(), "java.util.Date"); } catch (ClassNotFoundException exc) { throw new InstantiationException(exc.getMessage()); } catch (Exception exc) { throw new ServletException("Cannot create bean of class " + "java.util.Date", exc); } pageContext.setAttribute("now", now, PageContext.PAGE_SCOPE); } } out.write("\n\n"); out.write("\n"); out.write("<script type=\"text/javascript\" src=\""); if (_jspx_meth_c_url_0(pageContext)) return; out.write("\">"); out.write("</script>\n\n"); out.write("\n"); if (_jspx_meth_html_xhtml_0(pageContext)) return; out.write("\n"); out.write("\n\n"); out.write("\n"); out.write("\n"); out.write("\n\n\n\n"); out.write("<html>\n"); out.write("<head>\n "); out.write("<title>WebTelemetry - Admin Settings | System Management | License Management"); out.write("</title>\n "); out.write("<base HREF=\""); out.print(org.opennms.web.Util.calculateUrlBase(request)); out.write("\" />\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"); out.write("</HEAD>\n\n"); out.write("<SCRIPT LANGUAGE=JAVASCRIPT>\nfunction checkError()\n{\n\t"); if (request.getSession().getAttribute("thErrorMsg") != null) { out.write("\n\talert(\""); out.print(request.getSession().getAttribute("thErrorMsg")); out.write("\");\n "); request.getSession().removeAttribute("thErrorMsg"); out.write("\n\t"); } out.write("\n\t"); if (request.getAttribute("thErrorMsg") != null) { out.write("\n\talert(\""); out.print(request.getAttribute("thErrorMsg")); out.write("\");\n "); request.removeAttribute("thErrorMsg"); out.write("\n\t"); } out.write("\n}\n"); out.write("</SCRIPT>\n"); out.write("<body onload=\"checkError();\">\n"); /* ---- c:import ---- */ org.apache.taglibs.standard.tag.el.core.ImportTag _jspx_th_c_import_0 = (org.apache.taglibs.standard.tag.el.core.ImportTag) _jspx_tagPool_c_import_url_context.get( org.apache.taglibs.standard.tag.el.core.ImportTag.class); _jspx_th_c_import_0.setPageContext(pageContext); _jspx_th_c_import_0.setParent(null); _jspx_th_c_import_0.setContext("/wt-monitor"); _jspx_th_c_import_0.setUrl("/includes/header.jsp"); int[] _jspx_push_body_count_c_import_0 = new int[] {0}; try { int _jspx_eval_c_import_0 = _jspx_th_c_import_0.doStartTag(); if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) { javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody(); _jspx_push_body_count_c_import_0[0]++; out = _bc; _jspx_th_c_import_0.setBodyContent(_bc); _jspx_th_c_import_0.doInitBody(); } do { out.write("\n "); if (_jspx_meth_c_param_0( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\n "); if (_jspx_meth_c_param_1( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\n "); if (_jspx_meth_c_param_2( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\n"); int evalDoAfterBody = _jspx_th_c_import_0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) out = pageContext.popBody(); _jspx_push_body_count_c_import_0[0]--; } if (_jspx_th_c_import_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return; } catch (Throwable _jspx_exception) { while (_jspx_push_body_count_c_import_0[0]-- > 0) out = pageContext.popBody(); _jspx_th_c_import_0.doCatch(_jspx_exception); } finally { _jspx_th_c_import_0.doFinally(); _jspx_tagPool_c_import_url_context.reuse(_jspx_th_c_import_0); } out.write("\n\n"); String errorMsg = (String) request.getAttribute("error"); if (errorMsg != null && !errorMsg.equals("")) { out.write("\n\n"); out.write("<table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\">Internal Error"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"error\" >\n "); out.write("<td class=\"error\">"); out.write("<br>"); out.print(errorMsg); out.write("\n "); out.write("<br />"); out.write("<br />"); out.write("<a href=\"mailto:[email protected]\">[email protected]"); out.write("</a>"); out.write("<br /> "); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); } out.write("\n\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 LLC\">"); out.write("</td>\n\t\t"); out.write("<td>\n"); out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n\n"); LicenseManager lim = (LicenseManager) request.getAttribute("licenseManager"); boolean valid = false; boolean bIsAdmin = ((Boolean) request.getAttribute("bIsAdmin")).booleanValue(); if (lim == null) { out.write("\n "); out.write("<p class=\"error\">License File not found!\n "); if (bIsAdmin) { out.write("\n Please install a license file to run WebTelemetry.\n "); } else { out.write( "\n Please contact your System Administrator to rectify this problem.\n "); } out.write("\n "); out.write("</p>\n"); } else { if (!lim.isSigValid()) { out.write("<p class=\"error\">License File corrupted!\n "); if (bIsAdmin) { out.write( "\n Please install a new license file to run WebTelemetry.\n "); } else { out.write( "\n Please contact your System Administrator to rectify this problem.\n "); } out.write("\n "); out.write("</p>"); } else if (lim.daysLeft() == 0) { out.write("<p class=\"error\">License File expired!\n\t "); if (bIsAdmin) { out.write( "\n\t Please install a license file to run WebTelemetry.\n\t "); } else { out.write( "\n\t Please contact your System Administrator to rectify this problem.\n\t "); } out.write("\n "); out.write("</p>"); } else { valid = true; } } out.write("\n"); out.write("<table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"); if (bIsAdmin) { out.write("\n "); out.write("<tr>\n\t\t"); if (lim != null) { out.write("\n\t\t"); out.write("<td colspan=\"2\" align=\"right\" valign=\"top\">\n\t\t"); } else { out.write("\n\t\t"); out.write("<td colspan=\"2\" align=\"left\" valign=\"top\">"); out.write("<br>\n\t\t"); } out.write("\n\t\t"); out.write("<a href=\"/wt-core/license/manager.do?currentCommand="); out.print(WTLicenseForm.LICENSE_UPLOAD); out.write("\">"); out.write( "<img src=\"/wt-portal/images/buttons/btn_install_license.gif\" border=\"0\" alt=\"Install a New License\" vspace=\"4\">"); out.write("</a>\n "); out.write("<a class=\"tt\" href=\"javascript:towerTip("); out.print(WTTips.TIP_LICENSE_UPLOAD); out.write(");\" title=\"Telemetry Tip\">"); out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">"); out.write("</a>\n \n\t\t"); out.write("\n"); out.write("</td>"); out.write("</tr>\n"); } out.write("\n "); out.write("<tr>\n "); out.write("<td colspan=\"2\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry LLC\">"); out.write("</td>\n "); out.write("</tr>\n\n"); if (lim != null) { String licStatus = valid ? "<span class='success'>Valid</span>" : "<span class='error'>Invalid</span>"; String exp = lim.getFeature(License.WT_EXPIRATION_FIELD_NAME); int trCount = -1; out.write("\n\t "); out.write("<tr class=\"tableHeader\">\n\t "); out.write("<td class=\"tableHeader\" width=\"70%\">Attribute"); out.write("<a class=\"tt\" href=\"javascript: towerTip("); out.print(WTTips.TIP_LICENSE_ATTRIBUTES); 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\t "); out.write("<td class=\"tableHeader\" width=\"30%\">Value"); out.write("</td>\n\t "); out.write("</tr>\n\n "); String trColor = (++trCount % 2 == 0) ? "tableRowLight" : "tableRowDark"; out.write("\n\t "); out.write("<tr class=\""); out.print(trColor); out.write("\">\n\t "); out.write("<td class=\"tableText\">Support License"); out.write("</td>\n\t "); out.write("<td class=\"tableText\">"); out.print(licStatus); out.write("</td>\n\t "); out.write("</tr>\n\n "); trColor = (++trCount % 2 == 0) ? "tableRowLight" : "tableRowDark"; out.write("\n\t "); out.write("<tr class=\""); out.print(trColor); out.write("\">\n\t "); out.write("<td class=\"tableText\">Support Licensor"); out.write("</td>\n"); out.write("<!-- \n\t "); out.write("<td class=\"tableText\">"); out.print(lim.getFeature(License.WT_LICENSOR_FIELD_NAME)); out.write("</td>\n\t\t-->\n\t\t "); out.write("<td class=\"tableText\">WebTelemetry LLC"); out.write("</td>\n\t "); out.write("</tr>\n\n "); trColor = (++trCount % 2 == 0) ? "tableRowLight" : "tableRowDark"; out.write("\n\t "); out.write("<tr class=\""); out.print(trColor); out.write("\">\n\t "); out.write("<td class=\"tableText\">Support Licensee"); out.write("</td>\n\n"); out.write("<!--\n\t "); out.write("<td class=\"tableText\">"); out.print(lim.getFeature(License.WT_LICENSEE_FIELD_NAME)); out.write("</td>\n-->\n\t\t "); out.write("<td class=\"tableText\">WebTelemetry LLC"); out.write("</td>\n\n\t "); out.write("</tr>\n\n\n"); out.write("\n\n "); trColor = (++trCount % 2 == 0) ? "tableRowLight" : "tableRowDark"; out.write("\n\t "); out.write("<tr class=\""); out.print(trColor); out.write("\">\n\t "); out.write("<td class=\"tableText\">Discovery Engine"); out.write("</td>\n\t "); String safariStatus = (Integer.parseInt(lim.getFeature(License.WT_SAFARI_MASTER_ACCOUNT_ID_FIELD_NAME)) > 0 && Integer.parseInt(lim.getFeature(License.WT_SAFARI_USER_COUNT_FIELD_NAME)) > 0) ? "Enabled" : "Disabled"; if (!"Disabled".equals(safariStatus)) { int safariDaysLeft = lim.daysLeft(License.WT_SAFARI_EXPIRATION_FIELD_NAME); if (safariDaysLeft == 0) safariStatus = "Expired"; } out.write("\n\t "); out.write("<td class=\"tableText\">"); out.print(safariStatus); out.write("</td>\n\t "); out.write("</tr>\n\n\t "); if (!"Disabled".equals(safariStatus)) { out.write("\n "); trColor = (++trCount % 2 == 0) ? "tableRowLight" : "tableRowDark"; out.write("\n\t\t "); out.write("<tr class=\""); out.print(trColor); out.write("\">\n\t\t "); out.write("<td class=\"tableText\">Smart Discovery Expiration Date"); out.write("</td>\n\t\t "); out.write("<td class=\"tableText\">"); out.print(lim.getFeature(License.WT_SAFARI_EXPIRATION_FIELD_NAME)); out.write("\n\t\t "); out.write("</tr>\n\t "); } out.write(" \n"); } out.write("\n"); out.write("</table>\n\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("<br>\n\n"); JspRuntimeLibrary.include( request, response, "../includes/footer.jsp" + "?" + "location=" + "admin" + "&" + "help=" + "WTHelp_License.html", out, false); out.write("\n\n "); out.write("</BODY>\n "); out.write("<!-- end list-organiztion.jsp -->\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); } }
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { PrintWriter out = response.getWriter(); session = request.getSession(); counter count = new counter(dbApplication); ValidataNumber validata = new ValidataNumber(); ValidataRecord vr = new ValidataRecord(); ValidataTag vt = new ValidataTag(); getNameFromID getNameFromID = new getNameFromID(); getRateFromID getRateFromID = new getRateFromID(); nseer_db_backup1 purchase_db = new nseer_db_backup1(dbApplication); if (purchase_db.conn((String) dbSession.getAttribute("unit_db_name"))) { String register_ID = (String) session.getAttribute("human_IDD"); String config_id = request.getParameter("config_id"); String discussion_ID = request.getParameter("discussion_ID"); String provider_ID = request.getParameter("provider_ID"); String provider_name = request.getParameter("provider_name"); String demand_contact_person = request.getParameter("demand_contact_person"); String demand_contact_person_tel = request.getParameter("demand_contact_person_tel"); String demand_contact_person_fax = request.getParameter("demand_contact_person_fax"); String demand_pay_time = request.getParameter("demand_pay_time"); String check_time = request.getParameter("check_time"); String checker = request.getParameter("checker"); String checker_ID = request.getParameter("checker_ID"); String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"), "UTF-8"); String remark = exchange.toHtml(bodyc); String modify_tag = request.getParameter("modify_tag"); String product_amount = request.getParameter("product_amount"); int num = Integer.parseInt(product_amount); int n = 0; for (int i = 1; i <= num; i++) { String tem_amount = "amount" + i; String tem_off_discount = "off_discount" + i; String tem_list_price = "list_price" + i; String amount = request.getParameter(tem_amount); String off_discount = request.getParameter(tem_off_discount); String list_price2 = request.getParameter(tem_list_price); StringTokenizer tokenTO2 = new StringTokenizer(list_price2, ","); String list_price = ""; while (tokenTO2.hasMoreTokens()) { String list_price1 = tokenTO2.nextToken(); list_price += list_price1; } if (!validata.validata(amount) || !validata.validata(off_discount) || !validata.validata(list_price)) { n++; } } String sql6 = "select id from purchase_workflow where object_ID='" + discussion_ID + "' and ((check_tag='0' and config_id<'" + config_id + "') or (check_tag='1' and config_id='" + config_id + "'))"; ResultSet rs6 = purchase_db.executeQuery(sql6); if (!rs6.next()) { if (vt.validata( (String) dbSession.getAttribute("unit_db_name"), "purchase_discussion", "discussion_ID", discussion_ID, "check_tag") .equals("0")) { if (n == 0) { String time = ""; java.util.Date now = new java.util.Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); time = formatter.format(now); String sql = "update purchase_discussion set discussion_ID='" + discussion_ID + "',provider_ID='" + provider_ID + "',provider_name='" + provider_name + "',demand_contact_person='" + demand_contact_person + "',demand_contact_person_tel='" + demand_contact_person_tel + "',demand_contact_person_fax='" + demand_contact_person_fax + "',check_time='" + check_time + "',checker='" + checker + "',checker_ID='" + checker_ID + "',remark='" + remark + "' where discussion_ID='" + discussion_ID + "'"; purchase_db.executeUpdate(sql); try { int service_count = 0; int stock_number = 0; int pay_amount_sum = 0; double sale_price_sum = 0.0d; double cost_price_sum = 0.0d; double real_cost_price_sum = 0.0d; for (int i = 1; i <= num; i++) { String tem_product_name = "product_name" + i; String tem_product_ID = "product_ID" + i; String tem_product_describe = "product_describe" + i; String tem_amount = "amount" + i; String tem_off_discount = "off_discount" + i; String tem_list_price = "list_price" + i; String tem_cost_price = "cost_price" + i; String tem_real_cost_price = "real_cost_price" + i; String tem_amount_unit = "amount_unit" + i; String product_name = request.getParameter(tem_product_name); String product_ID = request.getParameter(tem_product_ID); String product_describe = request.getParameter(tem_product_describe); String amount1 = request.getParameter(tem_amount); String off_discount = request.getParameter(tem_off_discount); String list_price2 = request.getParameter(tem_list_price); StringTokenizer tokenTO2 = new StringTokenizer(list_price2, ","); String list_price = ""; while (tokenTO2.hasMoreTokens()) { String list_price1 = tokenTO2.nextToken(); list_price += list_price1; } String cost_price2 = request.getParameter(tem_cost_price); StringTokenizer tokenTO3 = new StringTokenizer(cost_price2, ","); String cost_price = ""; while (tokenTO3.hasMoreTokens()) { String cost_price1 = tokenTO3.nextToken(); cost_price += cost_price1; } String real_cost_price2 = request.getParameter(tem_real_cost_price); StringTokenizer tokenTO4 = new StringTokenizer(real_cost_price2, ","); String real_cost_price = ""; while (tokenTO4.hasMoreTokens()) { String real_cost_price1 = tokenTO4.nextToken(); real_cost_price += real_cost_price1; } String amount_unit = request.getParameter(tem_amount_unit); double amount = 0.0d; double subtotal = Double.parseDouble(list_price) * (1 - Double.parseDouble(off_discount) / 100) * Double.parseDouble(amount1); double cost_price_after_discount_sum = Double.parseDouble(cost_price) * Double.parseDouble(amount1); double real_cost_price_after_discount_sum = Double.parseDouble(real_cost_price) * Double.parseDouble(amount1); sale_price_sum += subtotal; cost_price_sum += cost_price_after_discount_sum; real_cost_price_sum += real_cost_price_after_discount_sum; double order_sale_bonus_subtotal = getRateFromID.getRateFromID( (String) dbSession.getAttribute("unit_db_name"), "design_file", "product_ID", product_ID, "order_sale_bonus_rate") * subtotal / 100; double order_profit_bonus_subtotal = 0.0d; String sql1 = "update purchase_discussion_details set product_ID='" + product_ID + "',product_name='" + product_name + "',product_describe='" + product_describe + "',list_price='" + list_price + "',amount='" + amount1 + "',cost_price='" + cost_price + "',off_discount='" + off_discount + "',subtotal='" + subtotal + "' where discussion_ID='" + discussion_ID + "' and details_number='" + i + "'"; purchase_db.executeUpdate(sql1); String product_type = ""; String sql16 = "select * from design_file where product_ID='" + product_ID + "'"; ResultSet rs16 = purchase_db.executeQuery(sql16); if (rs16.next()) { product_type = rs16.getString("type"); } if (product_type.equals("物料") || product_type.equals("外购商品")) { stock_number += 1; } else if (product_type.equals("商品") || product_type.equals("部件") || product_type.equals("委外部件")) { stock_number += 1; } else if (product_type.equals("服务型产品")) { service_count++; } } String sql2 = "update purchase_workflow set checker='" + checker + "',checker_ID='" + checker_ID + "',check_time='" + check_time + "',check_tag='1' where object_ID='" + discussion_ID + "' and config_id='" + config_id + "'"; purchase_db.executeUpdate(sql2); sql2 = "select id from purchase_workflow where object_ID='" + discussion_ID + "' and check_tag='0'"; ResultSet rset = purchase_db.executeQuery(sql2); if (!rset.next()) { sql2 = "update purchase_discussion set sale_price_sum='" + sale_price_sum + "',cost_price_sum='" + cost_price_sum + "',modify_tag='0',discussion_tag='1',discussion_status='等待',check_tag='1' where discussion_ID='" + discussion_ID + "'"; purchase_db.executeUpdate(sql2); } else { sql2 = "update purchase_discussion set sale_price_sum='" + sale_price_sum + "',cost_price_sum='" + cost_price_sum + "',modify_tag='0' where discussion_ID='" + discussion_ID + "'"; purchase_db.executeUpdate(sql2); } } catch (Exception ex) { ex.printStackTrace(); } response.sendRedirect( "purchase/discussion/check_choose_attachment.jsp?discussion_ID=" + discussion_ID + ""); } else { response.sendRedirect("purchase/discussion/check_ok.jsp?finished_tag=0"); } } else { response.sendRedirect("purchase/discussion/check_ok.jsp?finished_tag=1"); } } else { response.sendRedirect("purchase/discussion/check_ok.jsp?finished_tag=2"); } purchase_db.commit(); purchase_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
public synchronized void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { PrintWriter out = response.getWriter(); nseer_db_backup1 stock_db = new nseer_db_backup1(dbApplication); nseer_db_backup1 crm_db = new nseer_db_backup1(dbApplication); if (stock_db.conn((String) dbSession.getAttribute("unit_db_name")) && crm_db.conn((String) dbSession.getAttribute("unit_db_name"))) { FileKind FileKind = new FileKind(); ValidataNumber validata = new ValidataNumber(); ValidataRecord vr = new ValidataRecord(); counter count = new counter(dbApplication); ValidataTag vt = new ValidataTag(); String register_ID = (String) dbSession.getAttribute("human_IDD"); String config_id = request.getParameter("config_id"); String pay_ID = request.getParameter("pay_ID"); String product_amount = request.getParameter("product_amount"); int num = Integer.parseInt(product_amount); String payer_name = request.getParameter("payer_name"); String payer_ID = request.getParameter("payer_ID"); String reason = request.getParameter("reason"); String not_return_tag = request.getParameter("not_return_tag"); String register = request.getParameter("register"); String register_time = request.getParameter("register_time"); String demand_return_time = request.getParameter("demand_return_time"); String sales_name = request.getParameter("sales_name"); String sales_ID = request.getParameter("sales_ID"); String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"), "UTF-8"); String remark = exchange.toHtml(bodyc); String time = ""; java.util.Date now = new java.util.Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); time = formatter.format(now); String[] product_IDn = request.getParameterValues("product_ID"); String[] amountn = request.getParameterValues("amount"); if (num == 0 && product_IDn.length == 1) { response.sendRedirect("draft/crm/credit_ok_a.jsp?pay_ID=" + pay_ID); } else { int p = 0; for (int i = 1; i <= num; i++) { String tem_amount = "amount" + i; String amount = request.getParameter(tem_amount); if (amount.equals("")) amount = "0"; if (!validata.validata(amount)) { p++; } } int n = 0; String product_ID_group = ""; for (int j = 1; j < product_IDn.length; j++) { product_ID_group += product_IDn[j] + ","; if (amountn[j].equals("")) amountn[j] = "0"; if (!validata.validata(amountn[j])) { p++; } } for (int i = 1; i <= num; i++) { String tem_product_ID = "product_ID" + i; String product_ID = request.getParameter(tem_product_ID); if (product_ID_group.indexOf(product_ID) != -1) n++; } if (vt.validata( (String) dbSession.getAttribute("unit_db_name"), "stock_apply_pay", "pay_ID", pay_ID, "check_tag") .equals("9") || vt.validata( (String) dbSession.getAttribute("unit_db_name"), "stock_apply_pay", "pay_ID", pay_ID, "check_tag") .equals("5")) { if (p == 0) { try { if (n == 0) { boolean flag = false; List rsList = GetWorkflow.getList(crm_db, "crm_config_workflow", "05"); String[] elem = new String[3]; if (rsList.size() == 0) { flag = true; } String sqll = ""; String[] aaa1 = FileKind.getKind( (String) dbSession.getAttribute("unit_db_name"), "crm_file", "customer_ID", payer_ID); String stock_pay_ID = NseerId.getId("stock/pay", (String) dbSession.getAttribute("unit_db_name")); double demand_amount = 0.0d; double list_price_sum = 0.0d; double cost_price_sum = 0.0d; for (int i = 1; i <= num; i++) { String tem_product_name = "product_name" + i; String tem_product_ID = "product_ID" + i; String tem_available_amount = "available_amount" + i; String tem_amount = "amount" + i; String tem_list_price = "list_price" + i; String tem_cost_price = "cost_price" + i; String tem_type = "type" + i; String tem_amount_unit = "amount_unit" + i; String product_name = request.getParameter(tem_product_name); String product_ID = request.getParameter(tem_product_ID); String available_amount = request.getParameter(tem_available_amount); String amount = request.getParameter(tem_amount); if (amount.equals("")) amount = "0"; String list_price2 = request.getParameter(tem_list_price); String cost_price = request.getParameter(tem_cost_price); String type = request.getParameter(tem_type); StringTokenizer tokenTO3 = new StringTokenizer(list_price2, ","); String list_price = ""; while (tokenTO3.hasMoreTokens()) { String list_price1 = tokenTO3.nextToken(); list_price += list_price1; } String amount_unit = request.getParameter(tem_amount_unit); double list_price_subtotal = Double.parseDouble(list_price) * Double.parseDouble(amount); list_price_sum += list_price_subtotal; double cost_price_subtotal = Double.parseDouble(cost_price) * Double.parseDouble(amount); cost_price_sum += cost_price_subtotal; demand_amount += Double.parseDouble(amount); String sql1 = "update stock_apply_pay_details set amount='" + amount + "',list_price='" + list_price + "',list_price_subtotal='" + list_price_subtotal + "',cost_price='" + cost_price + "',subtotal='" + cost_price_subtotal + "' where pay_ID='" + pay_ID + "' and details_number='" + i + "'"; stock_db.executeUpdate(sql1); if (flag) { if (type.equals("物料") || type.equals("外购商品")) { String sql2 = "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('" + stock_pay_ID + "','" + i + "','" + product_ID + "','" + product_name + "','" + type + "','" + list_price + "','" + list_price_subtotal + "','" + cost_price + "','" + cost_price_subtotal + "','" + amount + "','" + amount + "','0','" + amount + "')"; stock_db.executeUpdate(sql2); } else if (type.equals("商品") || type.equals("部件") || type.equals("委外部件")) { String sql2 = "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('" + stock_pay_ID + "','" + i + "','" + product_ID + "','" + product_name + "','" + type + "','" + list_price + "','" + list_price_subtotal + "','" + cost_price + "','" + cost_price_subtotal + "','" + amount + "','" + amount + "','" + amount + "','0')"; stock_db.executeUpdate(sql2); } String sql97 = "select * from crm_salecredit_balance_details where crediter_ID='" + payer_ID + "' and product_ID='" + product_ID + "'"; ResultSet rs97 = crm_db.executeQuery(sql97); if (rs97.next()) { double balance_amount = rs97.getDouble("amount") + Double.parseDouble(amount); double balance_cost_price_subtotal = rs97.getDouble("subtotal") + cost_price_subtotal; double balance_list_price_subtotal = rs97.getDouble("list_price_subtotal") + list_price_subtotal; String sql96 = "update crm_salecredit_balance_details set amount='" + balance_amount + "',check_tag='1',subtotal='" + balance_cost_price_subtotal + "',list_price_subtotal='" + balance_list_price_subtotal + "' where crediter_ID='" + payer_ID + "' and product_ID='" + product_ID + "'"; crm_db.executeUpdate(sql96); } else { String[] aaa = FileKind.getKind( (String) dbSession.getAttribute("unit_db_name"), "design_file", "product_ID", product_ID); String sql95 = "insert into crm_salecredit_balance_details(chain_ID,chain_name,crediter_chain_ID,crediter_chain_name,product_ID,product_name,list_price,list_price_subtotal,cost_price,subtotal,amount,crediter_ID,crediter_name) values('" + aaa[0] + "','" + aaa[1] + "','" + aaa1[0] + "','" + aaa1[1] + "','" + product_ID + "','" + product_name + "','" + list_price + "','" + list_price_subtotal + "','" + cost_price + "','" + cost_price_subtotal + "','" + amount + "','" + payer_ID + "','" + payer_name + "')"; crm_db.executeUpdate(sql95); } } } String[] cost_pricen = request.getParameterValues("cost_price"); String[] list_pricen = request.getParameterValues("list_price"); String[] product_namen = request.getParameterValues("product_name"); String[] product_describen = request.getParameterValues("product_describe"); String[] amount_unitn = request.getParameterValues("amount_unit"); String[] typen = request.getParameterValues("type"); for (int i = 1; i < product_IDn.length; i++) { StringTokenizer tokenTO3 = new StringTokenizer(list_pricen[i], ","); String list_price = ""; while (tokenTO3.hasMoreTokens()) { String list_price1 = tokenTO3.nextToken(); list_price += list_price1; } if (!amountn[i].equals("") && Double.parseDouble(amountn[i]) != 0) { double list_price_subtotal = Double.parseDouble(list_price) * Double.parseDouble(amountn[i]); list_price_sum += list_price_subtotal; double subtotal = Double.parseDouble(cost_pricen[i]) * Double.parseDouble(amountn[i]); cost_price_sum += subtotal; demand_amount += Double.parseDouble(amountn[i]); num++; String sql1 = "insert into stock_apply_pay_details(payer_chain_ID,payer_chain_name,sales_ID,sales_name,payer_ID,payer_name,payer_type,pay_ID,details_number,product_ID,product_name,product_describe,amount,amount_unit,list_price,list_price_subtotal,cost_price,subtotal,type) values ('" + aaa1[0] + "','" + aaa1[1] + "','" + sales_ID + "','" + sales_name + "','" + payer_ID + "','" + payer_name + "','销售赊货','" + pay_ID + "','" + num + "','" + product_IDn[i] + "','" + product_namen[i] + "','" + product_describen[i] + "','" + amountn[i] + "','" + amount_unitn[i] + "','" + list_price + "','" + list_price_subtotal + "','" + cost_pricen[i] + "','" + subtotal + "','" + typen[i] + "')"; stock_db.executeUpdate(sql1); // ********************** if (rsList.size() == 0) { if (typen[i].equals("物料") || typen[i].equals("外购商品")) { String sql2 = "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('" + stock_pay_ID + "','" + num + "','" + product_IDn[i] + "','" + product_namen[i] + "','" + typen[i] + "','" + list_price + "','" + list_price_subtotal + "','" + cost_pricen[i] + "','" + subtotal + "','" + amountn[i] + "','" + amountn[i] + "','0','" + amountn[i] + "')"; stock_db.executeUpdate(sql2); } else if (typen[i].equals("商品") || typen[i].equals("部件") || typen[i].equals("委外部件")) { String sql2 = "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('" + stock_pay_ID + "','" + num + "','" + product_IDn[i] + "','" + product_namen[i] + "','" + typen[i] + "','" + list_price + "','" + list_price_subtotal + "','" + cost_pricen[i] + "','" + subtotal + "','" + amountn[i] + "','" + amountn[i] + "','" + amountn[i] + "','0')"; stock_db.executeUpdate(sql2); } String sql97 = "select * from crm_salecredit_balance_details where crediter_ID='" + payer_ID + "' and product_ID='" + product_IDn[i] + "'"; ResultSet rs97 = crm_db.executeQuery(sql97); if (rs97.next()) { double balance_amount = rs97.getDouble("amount") + Double.parseDouble(amountn[i]); double balance_cost_price_subtotal = rs97.getDouble("subtotal") + subtotal; double balance_list_price_subtotal = rs97.getDouble("list_price_subtotal") + list_price_subtotal; String sql96 = "update crm_salecredit_balance_details set amount='" + balance_amount + "',check_tag='1',subtotal='" + balance_cost_price_subtotal + "',list_price_subtotal='" + balance_list_price_subtotal + "' where crediter_ID='" + payer_ID + "' and product_ID='" + product_IDn[i] + "'"; crm_db.executeUpdate(sql96); } else { String[] aaa = FileKind.getKind( (String) dbSession.getAttribute("unit_db_name"), "design_file", "product_ID", product_IDn[i]); String sql95 = "insert into crm_salecredit_balance_details(chain_ID,chain_name,crediter_chain_ID,crediter_chain_name,product_ID,product_name,list_price,list_price_subtotal,cost_price,subtotal,amount,crediter_ID,crediter_name) values('" + aaa[0] + "','" + aaa[1] + "','" + aaa1[0] + "','" + aaa1[1] + "','" + product_IDn[i] + "','" + product_namen[i] + "','" + list_price + "','" + list_price_subtotal + "','" + cost_pricen[i] + "','" + subtotal + "','" + amountn[i] + "','" + payer_ID + "','" + payer_name + "')"; crm_db.executeUpdate(sql95); } } // *************************** } } String sql = "update stock_apply_pay set reason='" + reason + "',register='" + register + "',register_time='" + register_time + "',demand_return_time='" + demand_return_time + "',register_time='" + register_time + "',register='" + register + "',remark='" + remark + "',demand_amount='" + demand_amount + "',list_price_sum='" + list_price_sum + "',cost_price_sum='" + cost_price_sum + "',not_return_tag='" + not_return_tag + "' where pay_ID='" + pay_ID + "'"; stock_db.executeUpdate(sql); if (flag) { sql = "update stock_apply_pay set check_tag='1' where pay_ID='" + pay_ID + "'"; stock_db.executeUpdate(sql); if (!vr.validata( (String) dbSession.getAttribute("unit_db_name"), "stock_pay", "reasonexact", pay_ID)) { String sql4 = "insert into stock_pay(pay_ID,reason,reasonexact,reasonexact_details,demand_amount,list_price_sum,cost_price_sum,register,register_time) values('" + stock_pay_ID + "','" + reason + "','" + pay_ID + "','" + payer_name + "','" + demand_amount + "','" + list_price_sum + "','" + cost_price_sum + "','" + register + "','" + register_time + "')"; stock_db.executeUpdate(sql4); } String sql98 = "select * from crm_file where customer_ID='" + payer_ID + "'"; ResultSet rs98 = crm_db.executeQuery(sql98); if (rs98.next()) { double salecredit_list_price_sum = rs98.getDouble("salecredit_list_price_sum") + list_price_sum; double salecredit_cost_price_sum = rs98.getDouble("salecredit_cost_price_sum") + cost_price_sum; String sql99 = "update crm_file set credit_yes_or_not_tag='1',salecredit_list_price_sum='" + salecredit_list_price_sum + "',salecredit_cost_price_sum='" + salecredit_cost_price_sum + "' where customer_ID='" + payer_ID + "' "; crm_db.executeUpdate(sql99); } } else { sql = "update stock_apply_pay set check_tag='0' where pay_ID='" + pay_ID + "'"; stock_db.executeUpdate(sql); Iterator ite = rsList.iterator(); while (ite.hasNext()) { elem = (String[]) ite.next(); sql = "insert into crm_workflow(config_id,object_ID,describe1,describe2) values ('" + elem[0] + "','" + pay_ID + "','" + elem[1] + "','" + elem[2] + "')"; crm_db.executeUpdate(sql); } } response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=8"); } else { response.sendRedirect( "draft/crm/credit_ok.jsp?finished_tag=7&pay_ID=" + pay_ID + ""); } } catch (Exception ex) { ex.printStackTrace(); } } else { response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=6&pay_ID=" + pay_ID + ""); } } else { response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=9"); } } stock_db.commit(); crm_db.commit(); stock_db.close(); crm_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { HttpSession session = request.getSession(); PrintWriter out = response.getWriter(); nseer_db_backup1 security_db = new nseer_db_backup1(dbApplication); if (security_db.conn((String) dbSession.getAttribute("unit_db_name"))) { getRecordCount query = new getRecordCount(); String tablename = request.getParameter("tablename"); String[] cols = request.getParameterValues("col"); if (cols == null) { response.sendRedirect("hr/config/key/key_register_ok_a.jsp"); } else { String column_group = ""; for (int i = 0; i < cols.length; i++) { column_group += cols[i] + ","; } column_group = column_group.substring(0, column_group.length() - 1); String sql1 = "select * from security_publicconfig_key where tablename='" + tablename + "'"; ResultSet rs = security_db.executeQuery(sql1); if (rs.next()) { String sql = "update security_publicconfig_key set column_group='" + column_group + "' where tablename='" + tablename + "'"; security_db.executeUpdate(sql); } else { String sql = "insert into security_publicconfig_key(tablename,column_group) values('" + tablename + "','" + column_group + "')"; security_db.executeUpdate(sql); } response.sendRedirect("hr/config/key/key_register_ok_b.jsp"); } security_db.commit(); security_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; 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("\n"); out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); out.write("<html>\n"); out.write("<head>\n"); out.write("<title>\n"); out.write("Section 1\n"); out.write("</title>\n"); out.write("<style type=\"text/css\">\n"); out.write("<!--\n"); out.write( ".normalfont {font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n"); out.write( ".bigfont {font-size: 14pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n"); out.write( ".bigbigfont {font-size: 16pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n"); out.write( ".darkbackgroundwithnormalfont {background-image: url(../gifs/brushed_metal_dkblue.jpg); font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: black; }\n"); out.write( ".darkbackgroundwithhugefont {background-image: url(../gifs/brushed_metal_dkblue.jpg); font-size: 15pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: black; }\n"); out.write( ".normalfontwithred {font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: red;}\n"); out.write(".centertable {text-align: center; vertical-align: middle;}\n"); out.write("a {text-decoration: none;}\n"); out.write( ".headerfont {font-size: 18pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n"); out.write("button, button:focus, button:active {\n"); out.write(" /* NOTE Remove all decorations */\n"); out.write(" border: none;\n"); out.write(" display: inline;\n"); out.write(" margin: 0em;\n"); out.write(" padding: 0em;\n"); out.write(" outline: none;\n"); out.write(" outline-offset: 0em;\n"); out.write(" /* NOTE Look like a link */\n"); out.write(" background: none;\n"); out.write(" color: blue;\n"); out.write(" cursor: pointer;\n"); out.write(" font: inherit;\n"); out.write(" text-decoration: none;\n"); out.write("}\n"); out.write("-->\n"); out.write("</style>\n"); out.write("</head>\n"); out.write("<!-- bgcolor=\"aqua\" -->\n"); out.write( "<body class=\"bodybackground\" style=\"margin-top: 0; margin-left: 0; margin-bottom: 4px; margin-right: 4px\">\n"); out.write( "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"875px\" style=\"height: 100%\">\n"); out.write("<tr valign=\"top\">\n"); out.write("<td style=\"width: 190px;\" class=\"marginbackground\">\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"); out.write("<html>\n"); out.write("<head>\n"); out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); out.write("<title>Insert title here</title>\n"); out.write("</head>\n"); out.write("<body>\n"); out.write("\n"); out.write( "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"normalfont\" style=\"height: 100%\" >\n"); out.write("<tr style=\"height: 61px; border-bottom-width: 0px; \" valign=\"top\">\n"); out.write("<td>\n"); out.write("\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("<tr style=\"height: 10px;\">\n"); out.write("<td>\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr class=\"darkbackgroundwithnormalfont\" style=\"height: 20px;\">\n"); out.write("<td align=\"center\">\n"); out.write("<b>\n"); String e = (String) request.getSession().getAttribute("name"); out.println(e); out.write("\n"); out.write("</b>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("<tr style=\"height: 10px;\">\n"); out.write("<td>\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" • \n"); out.write("<a href=\"loginpath?id=professor_home_link\" style=\"color: darkblue;\">\n"); out.write("Home Page\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" • \n"); out.write("<a href=\"professor_welcome_path?id=sections\" style=\"color: darkblue;\">\n"); out.write("Sections\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" • \n"); out.write("<a href=\"professor_welcome_path?id=assignments\" style=\"color: darkblue;\">\n"); out.write("Assignments\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" • \n"); out.write("<a href=\"prof_account_settings.jsp\" style=\"color: darkblue;\">\n"); out.write("Account Settings\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" • \n"); out.write("<a href=\"loginpath?id=logout_link\" style=\"color: darkblue;\">\n"); out.write("Log Out\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<!-- more links here? -->\n"); out.write("\n"); out.write("<tr style=\"height: 10px;\">\n"); out.write("<td>\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("<tr>\n"); out.write("<td>\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("<tr style=\"height: 35px;\">\n"); out.write("<td>\n"); out.write(" \n"); out.write("<a href=\"\" style=\"color: darkblue;\">\n"); out.write("Help\n"); out.write("</a>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("\n"); out.write("</table>\n"); out.write("\n"); out.write("\n"); out.write("</body>\n"); out.write("</html>"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("</td>\n"); out.write("<td style=\"width: 3px; background-color: black;\"> </td>\n"); out.write( "<td valign=\"top\" class=\"lightbackgroundwithnormalfont\" style=\"width: 686px;\">\n"); out.write( "<CENTER><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"smallfont\" style=\"color: black;\">\n"); out.write("<tr class=\"darkbackgroundwithhugefont\" style=\"height: 35px\">\n"); out.write("<td colspan=\"3\" valign=\"middle\" align=\"center\">\n"); out.write("<b>\n"); out.write("Database Project\n"); out.write("</b>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("<tr style=\"height: 5px\">\n"); out.write("<td colspan=\"3\">\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("</table></CENTER>\n"); out.write("<hr/>\n"); out.write("\n"); out.write("\n"); out.write("<!-- jsp here to get section name -->\n"); String section = (String) request.getAttribute("section"); String crn = (String) request.getAttribute("CRN"); out.write("\n"); out.write("\n"); out.write(" \n"); out.write("<b class=\"headerfont\">"); out.println(section); out.write(": New Assignment</b><br/><br/>\n"); out.write("\n"); out.write("<form method=\"post\" action=\"make_assignment_servlet?id="); out.println(crn); out.write("\">\n"); out.write("Enter a name for the assignment:<input type=\"text\" name=\"name\"><br/>\n"); out.write("Enter Deadline (MM/DD/YYYY):<input type=\"text\" name=\"deadline\"><br/>\n"); out.write("Enter a description of the assignment:<br/>\n"); out.write("<textarea name=\"description\"></textarea><br/>\n"); out.write( "Number of questions:<input type=\"text\" size=\"3\" name=\"numQuestions\"><br/>\n"); out.write("\n"); out.write("<input type=\"Submit\" name=\"id\" value=\"Save Assignment\">\n"); out.write("\n"); out.write("</form>\n"); out.write("\n"); out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">\n"); out.write("<tr style=\"height: 5px\">\n"); out.write("<td colspan=\"3\">\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("</table>\n"); out.write("</td>\n"); out.write("<td style=\"width: 3px; background-color: black;\"> </td>\n"); out.write("<td style=\"width: 190px\" class=\"marginbackground\">\n"); out.write(" \n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("</table>\n"); out.write("</body>\n"); out.write("</html>"); } catch (Throwable t) { if (!(t instanceof 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); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }
public synchronized void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession dbSession = request.getSession(); JspFactory _jspxFactory = JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true); ServletContext dbApplication = dbSession.getServletContext(); try { // 实例化 HttpSession session = request.getSession(); ServletContext context = session.getServletContext(); String path = context.getRealPath("/"); counter count = new counter(dbApplication); SmartUpload mySmartUpload = new SmartUpload(); mySmartUpload.setCharset("UTF-8"); nseer_db_backup1 oa_db = new nseer_db_backup1(dbApplication); if (oa_db.conn((String) dbSession.getAttribute("unit_db_name"))) { getAttachmentLength getAttachmentLength = new getAttachmentLength(); getAttachmentType getAttachmentType = new getAttachmentType(); double d = getAttachmentLength.getAttachmentLength( (String) dbSession.getAttribute("unit_db_name"), "document_config_public_char"); String ee = getAttachmentType.getAttachmentType( (String) dbSession.getAttribute("unit_db_name"), "document_config_public_char"); mySmartUpload.initialize(pageContext); mySmartUpload.upload(); String[] file_name = new String[mySmartUpload.getFiles().getCount()]; int j = 0; int filenum1 = count.read((String) dbSession.getAttribute("unit_db_name"), "oaMessagecount"); String message_ID = filenum1 + ""; count.write((String) dbSession.getAttribute("unit_db_name"), "oaMessagecount", filenum1); String sql1 = "select * from oa_message where message_ID='" + message_ID + "'"; ResultSet rs = oa_db.executeQuery(sql1); if (j != 0 || rs.next()) { response.sendRedirect("oa/message/register_ok_a.jsp"); } else { String subject = mySmartUpload.getRequest().getParameter("subject"); String message_type = mySmartUpload.getRequest().getParameter("message_type"); String register = mySmartUpload.getRequest().getParameter("register"); String register_ID = mySmartUpload.getRequest().getParameter("register_ID"); String register_time = mySmartUpload.getRequest().getParameter("register_time"); String bulletin = mySmartUpload.getRequest().getParameter("bulletin"); String content = exchange.toHtmlFCK(mySmartUpload.getRequest().getParameter("content")); String bodyab = new String( mySmartUpload.getRequest().getParameter("remark").getBytes("UTF-8"), "UTF-8"); String remark = exchange.toHtml(bodyab); if (j != 0) { response.sendRedirect("oa/message/register_ok_c.jsp"); } else { String sqla = ""; String sqlb = ""; if (bulletin == null) { sqla = "insert into oa_message(register,register_ID,register_time,message_ID,subject,type,content,remark"; sqlb = ") values ('" + register + "','" + register_ID + "','" + register_time + "','" + message_ID + "','" + subject + "','" + message_type + "','" + content + "','" + remark + "'"; } else { sqla = "insert into oa_message(register,register_ID,register_time,message_ID,subject,type,content,remark,check_tag"; sqlb = ") values ('" + register + "','" + register_ID + "','" + register_time + "','" + message_ID + "','" + subject + "','" + message_type + "','" + content + "','" + remark + "','2'"; } String sql = sqla + sqlb + ")"; oa_db.executeUpdate(sql); response.sendRedirect("oa/message/register_ok_b.jsp"); } } oa_db.commit(); oa_db.close(); } else { response.sendRedirect("error_conn.htm"); } } catch (Exception ex) { ex.printStackTrace(); } }