5
<title>Chart Result Screen</title>
6
<link type="text/css" rel="stylesheet" href="css/StylesForTags.css">
7
<script type="text/javascript" src="../dhis-web-commons/request.js"></script>
8
<script type="text/javascript" src="javascript/lists.js"></script>
9
<script type="text/javascript" src="javascript/ga.js"></script>
10
<script type="text/javascript" src="javascript/hashtable.js"></script>
14
var indexForChart = 0;
15
var chartNamesToView = new Array();
16
chartNamesToView[0] = new Array("Nothing");
17
chartNamesToView[1] = new Array("Vertical3DBarChart","Horizontal3DBarChart","LineChart","LineAndBarChart","DualAxisChart","AreaChart","PieChart3D");
18
chartNamesToView[2] = new Array("Vertical3DBarChart","Horizontal3DBarChart","LineChart","LineAndBarChart","DualAxisChart","AreaChart");
20
function nextCharttoView()
24
var tempICount = $selectedServiceList.size();
25
if(tempICount==0) chartType=0;
26
else if(tempICount==1) chartType=1;
29
var chartDisplayOptionList = document.getElementById("chartDisplayOption");
30
var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
32
if(indexForChart >= chartNamesToView[chartType].length) indexForChart=0;
33
iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
36
function prevCharttoView()
40
var tempICount = $selectedServiceList.size();
41
if(tempICount==0) chartType=0;
42
else if(tempICount==1) chartType=1;
45
var chartDisplayOptionList = document.getElementById("chartDisplayOption");
46
var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
48
if(indexForChart < 0) indexForChart=chartNamesToView[chartType].length-1;
49
iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
52
function chartDisplayOptionChange(evt)
56
var tempICount = $selectedServiceList.size();
57
if(tempICount==0) chartType=0;
58
else if(tempICount==1) chartType=1;
61
var chartDisplayOptionList = document.getElementById("chartDisplayOption");
62
var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
64
iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
66
getSortedList(chartDisplayOptionValue);
70
function getSortedList(chartDisplayOptionValue)
72
var url = "getSortedData.action?chartDisplayOption=" + chartDisplayOptionValue;
74
var request = new Request();
75
request.setResponseTypeXML( 'messages' );
76
request.setCallbackSuccess( getSortedListReceived );
80
function getSortedListReceived(xmlObject)
82
var messages = xmlObject.getElementsByTagName("message");
83
document.getElementById("headingInfoId").innerHTML = "";
84
document.getElementById("testId").value = "";
86
for ( var i = 0; i < messages.length; i++ )
88
var hinfo = messages[ i ].firstChild.nodeValue;
89
//document.getElementById("headingInfoId").innerHTML += hinfo;
90
document.getElementById("testId").value += hinfo;
93
document.getElementById("headingInfoId").innerHTML = document.getElementById("testId").value;
96
function exportToExcelFunction1( summaryOption )
98
var chartDisplayOptionList = document.getElementById("chartDisplayOption");
99
var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
101
document.getElementById("exportExcelAnchor1").href="exportToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption="+chartDisplayOptionValue;
110
// -----------------------------------------------------------------------------
111
// Author: Torgeir Lorange Ostby, torgeilo@gmail.com
112
// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
113
// -----------------------------------------------------------------------------
118
* function processResponse( response ) { ... } // Text or XML
119
* function requestFailed( httpStatusCode ) { ... }
121
* var request = new Request();
122
* request.setResponseTypeXML( 'rootElement' ); // Optional
123
* request.sendAsPost( 'value=1&value=2' ); // Optional
124
* request.setCallbackSuccess( processResponse ); // Optional
125
* request.setCallbackError( requestFailed ); // Optional
126
* request.send( 'url.action?value=1' );
132
var responseType = 'TEXT';
133
var requestMethod = 'GET';
134
var requestParameters = null;
139
this.setResponseTypeXML = function( rootElementName_ )
141
responseType = 'XML';
142
rootElementName = rootElementName_;
145
this.sendAsPost = function( requestParameters_ )
147
requestMethod = 'POST';
148
requestParameters = requestParameters_;
151
this.setCallbackSuccess = function( callbackSuccess_ )
153
callbackSuccess = callbackSuccess_;
156
this.setCallbackError = function( callbackError_ )
158
callbackError = callbackError_;
161
this.send = function( url )
163
request = newXMLHttpRequest();
167
window.alert( "Your browser doesn't support XMLHttpRequest" );
171
request.onreadystatechange = responseReceived;
172
request.open( requestMethod, url, true );
173
request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
174
request.send( requestParameters );
177
function newXMLHttpRequest()
179
if ( window.XMLHttpRequest )
183
return new XMLHttpRequest();
190
else if ( window.ActiveXObject )
194
return new ActiveXObject( 'Msxml2.XMLHTTP' );
200
return new ActiveXObject( 'Microsoft.XMLHTTP' );
212
function responseReceived()
214
if ( request.readyState == 4 )
216
switch( request.status )
219
if ( callbackSuccess )
221
if ( responseType == 'TEXT' )
223
callbackSuccess( request.responseText );
227
var xml = textToXML( request.responseText, rootElementName );
229
callbackSuccess( xml );
234
if ( callbackSuccess )
236
callbackSuccess( null );
240
var message = 'Operation failed - internal server error';
242
var serverMessage = request.responseText;
248
if ( serverMessage.length > maxLength )
250
serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
253
if ( serverMessage.length > 0 )
255
message += '\n\n' + serverMessage;
259
message += '\n\nThe error details are logged';
261
window.alert( message );
267
callbackError( request.status );
273
function textToXML( text, rootElementName )
275
var docImpl = document.implementation;
278
// For standards compliant browsers
279
if ( docImpl && docImpl.createLSParser )
281
parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
282
var input = docImpl.createLSInput();
283
input.stringData = text;
284
return parser.parse( input ).documentElement;
288
else if ( window.ActiveXObject )
290
dom = new ActiveXObject( 'Microsoft.XMLDOM' );
293
return dom.getElementsByTagName( rootElementName )[0];
297
else if ( window.DOMParser )
299
parser = new DOMParser();
300
dom = parser.parseFromString( text, 'application\/xml' );
301
return dom.documentElement;
304
// No parsing abilities
317
#if($selectedButton.equals("ViewSummary"))
318
<a href="exportToExcel.action?viewSummary=yes" target="_blank">Export To Excel</a>
322
<a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a>
324
<select id="chartDisplayOption" name="chartDisplayOption" onchange="chartDisplayOptionChange(event)">
325
<option value="none">Select Sort Type</option>
326
<option value="ascend">Ascending</option>
327
<option value="desend">Desending</option>
328
<option value="alphabet">Alphabetical</option>
331
<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">
332
<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">
338
#if($riRadio.equals("indicatorsRadio1") && $categoryLB.equals( "period" ))
339
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
341
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="2">Service Name</td>
342
#foreach($xaxisvalue in $xseriesList)
343
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" colspan="3">$xaxisvalue</td>
347
#foreach($xaxisvalue in $xseriesList)
348
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" >Num</td>
349
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" >Den</td>
350
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" >Val</td>
354
#foreach($onedataList in $dataList)
355
#set($oneNumList = $numList.get($count1))
356
#set($oneDenList = $denList.get($count1))
358
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1)</td>
360
#foreach($data in $onedataList)
361
<td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$oneNumList.get($count2)</td>
362
<td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$oneDenList.get($count2)</td>
363
<td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
364
#set($count2 = $count2 + 1)
366
#set($count1 = $count1 + 1)
372
<textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
373
<div id="headingInfoId">
374
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
376
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">Service Name</td>
377
#foreach($xaxisvalue in $xseriesList)
378
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1">$xaxisvalue</td>
382
#foreach($onedataList in $dataList)
384
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1)</td>
385
#foreach($data in $onedataList)
386
<td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
388
#set($count1 = $count1 + 1)
395
#if($riRadio.equals("indicatorsRadio"))
398
#foreach($service in $selectedServiceList)
400
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted">
401
<tr class="TableHeadingCellStyles">
402
<td style="border-style: dotted; border-width: 1">Service Name</td>
403
#set($surveys = $indicatorSurveyList.get($service))
404
#foreach($survey in $surveys)
405
<td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1">$survey.name</td>
408
<tr class="TableHeadingCellStyles">
409
<td style="border-style: dotted; border-width: 1">$service.name</td>
410
#foreach($survey in $surveys)
411
<td align="center" style="border-style: dotted; border-width: 1">$survey.value</td>
419
#if($selectedButton.equals("ViewSummary"))
424
<iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
429
#if($riRadio.equals("indicatorsRadio"))
430
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
432
<td class="TableHeadingCellStyles" width="30%" 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>
433
<td class="TableHeadingCellStyles" width="30%" 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>
434
<td class="TableHeadingCellStyles" width="20%" 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>
435
<td class="TableHeadingCellStyles" width="20%" 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>
438
#foreach($service in $selectedServiceList)
440
<td class="TableHeadingCellStyles" width="30%" 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">$service.getName()</td>
441
<td class="TableHeadingCellStyles" width="25%" 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>$service.getNumeratorDescription()</u><br>$service.getDenominatorDescription()</td>
442
<td class="TableHeadingCellStyles" width="5%" 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"> X $service.getIndicatorType().getFactor()</td>
443
<td class="TableHeadingCellStyles" width="20%" 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">$numeratorDEList.get($count1)</td>
444
<td class="TableHeadingCellStyles" width="20%" 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">$denominatorDEList.get($count1)</td>
446
#set($count1 = $count1 + 1)
b'\\ No newline at end of file'