Project

General

Profile

Download (4.16 KB) Statistics
| Branch: | Revision:

git_sitools_idoc / webstatDev / idoc_Maison / static / forms.js @ 926b0cfc

1
function checkIfPeriod() {
2
    document.getElementById("dateWebstat").style.display = 'block';
3
    document.getElementById("id_period_date").checked = true;
4
    document.getElementById("id_all_date").checked = false;
5
}
6

    
7
function checkIfAll() {
8
    document.getElementById("dateWebstat").style.display = 'none';
9
    document.getElementById("id_start_date").value = "";
10
    document.getElementById("id_end_date").value = "";
11
    document.getElementById("id_period_date").checked = false;
12
    document.getElementById("id_all_date").checked = true;
13
}
14

    
15
function checkIfDownStat(){
16
    if(document.getElementById("id_is_down_stat").checked){
17
        document.getElementById("id_is_down_stat_by_user").checked = true
18
        document.getElementById("id_is_down_stat_by_ip").checked = true
19
        document.getElementById("id_is_down_stat_by_country").checked = true
20
        document.getElementById("id_is_down_stat_by_months").checked = true
21
        document.getElementById("id_is_down_stat_by_project").checked = true
22
    }
23
    if(!document.getElementById("id_is_down_stat").checked){
24
        document.getElementById("id_is_down_stat_by_user").checked = false
25
        document.getElementById("id_is_down_stat_by_ip").checked = false
26
        document.getElementById("id_is_down_stat_by_country").checked = false
27
        document.getElementById("id_is_down_stat_by_months").checked = false
28
        document.getElementById("id_is_down_stat_by_project").checked = false
29
    }
30
}
31

    
32
function checkIfAccessStat(){
33
    if(document.getElementById("id_is_access_stat").checked){
34
        document.getElementById("id_is_access_access_by_ip").checked = true
35
        document.getElementById("id_is_access_vo_by_ip").checked = true
36
        document.getElementById("id_is_access_access_by_months").checked = true
37
        document.getElementById("id_is_access_vo_by_months").checked = true
38
        document.getElementById("id_is_access_access_by_country").checked = true
39
        document.getElementById("id_is_access_vo_by_country").checked = true
40
    }
41
    if(!document.getElementById("id_is_access_stat").checked){
42
        document.getElementById("id_is_access_access_by_ip").checked = false
43
        document.getElementById("id_is_access_vo_by_ip").checked = false
44
        document.getElementById("id_is_access_access_by_months").checked = false
45
        document.getElementById("id_is_access_vo_by_months").checked = false
46
        document.getElementById("id_is_access_access_by_country").checked = false
47
        document.getElementById("id_is_access_vo_by_country").checked = false
48
    }
49
}
50

    
51
function onChangeApp(){
52
    if(document.getElementById("id_application").value != "HESIOD"){
53
        document.getElementById("id_is_down_stat_by_project").checked = false
54
        document.getElementById("id_is_down_stat_by_project").disabled = true
55
        document.getElementById("id_is_down_stat_by_user").checked = false
56
        document.getElementById("id_is_down_stat_by_user").disabled = true
57
    }else{
58
        document.getElementById("id_is_down_stat_by_project").disabled = false
59
        document.getElementById("id_is_down_stat_by_user").disabled = false
60
    }
61
}
62
function onLoad(){
63
//    document.getElementById("id_is_access_vo_by_ip").disabled = true
64
//    document.getElementById("id_is_access_vo_by_months").disabled = true
65
//    document.getElementById("id_is_access_vo_by_country").disabled = true
66
}
67

    
68

    
69
$(function() {
70
        $( "#id_start_date" ).datepicker();
71
        $( "#id_start_date" ).datepicker( "option", "changeYear", true );
72
        $( "#id_start_date" ).datepicker( "option", "firstDay", 1 );
73
        $( "#id_start_date" ).datepicker( "option", "minDate", new Date(2011, 1 , 1, 1) );
74
        $( "#id_start_date" ).datepicker( "option", "maxDate", "-1m" );
75
        $( "#id_start_date" ).datepicker( "option", "dateFormat", "dd/mm/yy" );
76
});
77
$(function() {
78
        $( "#id_end_date" ).datepicker();
79
        $( "#id_end_date" ).datepicker( "option", "changeYear", true );
80
        $( "#id_end_date" ).datepicker( "option", "firstDay", 1 );
81
        $( "#id_end_date" ).datepicker( "option", "maxDate", "0" );
82
        $( "#id_end_date" ).datepicker( "option", "minDate", new Date(2011, 1 , 1, 1) );
83
        $( "#id_end_date" ).datepicker( "option", "dateFormat", "dd/mm/yy" );
84
});