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 Import Form</h1>
28
Connecting to database
30
<form id="dataImportForm" name="dataImportForm" action="rimsImport.action" method="post" onsubmit="return formValidations()">
31
<select id="connection" name="connection">
32
#foreach( $connection in $connections.values() )
33
<option value="$connection.Id">$connection.Name</option>
40
<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
49
<select id="rimsDistricts" name="rimsDistricts" style="width:325px;" onchange="getRIMSPHCs()">
50
#foreach($rimsDistrictsOfPHC in $rimsDistrictsOfPHCs)
51
<option value="$rimsDistrictsOfPHC.district_code">$rimsDistrictsOfPHC.district_name</option>
56
<input type="checkbox" id="includeDistrict" name="includeDistrict" checked="checked" >
57
<label for="includeDistrict">Include district-level data in import</label>
59
<td class="NormalB"> </td>
60
<td class="NormalB"> </td>
63
<td class="NormalB"> </td>
64
<td class="NormalB"> </td>
65
<td class="NormalB"> </td>
70
<select multiple size="5" id="availableOrgunits" name="availableOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )">
71
#foreach($rimsPHC in $rimsPHCs)
72
<option value="$rimsPHC.phc_code">$rimsPHC.phc_name</option>
76
<td class="NormalB" align="center">
78
<input type="button" value=">" style="width:40px" onclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )"><br>
79
<input type="button" value="<" style="width:40px" onclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )"><br>
80
<input type="button" value=">>" style="width:40px" onclick="moveAllById( 'availableOrgunits', 'selectedOrgunits' )"><br>
81
<input type="button" value="<<" style="width:40px" onclick="moveAllById( 'selectedOrgunits', 'availableOrgunits' )">
85
<select multiple size="7" id="selectedOrgunits" name="selectedOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )">
90
<td class="NormalB"> </td>
91
<td class="NormalB"> </td>
92
<td class="NormalB"> </td>
97
<select multiple size="7" id="rimsDEGroups" name="rimsDEGroups" style="width:325px; height:85px">
98
#foreach($rimsDegroupKey in $rimsDEGroups.keySet())
99
<option value="$rimsDegroupKey">$rimsDEGroups.get($rimsDegroupKey)</option>
103
<td class="NormalB"> </td>
105
<label for="startDate">$i18n.getString( 'start_date' ) ($i18n.getString( "format.date.label" ))</label><br/>
106
<input type="text" id="startDate" name="startDate" style="width:20em">
107
<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=''">
111
<label for="endDate">$i18n.getString( 'end_date' ) ($i18n.getString( "format.date.label" ))</label><br />
112
<input type="text" id="endDate" name="endDate" style="width:20em">
113
<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=''">
117
<td class="NormalB"> </td>
118
<td class="NormalB"> </td>
119
<td class="NormalB"> </td>
122
<td class="NormalB"> </td>
123
<td class="NormalB"> </td>
124
<td class="NormalB"><input type="submit" name="rimsImport" value='Import from RIMS'/></td>
130
<script type="text/javascript">
133
inputField : "startDate", // id of the input field
134
ifFormat : "$i18n.getString("format.date.label")", // format of the input field
135
button : "getStartDate" // trigger for the calendar (button ID)
139
inputField : "endDate", // id of the input field
140
ifFormat : "$i18n.getString("format.date.label")", // format of the input field
141
button : "getEndDate" // trigger for the calendar (button ID)