diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/izvoz.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to 'admin/survey/izvoz.php')
-rw-r--r-- | admin/survey/izvoz.php | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/admin/survey/izvoz.php b/admin/survey/izvoz.php index 421765c..af30516 100644 --- a/admin/survey/izvoz.php +++ b/admin/survey/izvoz.php @@ -6,7 +6,7 @@ include_once('definition.php'); include_once('../../function.php');
include_once('../../vendor/autoload.php');
-global $site_path, $global_user_id, $admin_type, $lang, $app_settings;
+global $site_path, $global_user_id, $admin_type, $lang;
# error reporting
@@ -51,6 +51,8 @@ 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");
@@ -88,12 +90,11 @@ 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");
-define("A_LANGUAGE_TECHNOLOGY_XLS", "lt_excel");
-
/*PPT*/
define("M_REPORT_ANALIZA_PPT_CHARTS", "charts_ppt");
define("M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE","heatmap_image_ppt");
@@ -115,7 +116,9 @@ if (!isset($_GET['anketa']) && isset($_GET['dc']) && $_GET['dc'] != null) { }
}
-$anketa = $_GET['anketa'];
+$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
@@ -132,22 +135,21 @@ $file = '../../lang/'.$lang_admin.'.php'; include($file);
-
/****** PREVERIMO CE IZVAJAMO NOV ALI STAR EXPORT ******/
// GDPR so vedno novi izvozi
-if(in_array($_GET['a'], array('pdf_gdpr_individual', 'pdf_gdpr_activity', 'rtf_gdpr_individual', 'rtf_gdpr_activity'))){
+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($_GET['m'], array('pdf_teammeter','pdf_employmeter', 'pdf_evoli', 'maza_csv', 'borza_csv', 'pdf_mju', 'pdf_mju2', 'advanced_paradata_csv', 'json_survey'))){
+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(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new'){
+elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new'){
$export_type = 'new';
}
// Ce imamo vklopljeno nastavitev za nove izvoze samo za admine
-elseif(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new_admin' && $admin_type == 0){
+elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new_admin' && $admin_type == 0){
$export_type = 'new';
}
else{
@@ -174,7 +176,7 @@ if($export_type == 'new'){ /****** IZVEDEMO STAR EXPORT ******/
# uporabnik ima dostop do ankete, preverimo še ali lahko pogleda userja
-switch ( $_GET['a'] ) {
+switch ($a) {
case A_REPORT_VPRASALNIK_PDF:
include($site_path.'admin/exportclases/class.pdfIzvoz.php');
@@ -277,36 +279,10 @@ switch ( $_GET['a'] ) { $izvoz->createXls();
$izvoz->getFile('xls_analiza.xls');
- break;
- //////////////XLS//////////////////////
- case A_LANGUAGE_TECHNOLOGY_XLS:
-
- global $site_path;
- try {
-
-
- $folder = $site_path . EXPORT_FOLDER.'/';
- $filename = $folder . "lt_" . $_GET['file'] . '.xlsx';
- if (!file_exists($filename)) {
- die("ERROR! Can't locate exported file!");
- }
-
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Length: ' . filesize($filename));
- header('Content-Disposition: attachment; filename="languageTechnology.xlsx"');
- readfile($filename);
- } catch (Exception $e) {
- print_r("ERROR! Can't download exported file!");
- }
- if (file_exists($filename)) {
- unlink($filename);
- }
- break;
-
+ break;
}
-switch ( $_GET['m'] ) {
+switch ($m) {
//////////////////HEATMAP IMAGE/////////
case M_REPORT_ANALIZA_HEATMAP_IMAGE:
@@ -368,6 +344,25 @@ switch ( $_GET['m'] ) { $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:
@@ -710,7 +705,7 @@ switch ( $_GET['m'] ) { //include ($site_path.'admin/survey/modules/mod_MAZA/class.MAZAExport.php');
$ME = new MAZAExport($_GET['anketa']);
- switch($_GET['a']){
+ switch($a){
case 'ident_export':
$ME->exportCSVIdentifiers();
break;
@@ -752,7 +747,12 @@ switch ( $_GET['m'] ) { $sape = new SurveyAdvancedParadataExport($_GET['anketa']);
$sape->exportTable($table);
}
- break;
+ break;
+
+ case M_REPORT_XLS_ADVANCED_TIMESTAMPS:
+ $sat = new SurveyAdvancedTimestamps($_GET['anketa']);
+ $sat->exportTable();
+ break;
//////////////////////////////////////////
|