~dhis2-devs-core/dhis2/dhis2-patient-tz

« back to all changes in this revision

Viewing changes to local/tz/dhis-web-caseentry-tz/src/main/webapp/dhis-web-caseentry/nbitsReportsForm.vm

  • Committer: John Francis Mukulu
  • Date: 2011-08-09 06:36:18 UTC
  • mfrom: (4244.1.21 dhis2)
  • Revision ID: john.f.mukulu@gmail.com-20110809063618-wad1pcc9fd1mnc6k
[merge]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
<script>
3
 
 
4
 
    function showOrHideDates()
5
 
    {
6
 
        var includePeriodChecked = document.getElementById( "includePeriod" ).checked;
7
 
 
8
 
        if( includePeriodChecked == true )
9
 
        {
10
 
            jQuery("#periodTR").show();
11
 
        }
12
 
        else
13
 
        {
14
 
            jQuery("#periodTR").hide();
15
 
        }
16
 
    }
17
 
 
18
 
    function formValidations()
19
 
    {
20
 
        var includePeriodChecked = document.getElementById( "includePeriod" ).checked;
21
 
        var programList = document.getElementById( "programList" );
22
 
        var orgunitIdValue = document.reportForm.ouIDTB.value;
23
 
        var startDateValue = document.reportForm.startDate.value;
24
 
        var endDateValue = document.reportForm.endDate.value;
25
 
 
26
 
        if( programList.selectedIndex < 0 || programList.options[programList.selectedIndex].text == null ) { alert("Please Select Report"); return false; }
27
 
        else if( orgunitIdValue == null || orgunitIdValue == "" ) { alert("Please Select OrganisationUnit"); return false; }
28
 
        else if( includePeriodChecked == true )
29
 
        {
30
 
            if( startDateValue == null || startDateValue== "" || endDateValue == null || endDateValue=="" ) { alert("Please Select Start Date And End Date"); return false; }
31
 
            else if( startDateValue > endDateValue ) { alert("Start Date Is Greater Than End Date"); return false; }
32
 
        }
33
 
 
34
 
        return true;
35
 
    }
36
 
 
37
 
</script>
38
 
 
39
 
<h3>NBITS Report Analyser</h3>
40
 
<hr /><br />
41
 
 
42
 
<form id="reportForm" name="reportForm" action="generateNBITSReport.action" method="post" onsubmit="return formValidations()" target="_blank">
43
 
    <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
44
 
        <tr>
45
 
            <td class="NormalB">
46
 
                Program List :<br />
47
 
                <select id="programList" name="programList" style="width:200px">
48
 
                #foreach($program in $programList)
49
 
                    <option value="$program.id">$program.name</option>
50
 
                #end
51
 
                </select>
52
 
            </td>
53
 
            <td class="NormalB">
54
 
                OrganisationUnit : <br />
55
 
                <input type="text" name="ouNameTB" id="ouNameTB" style="width:175px" disabled = "disabled">
56
 
            </td>
57
 
        </tr>
58
 
        <tr>
59
 
            <td>&nbsp;</td>
60
 
            <td>&nbsp;</td>
61
 
        </tr>
62
 
        <tr id="periodTR">
63
 
            <td class="NormalB">
64
 
                <label for="startDate" id="lblStartDate">$i18n.getString( 'start_date' ) ($i18n.getString( "format.date.label" ))</label><br/>
65
 
                <input type="text" id="startDate" name="startDate" style="width:175px">
66
 
            </td>
67
 
            <td class="NormalB">
68
 
                <label for="endDate" id="lblEndDate">$i18n.getString( 'end_date' ) ($i18n.getString( "format.date.label" ))</label><br />
69
 
                <input type="text" id="endDate" name="endDate" style="width:175px">
70
 
            </td>
71
 
        </tr>
72
 
        <tr>
73
 
            <td>&nbsp;</td>
74
 
            <td>&nbsp;</td>
75
 
        </tr>
76
 
        <tr>
77
 
            <td>&nbsp;</td>
78
 
            <td>&nbsp;</td>
79
 
        </tr>
80
 
        <tr>
81
 
            <td>&nbsp;</td>
82
 
            <td>
83
 
                <input type="checkbox" name="includePeriod" onChange="return showOrHideDates()" id="includePeriod" checked>Report With Specified Period
84
 
                <br/><br/>
85
 
                <input type="submit" name="generate" value='Generate Report' #if( $!programList.size() == 0 ) disabled="disabled" #end>
86
 
                <input type="hidden" name="ouIDTB" id="ouIDTB" />
87
 
            </td>
88
 
        </tr>
89
 
    </table>
90
 
</form>
91
 
 
92
 
<script type="text/javascript">
93
 
    jQuery( function(){
94
 
            datePickerInRange( "startDate", "endDate", false, false );
95
 
    });
96
 
</script>