summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/collectData.js
blob: 704e0545a8282f47a7540502f064f299c86573ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32



// Ce generiramo veliko datoteko, prikazemo popup za loading in poklicemo generiranje preko ajaxa
function collectDataAjax(){

    var srv_meta_anketa_id = $("#srv_meta_anketa_id").val();    

    $('#fade').fadeTo('slow', 1);

    // Prikazemo popup
    $('#collect_data_popup').fadeIn('slow', function(){
        
        // Poklicemo ajax za generiranje datoteke
        $.ajax({
            type: 'POST',
            async: false,
            url:  'ajax.php?t=dataFile&a=prepareFiles',
            data: {anketa:srv_meta_anketa_id},
            success:  function(response) {

                // Uspesno kreirana datoteka
                if(response == '1'){
                    location.reload(); 
                }
                else{
                    alert(lang['srv_collectdata_failed']);
                }
            }
        });  
    });
}