~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/in/dhis-web-ga/tempDValidationAdd.jsp

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%@ page contentType="text/html ; charset=UTF-8"%>
 
2
 
 
3
<%@ page import="java.sql.*,java.util.*" %>
 
4
<%@ page session="true"%>
 
5
 
 
6
<!-- Bean Specification -->
 
7
<jsp:useBean id="GAUtilities" scope="session" class="org.hisp.gtool.utilities.GAUtilities" />
 
8
<jsp:useBean id="DataValidationAction" scope="session" class="org.hisp.gtool.action.DataValidationAction" />
 
9
 
 
10
<%
 
11
        // Input Parameters
 
12
        String dvName = request.getParameter("VNameTB");
 
13
        String leftDesc = request.getParameter("leftDescTB");
 
14
        String rightDesc = request.getParameter("rightDescTB"); 
 
15
        String dvOperator = request.getParameter("VOperatorLB"); 
 
16
        String dvType = request.getParameter("VTypeLB"); 
 
17
        String leftSelDEList[] = request.getParameterValues("LeftSelDEList");
 
18
        String rightSelDEList[] = request.getParameterValues("RightSelDEList");
 
19
        String leftPercent = request.getParameter("leftPercent");
 
20
        String rightPercent = request.getParameter("rightPercent");
 
21
        
 
22
        if(leftPercent == null || leftPercent.equals("")) leftPercent = "0";
 
23
        if(rightPercent == null || rightPercent.equals("")) rightPercent = "0";
 
24
                
 
25
        String leftSelDEs = GAUtilities.getConcatedString(leftSelDEList, ",");
 
26
        String rightSelDEs = GAUtilities.getConcatedString(rightSelDEList, ",");  
 
27
 
 
28
        Hashtable htForDataValidations = DataValidationAction.getAllDataValidations();
 
29
        Vector DataValidationIds = new Vector(htForDataValidations.keySet());
 
30
        String maxDVId = (String) Collections.max(DataValidationIds);
 
31
        String curDVId = "" + (Integer.parseInt(maxDVId)+1);
 
32
        
 
33
        List li = new ArrayList();
 
34
        li.add(0,curDVId);
 
35
        li.add(1,dvName);
 
36
        li.add(2,leftDesc);
 
37
        li.add(3,rightDesc);
 
38
        li.add(4,dvOperator);
 
39
        li.add(5,dvType);
 
40
        li.add(6,leftSelDEs);
 
41
        li.add(7,rightSelDEs);
 
42
        li.add(8,leftPercent);
 
43
        li.add(9,rightPercent);
 
44
                
 
45
        boolean addDVStatus = DataValidationAction.addDataValidation(li);
 
46
%>
 
47
<html>
 
48
        <head>
 
49
                <title>Graphical Analyser</title>
 
50
                <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 
51
        <meta http-equiv="description" content="this is my page">
 
52
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
53
        
 
54
                <script>
 
55
                        function onLoadFunction()
 
56
                        {
 
57
                          if(<%=addDVStatus%>) 
 
58
                                {
 
59
                                        alert("Validation is Successfully Added");
 
60
                                        location.href="DValidationScreen.jsp";
 
61
                                }
 
62
                          else
 
63
                                {
 
64
                                        alert("Failure while Adding...Try Again");
 
65
                                        location.href="DValidationAdd.jsp";
 
66
                                }               
 
67
                        }
 
68
                </script>
 
69
        </head>
 
70
        <body onload="onLoadFunction()">
 
71
        <p align="left">        
 
72
                <font face="arial" size="2">
 
73
                        <li>Validation Id : <%=curDVId%><br>
 
74
                        <li>Validation Name : <%=dvName%><br>
 
75
                        <li>Left Description : <%=leftDesc%><br/>
 
76
                        <li>Right Description : <%=rightDesc%><br/>
 
77
                        <li>Validation Operator : <%=dvOperator%><br/>
 
78
                        <li>Validation Type : <%=dvType%><br/>                  
 
79
                        <li>Left Sel DEList : <%=leftSelDEs%><br/>
 
80
                        <li>Right Sel DEList : <%=rightSelDEs%><br/>
 
81
                        <li>Left PerCentage : <%=leftPercent%><br/>
 
82
                        <li>Right PerCentage : <%=rightPercent%><br/>
 
83
                </font>
 
84
        </p>    
 
85
        </body>
 
86
</html>
 
 
b'\\ No newline at end of file'