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

« back to all changes in this revision

Viewing changes to local/in/dhis-web-ga/tempForViewChart.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
<jsp:useBean id="AudioAction" scope="session" class="org.hisp.gtool.action.AudioAction" />
 
7
<%
 
8
  // To Play Audio
 
9
        String muteOpt = (String) session.getAttribute("muteOpt");
 
10
        if(muteOpt != null && muteOpt.equals("OFF"))
 
11
        {
 
12
                AudioAction.stopAudio();
 
13
                AudioAction.playAudio("t3.wav");
 
14
        }       
 
15
  
 
16
  String indicatorList[] = request.getParameterValues("iListCB");
 
17
  String orgUnitName = request.getParameter("ouNameTB");
 
18
 
 
19
  String sDate = request.getParameter("sDateLB");  
 
20
  String eDate = request.getParameter("eDateLB");
 
21
 
 
22
//  String sDate[] = request.getParameterValues("sDateLB");  
 
23
//  String eDate[] = request.getParameterValues("eDateLB");
 
24
  String category = request.getParameter("categoryLB");
 
25
  String ideType = request.getParameter("riRadio");
 
26
 
 
27
  String temp = request.getParameter("ouIDTB");
 
28
  int orgUnitID = -1;
 
29
  try
 
30
  {
 
31
   orgUnitID = Integer.parseInt(request.getParameter("ouIDTB"));
 
32
   }
 
33
  catch(Exception e)
 
34
   {
 
35
   System.out.println(orgUnitName+" --Can not Convert Integer : "+ e.getMessage());
 
36
   }
 
37
             
 
38
%>  
 
39
 
 
40
<jsp:useBean id="ViewChartBean" scope="session" class="org.hisp.gtool.action.ViewChartBean" />
 
41
 
 
42
<jsp:setProperty name="ViewChartBean" property="indicatorList" value="<%=indicatorList%>"/>
 
43
<jsp:setProperty name="ViewChartBean" property="orgUnitName" value="<%=orgUnitName%>"/>
 
44
<jsp:setProperty name="ViewChartBean" property="s_Date" value="<%=sDate%>"/>
 
45
<jsp:setProperty name="ViewChartBean" property="e_Date" value="<%=eDate%>"/>
 
46
<jsp:setProperty name="ViewChartBean" property="i_category" value="<%=category%>"/>
 
47
<jsp:setProperty name="ViewChartBean" property="orgUnitID" value="<%=orgUnitID%>"/>
 
48
<jsp:setProperty name="ViewChartBean" property="ide_type" value="<%=ideType%>"/>
 
49
 
 
50
<html>
 
51
<head>
 
52
<title></title>
 
53
<link rel="stylesheet" type="text/css" href="css/StylesForTags.css" />
 
54
<script>
 
55
  var indexForChart = 0;
 
56
  var chartNamesToView = new Array();
 
57
        chartNamesToView[0] = new Array("WelCome.jsp");
 
58
        chartNamesToView[1] = new Array("overlaidbarchart1.jsp","linechart2.jsp","combinedcategoryplotchart1.jsp","barchart1.jsp","barchart2.jsp","barchart3d1.jsp","barchart3d2.jsp","overlaidbarchart2.jsp","dualaxischart1.jsp","piechart1.jsp","piechart3d1.jsp","areachart1.jsp"); 
 
59
        chartNamesToView[2] = new Array("overlaidbarchart1.jsp","linechart2.jsp","combinedcategoryplotchart1.jsp","barchart1.jsp","barchart2.jsp","barchart3d1.jsp","barchart3d2.jsp","overlaidbarchart2.jsp","dualaxischart1.jsp","areachart1.jsp");                                                                                                   
 
60
        
 
61
        chartNamesToView2[1] = new Array("combinedcategoryplotchart","barchart(Vertical)","barchart(Horizontal)","3D barchart(Vertical)","3D barchart(Horizantal)","overlaidbarchart(Vertical)","overlaidbarchart(Horizontal)","dualaxischart","piechart","piechart","linechart","areachart");  
 
62
        chartNamesToView2[2] = new Array("combinedcategoryplotchart","barchart(Vertical)","barchart(Horizontal)","3D barchart(Vertical)","3D barchart(Horizantal)","overlaidbarchart(Vertical)","overlaidbarchart(Horizontal)","dualaxischart","linechart","areachart");                                                                                                        
 
63
 
 
64
 
 
65
  function nextCharttoView()
 
66
   {      
 
67
   
 
68
     indexForChart++;
 
69
     var chartType = 0;
 
70
     var tempICount = <%=(indicatorList.length)%>;
 
71
     if(tempICount==0)  chartType=0;
 
72
     else if(tempICount==1) chartType=1;
 
73
     else chartType=2;
 
74
   
 
75
     if(indexForChart >= chartNamesToView[chartType].length) indexForChart=0;
 
76
     iframeForChart.location.href = chartNamesToView[chartType][indexForChart];
 
77
     
 
78
  //   document.form1.nextChartButton.title = chartNamesToView2[chartType][indexForChart];
 
79
  //   document.form1.prevChartButton.title = chartNamesToView2[chartType][indexForChart];
 
80
   }
 
81
   
 
82
   function prevCharttoView()
 
83
   {      
 
84
     indexForChart--;
 
85
     var chartType = 0;
 
86
     var tempICount = <%=(indicatorList.length)%>;
 
87
     if(tempICount==0)  chartType=0;
 
88
     else if(tempICount==1) chartType=1;
 
89
     else chartType=2;
 
90
   
 
91
     if(indexForChart < 0) indexForChart=chartNamesToView[chartType].length-1;
 
92
 
 
93
     iframeForChart.location.href = chartNamesToView[chartType][indexForChart];
 
94
     
 
95
//     document.form1.nextChartButton.title = chartNamesToView2[chartType][indexForChart];
 
96
 //    document.form1.prevChartButton.title = chartNamesToView2[chartType][indexForChart];
 
97
   }
 
