~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/rimsExportForm.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 Export Form</h1>
 
26
<hr />
 
27
<h3>
 
28
        Connecting to database
 
29
</h3>
 
30
 
 
31
<form id="dataExportForm" name="dataExportForm" action="rimsExport.action" method="post" onsubmit="return formValidations()">
 
32
 
 
33
<select id="connection" name="connection">
 
34
        #foreach( $connection in $connections.values() )
 
35
                <option value="$connection.Id">$connection.Name</option>
 
36
        #end
 
37
</select>
 
38
 
 
39
<h3>
 
40
        Options
 
41
</h3>
 
42
 
 
43
        <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
 
44
                <colgroup>
 
45
                <col width="325">
 
46
                    <col width="80">
 
47
                    <col width="325">
 
48
            </colgroup>
 
49
        <tr>
 
50
                <td class="NormalB">
 
51
                        RIMS Districts:<br/>
 
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>
 
55
                                #end
 
56
                        </select>
 
57
                        <br />
 
58
                        
 
59
                        <input type="checkbox" id="includeDistrict" name="includeDistrict" checked="checked">
 
60
                        <label for="includeDistrict">Include district-level data in export</label>
 
61
                </td>   
 
62
            <td class="NormalB">&nbsp;</td>
 
63
            <td class="NormalB">&nbsp;</td>
 
64
        </tr>        
 
65
                <tr>
 
66
                <td class="NormalB">&nbsp;</td>   
 
67
            <td class="NormalB">&nbsp;</td>
 
68
            <td class="NormalB">&nbsp;</td>
 
69
        </tr>
 
70
                <tr>
 
71
                <td class="NormalB">
 
72
                        Available PHCs:<br/>
 
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>
 
76
                        #end
 
77
                </select>
 
78
            </td>
 
79
                <td class="NormalB" align="center">
 
80
                        <br />
 
81
                        <input type="button" value="&gt;" style="width:40px" onclick="moveSelectedById( 'availableOrgunits', 'selectedOrgunits' )"><br>
 
82
                <input type="button" value="&lt;" style="width:40px" onclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )"><br>
 
83
                <input type="button" value="&gt;&gt;" style="width:40px" onclick="moveAllById( 'availableOrgunits', 'selectedOrgunits' )"><br>
 
84
                <input type="button" value="&lt;&lt;" style="width:40px" onclick="moveAllById( 'selectedOrgunits', 'availableOrgunits' )">              
 
85
            </td>
 
86
                <td class="NormalB">
 
87
                        Selected PHCs:<br />
 
88
                        <select multiple size="7" id="selectedOrgunits" name="selectedOrgunits" style="width:325px; height:85px" ondblclick="moveSelectedById( 'selectedOrgunits', 'availableOrgunits' )">
 
89
                        </select>
 
90
                        </td>
 
91
        </tr>
 
92
                <tr>
 
93
                <td class="NormalB">&nbsp;</td>   
 
94
            <td class="NormalB">&nbsp;</td>
 
95
            <td class="NormalB">&nbsp;</td>
 
96
        </tr>
 
97
        <tr>
 
98
                <td class="NormalB">
 
99
                        RIMS Sections:<br/>
 
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>
 
103
                                #end
 
104
                        </select>
 
105
                </td>   
 
106
            <td class="NormalB">&nbsp;</td>
 
107
            <td class="NormalB">            
 
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=''">
 
111
                                
 
112
                                <br /><br />
 
113
                                
 
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=''">                         
 
117
            </td>
 
118
        </tr>        
 
119
                <tr>
 
120
                <td class="NormalB">&nbsp;</td>   
 
121
            <td class="NormalB">&nbsp;</td>
 
122
            <td class="NormalB">&nbsp;</td>
 
123
        </tr>
 
124
                <tr>
 
125
                <td class="NormalB">&nbsp;</td>   
 
126
            <td class="NormalB">&nbsp;</td>
 
127
            <td class="NormalB"><input type="submit" name="rimsExport" value='Export To RIMS'/></td>
 
128
        </tr>
 
129
        
 
130
        </table>
 
131
</form>
 
132
 
 
133
<script type="text/javascript">
 
134
        
 
135
        Calendar.setup({
 
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)
 
139
    });
 
140
        
 
141
        Calendar.setup({
 
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)
 
145
    });
 
146
</script>
 
147