2
<script onload="getRIMSPCHs()">
3
function formValidations()
5
var selOUListlength = document.dataExportForm.selectedOrgunits.options.length;
6
var sDateVal = document.dataExportForm.startDate.value;
7
var eDateVal = document.dataExportForm.endDate.value;
8
var selSectionIndex = document.dataExportForm.rimsDEGroups.selectedIndex;
10
// Allow zero-length orgunit selection since district is checked off separately.
11
// if(selOUListlength <= 0) { alert("Please Select OrgUnit(s)"); return false; }
12
else if(sDateVal == null || sDateVal == "" || eDateVal == null || eDateVal == "") { alert("Please Select Period"); return false; }
13
else if(sDateVal > eDateVal) { alert("StartDate is Greater than EndDate"); return false; }
14
else if(selSectionIndex < 0) { alert("Please Select RIMS Section(s)"); return false; }
17
for(k=0;k<selOUListlength;k++)
19
document.dataExportForm.selectedOrgunits.options[k].selected = true;
25
<h1>RIMS Export Form</h1>
28
Connecting to database
31
<form id="dataExportForm" name="dataExportForm" action="rimsExport.action" method="post" onsubmit="return formValidations()">
33
<select id="connection" name="connection">
34
#foreach( $connection in $connections.values() )
35
<option value="$connection.Id">$connection.Name</option>
43
<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
52
<select id="rimsDistricts" name="rimsDistricts" style="width:325px;" onchange="getRIMSPHCs()">
53
#foreach($rimsDistrictsOfPHC in $rimsDistrictsOfPHCs)
54
<option value="$rimsDistrictsOfPHC.district_code">$rimsDistrictsOfPHC.district_name</option>
59
<input type="checkbox" id="includeDistrict" name="includeDistrict" checked="checked">
60
<label for="includeDistrict">Include district-level data in export</label>
62
<td class="NormalB"> </td>
63
<td class="NormalB"> </td>
66
<td class="NormalB"> </td>
67
<td class="NormalB"> </td>
68
<td class="NormalB"> </td>
73
<select multiple size="5" id="availableOrgunits" name="availableOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )">
74
#foreach($rimsPHC in $rimsPHCs)
75
<option value="$rimsPHC.phc_code">$rimsPHC.phc_name</option>
79
<td class="NormalB" align="center">
81
<input type="button" value=">" style="width:40px" onclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )"><br>
82
<input type="button" value="<" style="width:40px" onclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )"><br>
83
<input type="button" value=">>" style="width:40px" onclick="moveAllById( 'availableOrgunits', 'selectedOrgunits' )"><br>
84
<input type="button" value="<<" style="width:40px" onclick="moveAllById( 'selectedOrgunits', 'availableOrgunits' )">
88
<select multiple size="7" id="selectedOrgunits" name="selectedOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )">
93
<td class="NormalB"> </td>
94
<td class="NormalB"> </td>
95
<td class="NormalB"> </td>
100
<select multiple size="7" id="rimsDEGroups" name="rimsDEGroups" style="width:325px; height:85px">
101
#foreach($rimsDegroupKey in $rimsDEGroups.keySet())
102
<option value="$rimsDegroupKey">$rimsDEGroups.get($rimsDegroupKey)</option>
106
<td class="NormalB"> </td>
108
<label for="startDate">$i18n.getString( 'start_date' ) ($i18n.getString( "format.date.label" ))</label><br/>
109
<input type="text" id="startDate" name="startDate" style="width:20em">
110
<img src="../images/calendar_icon.gif" width="16" height="16" id="getStartDate" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''">
114
<label for="endDate">$i18n.getString( 'end_date' ) ($i18n.getString( "format.date.label" ))</label><br />
115
<input type="text" id="endDate" name="endDate" style="width:20em">
116
<img src="../images/calendar_icon.gif" width="16" height="16" id="getEndDate" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''">
120
<td class="NormalB"> </td>
121
<td class="NormalB"> </td>
122
<td class="NormalB"> </td>
125
<td class="NormalB"> </td>
126
<td class="NormalB"> </td>
127
<td class="NormalB"><input type="submit" name="rimsExport" value='Export To RIMS'/></td>
133
<script type="text/javascript">
136
inputField : "startDate", // id of the input field
137
ifFormat : "$i18n.getString("format.date.label")", // format of the input field
138
button : "getStartDate" // trigger for the calendar (button ID)
142
inputField : "endDate", // id of the input field
143
ifFormat : "$i18n.getString("format.date.label")", // format of the input field
144
button : "getEndDate" // trigger for the calendar (button ID)