98
   
 
99
</script>
 
100
</head>
 
101
<body >
 
102
<div align="right">
 
103
        <form name="form1" id="form1">
 
104
                <input type="button" name="prevChartButton" id="prevChartButton" style="width: 40; height: 35; background-image: url('images/moveLeft.gif'); background-repeat: no-repeat; background-position: center; " onClick="prevCharttoView()" title="Previous">
 
105
                <input type="button" name="nextChartButton" id="nextChartButton" style="width: 40; height: 35; background-image: url('images/moveRight.gif'); background-repeat: no-repeat; background-position: center;" onClick="nextCharttoView()" title="Next">
 
106
        </form> 
 
107
</div>
 
108
<iframe name="iframeForChart" id="iframeForChart" src="overlaidbarchart1.jsp" width="100%" height="100%" scrolling=auto frameborder="0"></iframe>
 
109
 
 
110
<%
 
111
if(ideType.equals("indicatorsRadio"))
 
112
{
 
113
 
 
114
%>
 
115
 
 
116
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
 
117
<tr>
 
118
                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><font color="maroon">Indicator Names</font></td>
 
119
                <td class="TableHeadingCellStyles" colspan="2" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><font color="maroon">Formula</font></td>
 
120
                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><font color="maroon">Numerator DataElements</font></td>
 
121
                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><font color="maroon">Denominator DataElements</font></td>
 
122
        </tr>
 
123
 
 
124
 
 
125
<!--
 
126
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
 
127
        <tr>
 
128
                <td class="TableHeadingCellStyles"><font color="maroon">Indicator</font></td>
 
129
                <td class="TableHeadingCellStyles"><font color="maroon">Formula</font></td>
 
130
                <td class="TableHeadingCellStyles"><font color="maroon">Numerator DataElements</font></td>
 
131
                <td class="TableHeadingCellStyles"><font color="maroon">Denominator DataElements</font></td>
 
132
        </tr>
 
133
-->     
 
134
        <%
 
135
                Hashtable htForIndNumerator      = ViewChartBean.getIndNumeratorFormula();
 
136
                Hashtable htForIndDenominator    = ViewChartBean.getIndDenominatorFormula();
 
137
                Hashtable htForIndFactor                 = ViewChartBean.getIndFactor();
 
138
                Hashtable htForIndNumeratorDEs   = ViewChartBean.getIndNumeratorDEs();
 
139
                Hashtable htForIndDenominatorDEs = ViewChartBean.getIndDenominatorDEs();
 
140
                
 
141
                if(htForIndNumerator == null) { out.println("<h3>No Numerator</h3>"); return;}
 
142
                if(htForIndDenominator == null) { out.println("<h3>No Denominator</h3>"); return;}
 
143
                if(htForIndFactor == null) { out.println("<h3>No Factor</h3>"); return;}
 
144
                if(htForIndNumeratorDEs == null) { out.println("<h3>No Numerator DataElements</h3>"); return;}
 
145
                if(htForIndDenominatorDEs == null) { out.println("<h3>No Denominator DataElements</h3>"); return;}
 
146
                
 
147
                Enumeration keysForIndicators = htForIndFactor.keys();
 
148
                while(keysForIndicators.hasMoreElements())
 
149
                {
 
150
                        String indName = (String) keysForIndicators.nextElement();
 
151
                        %>
 
152
                        <!--
 
153
                        <tr>
 
154
                                <td class="TableHeadingCellStyles"><font color="maroon">Sample Indicator1</font></td>
 
155
                                <td class="TableHeadingCellStyles" >
 
156
                                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
 
157
                                        <tr>
 
158
                                        <td class="TableHeadingCellStyles" width="20%" style="border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1" bordercolor="#000000"><%=htForIndNumerator.get(indName)%></td>
 
159
                                        <td class="TableHeadingCellStyles" rowspan="2" width="80%">&nbsp;&nbsp;X &nbsp;<%=htForIndFactor.get(indName)%></td>
 
160
                                        </tr>
 
161
                                        <tr>
 
162
                                        <td class="TableHeadingCellStyles" width="20%"><%=htForIndDenominator.get(indName)%></td>
 
163
                                        </tr>
 
164
                                </table>
 
165
                        </td>
 
166
                                <td class="TableHeadingCellStyles"><%=htForIndNumeratorDEs.get(indName)%></td>
 
167
                                <td class="TableHeadingCellStyles"><%=htForIndDenominatorDEs.get(indName)%></td>
 
168
                        </tr>                                           
 
169
                        -->
 
170
                        
 
171
                        <tr>
 
172
                                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><%=indName%></td>
 
173
                                <td class="TableHeadingCellStyles" align="center" style="border-left-style:dotted; border-left-width:1; border-right-width:0; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><u><%=htForIndNumerator.get(indName)%></u><br><%=htForIndDenominator.get(indName)%></td>
 
174
                                <td class="TableHeadingCellStyles" align="left" style="border-left-style:dotted; border-left-width:0; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1">&nbsp;X&nbsp;<%=htForIndFactor.get(indName)%></td>
 
175
                                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><%=htForIndNumeratorDEs.get(indName)%></td>
 
176
                                <td class="TableHeadingCellStyles" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><%=htForIndDenominatorDEs.get(indName)%></td>
 
177
                        </tr>                   
 
178
                <%      
 
179
                }
 
180
        %>
 
181
                
 
182
</table>
 
183
<%
 
184
} // if end
 
185
%>
 
186
</body>
 
187
</html>