summaryrefslogtreecommitdiffstats
path: root/admin/survey/izvoz.php
blob: af30516962eab6640766fce49fb0b45463ee5d0b (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
<?php

//set_time_limit(1800);

include_once('definition.php');
include_once('../../function.php');
include_once('../../vendor/autoload.php');

global $site_path, $global_user_id, $admin_type, $lang;


# error reporting
if(isDebug()){
	error_reporting(E_ALL ^ E_NOTICE);
	ini_set('display_errors', '1');
}
else{
	//error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
	error_reporting(0);
	ini_set('display_errors', '0');
}


/****** DEFINITIONS ******/
define("M_ANALIZA_DESCRIPTOR", "descriptor");
define("M_ANALIZA_FREQUENCY", "frequency");
define("M_ANALIZA_CROSSTAB", "crosstabs");
define("M_ANALIZA_STATISTICS", "statistics");
define("M_ANALIZA_SUMS", "sums");

/*PDF*/
define("A_REPORT_VPRASALNIK_PDF", "vprasalnik_pdf");
define("A_REPORT_PDF_RESULTS","pdf_results");
define("A_REPORT_PDF_COMMENT","pdf_comment");
define("M_REPORT_ANALIZA_PDF_FREKVENCA","frequency");
define("M_REPORT_ANALIZA_PDF_CROSSTAB_IZPIS","crosstabs_izpis");
define("M_REPORT_ANALIZA_PDF_MULTICROSSTAB_IZPIS","multicrosstabs_izpis");
define("M_REPORT_ANALIZA_PDF_MEAN_IZPIS","mean_izpis");
define("M_REPORT_ANALIZA_PDF_TTEST_IZPIS","ttest_izpis");
define("M_REPORT_ANALIZA_PDF_BREAK_IZPIS","break_izpis");
define("M_REPORT_ANALIZA_PDF_STAT","statistics");
define("M_REPORT_ANALIZA_PDF_CHARTS","charts");
define("M_REPORT_ANALIZA_PDF_SUMS","sums");
define("M_REPORT_ANALIZA_PDF_CREPORT","creport_pdf");
define("A_REPORT_PDF_STATUS","status");
define("A_REPORT_PDF_EDITS_ANALYSIS","editsAnalysis");
define("A_REPORT_PDF_LIST","list_pdf");
define("M_REPORT_PDF_EVOLI","pdf_evoli");
define("M_REPORT_PDF_TEAMMETER","pdf_teammeter");
define("M_REPORT_PDF_EMPLOYMETER","pdf_employmeter");
define("M_REPORT_PDF_MFDPS","pdf_mfpds");
define("M_REPORT_PDF_MJU","pdf_mju");
define("M_REPORT_PDF_MJU2","pdf_mju2");
define("M_REPORT_PDF_NIJZ","pdf_nijz");
define("M_REPORT_XLS_NIJZ_PUBLIC","xls_nijz_public");
define("M_REPORT_BORZA","borza_chart");
define("M_REPORT_PDF_HEATMAP_IMAGE","heatmap_image_pdf");
define("M_REPORT_HIERARHIJA_PDF_IZPIS", "hierarhija_pdf_izpis");

/*RTF*/
define("A_REPORT_VPRASALNIK_RTF", "vprasalnik_rtf");
define("A_REPORT_RTF_RESULTS", "rtf_results");
define("A_REPORT_RTF_COMMENT","rtf_comment");
define("M_REPORT_ANALIZA_RTF_FREKVENCA", "frequency_rtf");
define("M_REPORT_ANALIZA_RTF_CROSSTAB_IZPIS", "crosstabs_izpis_rtf");
define("M_REPORT_ANALIZA_RTF_MULTICROSSTAB_IZPIS", "multicrosstabs_izpis_rtf");
define("M_REPORT_ANALIZA_RTF_MEAN_IZPIS", "mean_izpis_rtf");
define("M_REPORT_ANALIZA_RTF_TTEST_IZPIS", "ttest_izpis_rtf");
define("M_REPORT_ANALIZA_RTF_BREAK_IZPIS", "break_izpis_rtf");
define("M_REPORT_ANALIZA_RTF_STAT", "statistics_rtf");
define("M_REPORT_ANALIZA_RTF_SUMS", "sums_rtf");
define("M_REPORT_ANALIZA_RTF_CHARTS", "charts_rtf");
define("M_REPORT_ANALIZA_RTF_CREPORT", "creport_rtf");
define("A_REPORT_RTF_LIST", "list_rtf");
define("M_REPORT_ANALIZA_RTF_HEATMAP_IMAGE","heatmap_image_rtf");

/*XLS*/
define("M_REPORT_ANALIZA_XLS_STAT", "statistics_xls");
define("M_REPORT_ANALIZA_XLS_FREKVENCA", "frequency_xls");
define("M_REPORT_ANALIZA_XLS_CROSSTAB_IZPIS", "crosstabs_izpis_xls");
define("M_REPORT_ANALIZA_XLS_MULTICROSSTAB_IZPIS", "multicrosstabs_izpis_xls");
define("M_REPORT_ANALIZA_XLS_SUMS", "sums_xls");
define("M_REPORT_ANALIZA_XLS_MEAN_IZPIS", "mean_izpis_xls");
define("M_REPORT_ANALIZA_XLS_TTEST_IZPIS", "ttest_izpis_xls");
define("M_REPORT_ANALIZA_XLS_BREAK_IZPIS", "break_izpis_xls");
define("A_REPORT_XLS_LIST", "list_xls");
define("A_REPORT_XLS_USABLE", "usable_xls");
define("A_REPORT_XLS_SPEEDER", "speeder_xls");
define("A_REPORT_XLS_TEXT_ANALYSIS", "text_analysis_xls");
define("A_REPORT_CSV_TEXT_ANALYSIS", "text_analysis_csv");
define("M_REPORT_CSV_MAZA_USERS", "maza_csv");
define("M_REPORT_CSV_ADVANCED_PARADATA", "advanced_paradata_csv");
define("M_REPORT_XLS_ADVANCED_TIMESTAMPS", "advanced_timestamps_xls");

/*JSON*/
define("M_REPORT_JSON_SURVEY_EXPORT", "json_survey");

/*PPT*/
define("M_REPORT_ANALIZA_PPT_CHARTS", "charts_ppt");
define("M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE","heatmap_image_ppt");

/*IMAGE*/
define("M_REPORT_ANALIZA_HEATMAP_IMAGE", "heatmap_image");



# če pridemo iz rekodiranga urlja
if (!isset($_GET['anketa']) && isset($_GET['dc']) && $_GET['dc'] != null) {
	$data = $_GET['dc'];
	$data = base64_decode($data);
	$data = unserialize($data);
	foreach ($data AS $get_param => $value) {
		if ($get_param != null && $get_param != '' && $value != null && $value != '' && $value != 'undefined') {
			$_GET[$get_param] = $value;
		}
	}
}

$anketa = isset($_GET['anketa']) ? $_GET['anketa'] : '';
$a = isset($_GET['a']) ? $_GET['a'] : '';
$m = isset($_GET['m']) ? $_GET['m'] : '';

# PDF lahko vidijo vsi, ki kliknejo na link za kreacijo PDF-ja
# zato, kadar uporabnik ni logiran v CMS za pdf nastavimo $global_user_id kateri je enak avtorju ankete
if ($global_user_id === null || $global_user_id === 0) {
	$sql = sisplet_query("SELECT insert_uid FROM srv_anketa WHERE id='$anketa'");
	$row = mysqli_fetch_assoc($sql);
	$global_user_id = $row['insert_uid'];
}

SurveyInfo::SurveyInit($anketa);
$lang_admin = SurveyInfo::getInstance()->getSurveyColumn('lang_admin');
// nastavimo jezik
$file = '../../lang/'.$lang_admin.'.php';
include($file);


/****** PREVERIMO CE IZVAJAMO NOV ALI STAR EXPORT ******/
// GDPR so vedno novi izvozi
if(in_array($a, array('pdf_gdpr_individual', 'pdf_gdpr_activity', 'rtf_gdpr_individual', 'rtf_gdpr_activity'))){
    $export_type = 'new';
}
// Posebna porocila, ki so vedno stari izvozi
elseif(in_array($m, array('pdf_teammeter','pdf_employmeter', 'pdf_evoli', 'maza_csv', 'borza_csv', 'pdf_mju', 'pdf_mju2', 'advanced_paradata_csv', 'advanced_timestamps_xls', 'json_survey', 'pdf_nijz', 'xls_nijz_public'))){
    $export_type = 'old';
}
// Ce imamo vklopljeno nastavitev za nove izvoze
elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new'){
    $export_type = 'new';
}
// Ce imamo vklopljeno nastavitev za nove izvoze samo za admine
elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new_admin' && $admin_type == 0){ 
    $export_type = 'new';
}
else{
    $export_type = 'old';
}
    

