<%@ page import="org.baraza.web.*" %> <%@ page import="org.baraza.xml.BElement" %> <%@ include file="/resources/include/init.jsp" %> <% ServletContext context = getServletContext(); String dbconfig = "java:/comp/env/jdbc/database"; String xmlcnf = request.getParameter("xml"); if(request.getParameter("logoff") == null) { if(xmlcnf == null) xmlcnf = (String)session.getAttribute("xmlcnf"); if(xmlcnf == null) xmlcnf = context.getInitParameter("config_file"); if(xmlcnf != null) session.setAttribute("xmlcnf", xmlcnf); } else { session.setAttribute("xmlcnf", ""); session.invalidate(); } String ps = System.getProperty("file.separator"); String xmlfile = context.getRealPath("WEB-INF") + ps + "configs" + ps + xmlcnf; String reportPath = context.getRealPath("reports") + ps; String userIP = request.getRemoteAddr(); String userName = request.getRemoteUser(); BWeb web = new BWeb(dbconfig, xmlfile); web.setUser(userIP, userName); web.init(request); String entryformid = null; String action = request.getParameter("action"); String value = request.getParameter("value"); String post = request.getParameter("post"); String process = request.getParameter("process"); String reportexport = request.getParameter("reportexport"); String excelexport = request.getParameter("excelexport"); String fieldTitles = web.getFieldTitles(); String auditTable = null; String opResult = null; if(process != null) { if(process.equals("Action")) { String operation = request.getParameter("operation"); opResult = web.setOperations(operation, request); } else if(process.equals("FormAction")) { String actionKey = request.getParameter("actionkey"); opResult = web.setOperation(actionKey, request); } else if(process.equals("Update")) { web.updateForm(request); } else if(process.equals("Delete")) { web.deleteForm(request); } else if(process.equals("Submit")) { web.submitGrid(request); } else if(process.equals("Check All")) { web.setSelectAll(); } else if(process.equals("Audit")) { auditTable = web.getAudit(); } } if(excelexport != null) reportexport = excelexport; if(reportexport != null) { out.println(" "); } %> <% if(web.isDiary()) { %> <%@ include file="/resources/include/diary.js" %> <%=web.getCalendar()%> });}); <% } %>
<%= web.getHiddenValues() %> <%= web.getTabs() %> <%= web.getButtons() %> <% if(opResult != null) out.println("
" + opResult + "
"); %> <%= web.getSaveMsg() %> <%= web.getBody(request, reportPath) %> <%= web.getFilters() %> <% String actionOp = web.getOperations(); if(actionOp != null) { %>
<%= actionOp %> <% } %> <% if(fieldTitles != null) { %>
<%= fieldTitles %> And Or
<% } %> <% if(web.isForm()) { out.println(web.getFormButtons()); if(auditTable != null) out.println(auditTable); } else if(web.isEditField()) { out.println(""); String operation = web.getOperations(); if(operation != null) out.println(operation); } %> <%= web.showFooter() %> <%= web.getFileButtons() %>
<% web.close(); %> <%@ include file="/resources/include/footer.jsp" %>