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

« back to all changes in this revision

Viewing changes to local/in/dhis-web-integration/src/main/webapp/dhis-web-integration/rimsImportForm.vm

  • 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
 
 
2
<script onload="getRIMSPCHs()">
 
3
        function formValidations()
 
4
        {
 
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;               
 
9
                
 
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; }
 
15
                
 
16
                var k=0;
 
17
                for(k=0;k<selOUListlength;k++)
 
18
        {
 
19
                document.dataExportForm.selectedOrgunits.options[k].selected = true;
 
20
        } // for loop end
 
21
                
 
22
        }
 
23
</script>
 
24
 
 
25
<h1>RIMS Import Form</h1>
 
26
<hr />
 
27
<h3>
 
28
        Connecting to database
 
29
</h3>
 
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>
 
34
        #end
 
35
</select>
 
36
 
 
37
<h3>
 
38
        Options
 
39
</h3>
 
40
        <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
 
41
                <colgroup>
 
42
                <col width="325">
 
43
                    <col width="80">
 
44
                    <col width="325">
 
45
            </colgroup>
 
46
        <tr>
 
47
                <td class="NormalB">
 
48
                        RIMS Districts:<br/>
 
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>
 
52
                                #end
 
53
                        </select>
 
54
                        <br />
 
55
                        
 
56
                        <input type="checkbox" id="includeDistrict" name="includeDistrict" checked="checked" >
 
57
                        <label for="includeDistrict">Include district-level data in import</label>
 
58
                </td>   
 
59
            <td class="NormalB">&nbsp;</td>
 
60
            <td class="NormalB">&nbsp;</td>
 
61
        </tr>        
 
62
                <tr>
 
63
                <td class="NormalB">&nbsp;</td>   
 
64
            <td class="NormalB">&nbsp;</td>
 
65
            <td class="NormalB">&nbsp;</td>
 
66
        </tr>
 
67
                <tr>
 
68
                <td class="NormalB">
 
69
                        Available PHCs:<br/>
 
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>
 
73
                        #end
 
74
                </select>
 
75
            </td>
 
76
                <td class="NormalB" align="center">
 
77
                        <br />
 
78
                        <input type="button" value="&gt;" style="width:40px" onclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )"><br>
 
79
                <input type="button" value="&lt;" style="width:40px" onclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )"><br>
 
80
                <input type="button" value="&gt;&gt;" style="width:40px" onclick="moveAllById( 'availableOrgunits', 'selectedOrgunits' )"><br>
 
81
                <input type="button" value="&lt;&lt;" style="width:40px" onclick="moveAllById( 'selectedOrgunits', 'availableOrgunits' )">              
 
82
            </td>
 
83
                <td class="NormalB">
 
84
                        Selected PHCs:<br />
 
85
                        <select multiple size="7" id="selectedOrgunits" name="selectedOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )">
 
86
                        </select>
 
87
                        </td>
 
88
        </tr>
 
89
                <tr>
 
90
                <td class="NormalB">&nbsp;</td>   
 
91
            <td class="NormalB">&nbsp;</td>
 
92
            <td class="NormalB">&nbsp;</td>
 
93
        </tr>
 
94
        <tr>
 
95
                <td class="NormalB">
 
96
                        RIMS Sections:<br/>
 
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>
 
100
                                #end
 
101
                        </select>
 
102
                </td>   
 
103
            <td class="NormalB">&nbsp;</td>
 
104
            <td class="NormalB">            
 
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=''">
 
108
                                
 
109
                                <br /><br />
 
110
                                
 
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=''">                         
 
114
            </td>
 
115
        </tr>        
 
116
                <tr>
 
117
                <td class="NormalB">&nbsp;</td>   
 
118
            <td class="NormalB">&nbsp;</td>
 
119
            <td class="NormalB">&nbsp;</td>
 
120
        </tr>
 
121
                <tr>
 
122
                <td class="NormalB">&nbsp;</td>   
 
123
            <td class="NormalB">&nbsp;</td>
 
124
            <td class="NormalB"><input type="submit" name="rimsImport" value='Import from RIMS'/></td>
 
125
        </tr>
 
126
        
 
127
        </table>
 
128
</form>
 
129
 
 
130
<script type="text/javascript">
 
131
        
 
132
        Calendar.setup({
 
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)
 
136
    });
 
137
        
 
138
        Calendar.setup({
 
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)
 
142
    });
 
143
</script>
 
144