/****** IZVEDEMO NOV EXPORT ******/
if($export_type == 'new'){

    //error_reporting(E_ALL ^ E_NOTICE);
    //ini_set('display_errors', '1');

    ini_set('memory_limit', '1024M');
    ini_set('max_input_time', 480);
    ini_set('max_input_time', 8000);

	$export = new ExportController();
	$export->executeExport();

	die();
}


/****** IZVEDEMO STAR EXPORT ******/
# uporabnik ima dostop do ankete, preverimo še ali lahko pogleda userja
switch ($a) {
	case A_REPORT_VPRASALNIK_PDF:
		include($site_path.'admin/exportclases/class.pdfIzvoz.php');	
		
		$type = ($_GET['type'] == 1) ? 1 : 0;
		$izvoz = new PdfIzvoz ($_GET['anketa'], $type);
		$izvoz->setDisplayFrontPage(true);
		$izvoz->createPdf();
		
		$izvoz->getFile('pdf_vprasalnik'.time().'.pdf');
		break;

	case A_REPORT_VPRASALNIK_RTF:
		include($site_path.'admin/exportclases/class.rtfIzvoz.php');
		
		$type = ($_GET['type'] == 1) ? 1 : 0;
		$izvoz = new RtfIzvoz ($_GET['anketa'], $type);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_vprasalnik.rtf');
		break;
	
	case A_REPORT_RTF_RESULTS:
		include($site_path.'admin/exportclases/class.rtfIzvozResults.php');
		//include($site_path.'admin/exportclases/class.rtfIzvoz.php');
		//$izvoz = new RtfIzvozResults ($_GET['anketa']);			
		$izvoz = new RtfIzvozResults ($_GET['anketa'], $_GET['pdf_usr_type'], $_GET['pdf_usr_id']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
		break;
	
	case A_REPORT_PDF_RESULTS:
		include ($site_path.'admin/exportclases/class.pdfIzvozResults.php');
		//include($site_path.'admin/exportclases/class.pdfIzvoz.php');
		//$izvoz = new PdfIzvozResults ($_GET['anketa']);
		$izvoz = new PdfIzvozResults ($_GET['anketa'], $_GET['pdf_usr_type'], $_GET['pdf_usr_id']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case A_REPORT_PDF_COMMENT:
		include($site_path.'admin/exportclases/class.pdfIzvoz.php');
		
		$commentType = (isset($_GET['only_unresolved'])) ? $_GET['only_unresolved'] : 1;
		$izvoz = new PdfIzvoz ($_GET['anketa'], $allResults=2, $commentType);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case A_REPORT_RTF_COMMENT:
		include($site_path.'admin/exportclases/class.rtfIzvoz.php');
		
		$commentType = (isset($_GET['only_unresolved'])) ? $_GET['only_unresolved'] : 1;
		$izvoz = new RtfIzvoz ($_GET['anketa'], $allResults=2, $commentType);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
			
	case A_REPORT_PDF_STATUS:		
		//poberemo tabelo s podatki
		$ssData = explode(",", $_GET['data']);
		
		include ($site_path.'admin/exportclases/class.pdfIzvozStatus.php');
		$izvoz = new PdfIzvozStatus ($_GET['anketa'], $ssData);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_status'.time().'.pdf');
			break;
                    
        case A_REPORT_PDF_EDITS_ANALYSIS:
		include ($site_path.'admin/exportclases/class.pdfIzvozEditsAnalysis.php');
		$izvoz = new PdfIzvozEditsAnalysis ($_GET['anketa'], $ssData);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_EditsAnalysis'.time().'.pdf');
			break;
			
	case A_REPORT_PDF_LIST:			
		include ($site_path.'admin/exportclases/class.pdfIzvozList.php');
		$izvoz = new PdfIzvozList ($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_status'.time().'.pdf');
			break;
			
	case A_REPORT_RTF_LIST:					
		include ($site_path.'admin/exportclases/class.rtfIzvozList.php');
		$izvoz = new RtfIzvozList ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
			
	case A_REPORT_XLS_LIST:					
		include ($site_path.'admin/exportclases/class.xlsIzvozList.php');
		$izvoz = new XlsIzvozList ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;		
}
	
switch ($m) {

	//////////////////HEATMAP IMAGE/////////
	case M_REPORT_ANALIZA_HEATMAP_IMAGE:
			include ($site_path.'admin/exportclases/class.imageIzvozHeatmap.php');	
			$izvoz = new imageIzvozHeatmap ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
			$izvoz->getFile('heatmap'.$_GET['sprID'].'.png');
		break;
	
	////////////////////////////////////////
	
	//////////////////EVOLI/////////////////
	case M_REPORT_PDF_EVOLI:
	
        $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; 
        $anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0; 
        
		$evoli = new SurveyEvoli($anketa);
		$evoli->executeExport($usr_id);
			break;
			
	case M_REPORT_PDF_TEAMMETER:
	
		$skupina = (isset($_GET['skupina']) && $_GET['skupina'] > 0) ? $_GET['skupina'] : 0; 
		$anketa = (isset($_GET['ank_id']) && $_GET['ank_id'] > 0) ? $_GET['ank_id'] : 0; 
		$anketa = ($anketa == 0 && isset($_GET['anketa'])) ? $_GET['anketa'] : $anketa; 
		
		$evoli_tm = new SurveyTeamMeter($anketa);
		$evoli_tm->executeExport($skupina);
            break;
            
    case M_REPORT_PDF_EMPLOYMETER:

        $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0;
        $anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0; 

        $evoli_em = new SurveyEmployMeter($anketa);
        $evoli_em->executeExport($usr_id);
            break;
	/////////////////////////////////////
			
	//////////////////MJU/////////////////
	case M_REPORT_PDF_MJU:
		
		$type = (isset($_GET['type'])) ? $_GET['type'] : 1;
		$enota = (isset($_GET['enota'])) ? $_GET['enota'] : 0;
		
		$sme = new SurveyMJUEnote($_GET['anketa']);
		$sme->executeExport($type, $enota);
			break;
    /////////////////////////////////////
    
    //////////////////MJU2/////////////////
	case M_REPORT_PDF_MJU2:
		
		$type = (isset($_GET['type'])) ? $_GET['type'] : 1;
		$enota = (isset($_GET['enota'])) ? $_GET['enota'] : 0;
		
		$sme = new SurveyMJUEnote($_GET['anketa']);
		$sme->executeExport2($type, $enota);
			break;
	/////////////////////////////////////

    //////////////////NIJZ/////////////////
	case M_REPORT_PDF_NIJZ:
		
		$usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0;
        $anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0; 

        $nijz = new SurveyNIJZ($anketa, $usr_id, $nijz_type='2');
        $nijz->createReport2();
			break;

	case M_REPORT_XLS_NIJZ_PUBLIC:

		$anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0; 

		$nijz = new SurveyNIJZPublic($anketa);
		$nijz->executeExport();
			break;
	/////////////////////////////////////
			
	//////////////////MFDPS/////////////////
	case M_REPORT_PDF_MFDPS:
	
		$usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; 
		$mfdps = new SurveyMFDPS($_GET['anketa']);
		$mfdps->executePDFExport($usr_id);
			break;
	/////////////////////////////////////
	
	//////////////////BORZA/////////////////
	case M_REPORT_BORZA:
	
		$usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; 
		$borza = new SurveyBORZA($_GET['anketa']);
		$borza->executeChartExport($usr_id);
			break;
	/////////////////////////////////////


    ///////////// HIERARHIJA /////////////
    case M_REPORT_HIERARHIJA_PDF_IZPIS:
        include ($site_path.'admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php');
        $izvoz = new \Hierarhija\HierarhijaIzvozAnalize($_GET['anketa']);
        $izvoz->createPdf();

        $izvoz->getFile('pdf_analiza1'.time().'.pdf');
        break;
    /////////////////////////////////////

	//////////////////PDF/////////////////
	case M_REPORT_ANALIZA_PDF_FREKVENCA:
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaFrekvenca.php');
		$izvoz = new PdfIzvozAnalizaFrekvenca ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza.pdf');
			break;	
	
	case M_REPORT_ANALIZA_PDF_CROSSTAB_IZPIS:
		
		//poberemo tabelo s podatki
		$crossData1 = explode(",", $_GET['data1']);
		$crossData2 = explode(",", $_GET['data2']);
		
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaCrosstab.php');
		$izvoz = new PdfIzvozAnalizaCrosstab ($_GET['anketa'], $crossData1, $crossData2);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;	
			
	case M_REPORT_ANALIZA_PDF_MULTICROSSTAB_IZPIS:
					
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaMultiCrosstab.php');
		$izvoz = new PdfIzvozAnalizaMultiCrosstab($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_MEAN_IZPIS:
		
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaMean.php');
		$izvoz = new PdfIzvozAnalizaMean ($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_TTEST_IZPIS:

		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaTTest.php');
		$izvoz = new PdfIzvozAnalizaTTest ($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_BREAK_IZPIS:

		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaBreak.php');
		$izvoz = new PdfIzvozAnalizaBreak ($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza'.time().'.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_STAT:
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaOpisne.php');
		$izvoz = new PdfIzvozAnalizaOpisne ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza.pdf');
			break;	

	case M_REPORT_ANALIZA_PDF_SUMS:
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaSums.php');
		$izvoz = new PdfIzvozAnalizaSums ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_CHARTS:
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaCharts.php');
		$izvoz = new PdfIzvozAnalizaCharts ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza.pdf');
			break;
			
	case M_REPORT_ANALIZA_PDF_CREPORT:
		include ($site_path.'admin/exportclases/class.pdfIzvozAnalizaCReport.php');
		$izvoz = new PdfIzvozAnalizaCReport ($_GET['anketa']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_analiza.pdf');
			break;
			
	case M_REPORT_PDF_HEATMAP_IMAGE:
		include ($site_path.'admin/exportclases/class.pdfIzvozHeatmapImage.php');		
		$izvoz = new PdfIzvozHeatmapImage ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPdf();

		$izvoz->getFile('pdf_heatmap_image_'.$_GET['sprID'].'.pdf');
		break;
	
	/////////////////////////////////////		
	
	
	/////////////////RTF//////////////////
	case M_REPORT_ANALIZA_RTF_STAT:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaOpisne.php');
		$izvoz = new RtfIzvozAnalizaOpisne ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_SUMS:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaSums.php');
		$izvoz = new RtfIzvozAnalizaSums ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
	
	case M_REPORT_ANALIZA_RTF_FREKVENCA:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaFrekvenca.php');
		$izvoz = new RtfIzvozAnalizaFrekvenca ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;	
	
	case M_REPORT_ANALIZA_RTF_CROSSTAB_IZPIS:
		//poberemo tabelo s podatki
		$crossData1 = explode(",", $_GET['data1']);
		$crossData2 = explode(",", $_GET['data2']);
		
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaCrosstab.php');
		$izvoz = new RtfIzvozAnalizaCrosstab ($_GET['anketa'], $crossData1, $crossData2);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza'.time().'.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_MULTICROSSTAB_IZPIS:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaMultiCrosstab.php');
		$izvoz = new RtfIzvozAnalizaMultiCrosstab ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza'.time().'.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_MEAN_IZPIS:
		
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaMean.php');
		$izvoz = new RtfIzvozAnalizaMean ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza'.time().'.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_TTEST_IZPIS:
		
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaTTest.php');
		$izvoz = new RtfIzvozAnalizaTTest ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza'.time().'.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_BREAK_IZPIS:
		
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaBreak.php');
		$izvoz = new RtfIzvozAnalizaBreak ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza'.time().'.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_CHARTS:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaCharts.php');
		$izvoz = new RtfIzvozAnalizaCharts ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_CREPORT:
		include ($site_path.'admin/exportclases/class.rtfIzvozAnalizaCReport.php');
		$izvoz = new RtfIzvozAnalizaCReport ($_GET['anketa']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza.rtf');
			break;
			
	case M_REPORT_ANALIZA_RTF_HEATMAP_IMAGE:
		include ($site_path.'admin/exportclases/class.rtfIzvozHeatmapImage.php');
		$izvoz = new rtfIzvozHeatmapImage ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createRtf();

		$izvoz->getFile('rtf_analiza_heatmap_image_'.$_GET['sprID'].'.rtf');
			break;
	/////////////////////////////////////////
	
	
	/////////////////XLS/////////////////////
	case M_REPORT_ANALIZA_XLS_FREKVENCA:
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaFrekvenca.php');
		$izvoz = new XlsIzvozAnalizaFrekvenca ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;	
	
	case M_REPORT_ANALIZA_XLS_CROSSTAB_IZPIS:
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaCrosstab.php');

		//poberemo tabelo s podatki
		$crossData1 = explode(",", $_GET['data1']);
		$crossData2 = explode(",", $_GET['data2']);
		
		$izvoz = new XlsIzvozAnalizaCrosstab ($_GET['anketa'], $crossData1, $crossData2);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;
			
	case M_REPORT_ANALIZA_XLS_MULTICROSSTAB_IZPIS:
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaMultiCrosstab.php');
		$izvoz = new XlsIzvozAnalizaMultiCrosstab ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;
	
	case M_REPORT_ANALIZA_XLS_STAT:
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaStatistics.php');
		$izvoz = new XlsIzvozAnalizaStatistics ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;
	
	case M_REPORT_ANALIZA_XLS_SUMS:
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaSums.php');
		$izvoz = new XlsIzvozAnalizaSums ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza.xls');
			break;
			
	case M_REPORT_ANALIZA_XLS_MEAN_IZPIS:
		
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaMean.php');
		$izvoz = new XlsIzvozAnalizaMean ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza'.time().'.xls');
			break;
			
	case M_REPORT_ANALIZA_XLS_TTEST_IZPIS:
		
		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaTTest.php');
		$izvoz = new XlsIzvozAnalizaTTest ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza'.time().'.xls');
			break;
			
	case M_REPORT_ANALIZA_XLS_BREAK_IZPIS:

		include ($site_path.'admin/exportclases/class.xlsIzvozAnalizaBreak.php');
		$izvoz = new XlsIzvozAnalizaBreak ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_analiza'.time().'.xls');
			break;
	
	case A_REPORT_XLS_USABLE:

		include ($site_path.'admin/exportclases/class.xlsIzvozUsable.php');
		$izvoz = new XlsIzvozUsable ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_usable'.time().'.xls');
			break;
			
	case A_REPORT_XLS_SPEEDER:

		include ($site_path.'admin/exportclases/class.xlsIzvozSpeeder.php');
		$izvoz = new XlsIzvozSpeeder ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_speeder'.time().'.xls');
			break;
	
	case A_REPORT_XLS_TEXT_ANALYSIS:

		include ($site_path.'admin/exportclases/class.xlsIzvozTextAnalysis.php');
		$izvoz = new XlsIzvozTextAnalysis ($_GET['anketa']);
		$izvoz->createXls();

		$izvoz->getFile('xls_text_analysis'.time().'.xls');
			break;		
		
	case A_REPORT_CSV_TEXT_ANALYSIS:

		//include ($site_path.'admin/survey/classes/class.SurveyTextAnalysis.php');
		
		$STA = new SurveyTextAnalysis($_GET['anketa']);
		$STA->exportCSVTable($_GET['type']);
			break;		
                    
    case M_REPORT_CSV_MAZA_USERS:
		
		//include ($site_path.'admin/survey/modules/mod_MAZA/class.MAZAExport.php');
		
		$ME = new MAZAExport($_GET['anketa']);
		switch($a){
			case 'ident_export':
				$ME->exportCSVIdentifiers();
				break;
                        /*case 'inactive_identifiers':
				$ME->exportCSVInactiveIdentifiers();
				break;
			case 'active_identifiers':
				$ME->exportCSVActiveIdentifiers();
				break;*/
			case 'tracking_locations':
				$ME->exportCSVTrackingLocations();
				break;
			case 'tracking_ar':
				$ME->exportCSVTrackingAR();
				break;
                        case 'entry_locations':
				$ME->exportCSVEntryLocations();
				break;
                        case 'triggered_geofences':
                                $ME->exportCSVTriggeredGeofences();
                                break;
                        case 'triggered_geofences_answers':
                                $ME->exportCSVTriggeredGeofencesAnswered();
                                break;
                        case 'geofences':
                                $ME->exportCSVGeofences();
                                break;
                        case 'alarm_respondents':
                                $ME->exportCSVAlarmRespondets();
                                break;
		}
		break;
	
	case M_REPORT_CSV_ADVANCED_PARADATA:

		if(isset($_GET['table'])){
			$table = $_GET['table'];

			$sape = new SurveyAdvancedParadataExport($_GET['anketa']);
			$sape->exportTable($table);
		}
		break;		
		
	case M_REPORT_XLS_ADVANCED_TIMESTAMPS:
		$sat = new SurveyAdvancedTimestamps($_GET['anketa']);
		$sat->exportTable();
		break;	
	//////////////////////////////////////////
	
	
	/////////////////JSON/////////////////////
 	case M_REPORT_JSON_SURVEY_EXPORT:
		$sjse = new SurveyJsonSurveyData($_GET['anketa']);
		$sjse->OutputJsonFile();
		break;	
	//////////////////////////////////////////
	
	
	/////////////////PPT//////////////////////
	case M_REPORT_ANALIZA_PPT_CHARTS:
		include ($site_path.'admin/exportclases/class.pptIzvozAnalizaCharts.php');
		$izvoz = new PptIzvozAnalizaCharts ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPpt();

		$izvoz->getFile('ppt_analiza.pptx');
			break;
			
	case M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE:
		include ($site_path.'admin/exportclases/class.pptIzvozHeatmapImage.php');
		$izvoz = new pptIzvozHeatmapImage ($_GET['anketa'], $_GET['sprID'], $_GET['loop']);
		$izvoz->createPpt();

		$izvoz->getFile('ppt_analiza_heatmap_image_'.$_GET['sprID'].'.ppt');
			break;
}