From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- main/survey/app/.htaccess | 6 +- main/survey/app/Controllers/AjaxController.php | 181 +++-- main/survey/app/Controllers/BodyController.php | 771 +++++++++++++++------ main/survey/app/Controllers/CheckController.php | 19 +- main/survey/app/Controllers/DisplayController.php | 169 +++-- main/survey/app/Controllers/HeaderController.php | 126 +++- main/survey/app/Controllers/HelperController.php | 16 +- main/survey/app/Controllers/InitClass.php | 388 +++++++++-- main/survey/app/Controllers/JsController.php | 150 +++- main/survey/app/Controllers/LanguageController.php | 44 +- .../survey/app/Controllers/StatisticController.php | 9 +- .../Controllers/Vprasanja/ComputeController.php | 2 +- .../app/Controllers/Vprasanja/DatumController.php | 4 +- .../app/Controllers/Vprasanja/DoubleController.php | 4 +- .../Controllers/Vprasanja/DragDropController.php | 44 +- .../Controllers/Vprasanja/DynamicController.php | 47 +- .../Controllers/Vprasanja/HeatMapController.php | 30 +- .../Vprasanja/ImageHotSpotController.php | 124 ++-- .../Controllers/Vprasanja/MaxDiffController.php | 6 +- .../Controllers/Vprasanja/MultigridController.php | 85 +-- .../Vprasanja/MultigridMobileController.php | 311 ++++++++- .../app/Controllers/Vprasanja/NumberController.php | 40 +- .../Vprasanja/OneAgainstAnotherController.php | 76 +- .../Vprasanja/RadioCheckboxSelectController.php | 38 +- .../Controllers/Vprasanja/RankingController.php | 43 +- .../app/Controllers/Vprasanja/TextController.php | 45 +- .../Controllers/Vprasanja/VprasanjaController.php | 153 ++-- .../app/Controllers/Vprasanja/VsotaController.php | 20 +- main/survey/app/Models/Model.php | 15 +- main/survey/app/Models/SaveSurvey.php | 125 ++-- main/survey/app/use_classes.php | 1 - main/survey/edit_anketa.php | 12 +- main/survey/embed_out.php | 5 +- main/survey/index.php | 2 +- main/survey/js/ChartJS/chart_init.js | 3 + main/survey/js/customizeImageView4Respondent.js | 4 +- main/survey/js/script.js | 238 ++++--- main/survey/sa_koda.php | 6 +- main/survey/skins/1kaBlack.css | 199 ++++-- main/survey/skins/1kaBlue.css | 227 ++++-- main/survey/skins/1kaGreen.css | 199 ++++-- main/survey/skins/1kaGrey.css | 2 +- main/survey/skins/1kaNature.css | 199 ++++-- main/survey/skins/1kaOffice.css | 199 ++++-- main/survey/skins/1kaOrange.css | 199 ++++-- main/survey/skins/1kaPurple.css | 199 ++++-- main/survey/skins/1kaRed.css | 199 ++++-- main/survey/skins/Cdi.css | 617 +++++++++++++++++ main/survey/skins/Default/arrowD.png | Bin 0 -> 964 bytes main/survey/skins/Default/arrowD2.png | Bin 0 -> 3823 bytes main/survey/skins/Default/arrowL.png | Bin 0 -> 995 bytes main/survey/skins/Default/arrowL2.png | Bin 0 -> 3782 bytes main/survey/skins/Default/arrowR.png | Bin 0 -> 991 bytes main/survey/skins/Default/arrowR2.png | Bin 0 -> 3798 bytes main/survey/skins/Default/arrowU.png | Bin 0 -> 878 bytes main/survey/skins/Default/arrowU2.png | Bin 0 -> 3733 bytes main/survey/skins/Default/logo-small.png | Bin 0 -> 13198 bytes main/survey/skins/Default/logo_transparent.png | Bin 0 -> 4640 bytes main/survey/skins/Default/webcam_record.png | Bin 0 -> 29497 bytes main/survey/skins/Fdv.css | 201 ++++-- main/survey/skins/MobileBlack.css | 48 +- main/survey/skins/MobileBlue.css | 58 +- main/survey/skins/MobileCdi.css | 52 +- main/survey/skins/MobileFdv.css | 50 +- main/survey/skins/MobileGreen.css | 48 +- main/survey/skins/MobileOrange.css | 48 +- main/survey/skins/MobilePurple.css | 48 +- main/survey/skins/MobileRed.css | 48 +- main/survey/skins/MobileUni.css | 50 +- main/survey/skins/Otroci3.css | 613 ++++++++-------- main/survey/skins/Otroci4.css | 584 ++++++++-------- main/survey/skins/Uni.css | 201 ++++-- main/survey/skins/glasovanje/Classic.css | 2 +- main/survey/skins/glasovanje/Modern.css | 3 +- main/survey/uporabnost.php | 7 +- 75 files changed, 5179 insertions(+), 2483 deletions(-) create mode 100644 main/survey/skins/Cdi.css create mode 100644 main/survey/skins/Default/arrowD.png create mode 100644 main/survey/skins/Default/arrowD2.png create mode 100644 main/survey/skins/Default/arrowL.png create mode 100644 main/survey/skins/Default/arrowL2.png create mode 100644 main/survey/skins/Default/arrowR.png create mode 100644 main/survey/skins/Default/arrowR2.png create mode 100644 main/survey/skins/Default/arrowU.png create mode 100644 main/survey/skins/Default/arrowU2.png create mode 100644 main/survey/skins/Default/logo-small.png create mode 100644 main/survey/skins/Default/logo_transparent.png create mode 100644 main/survey/skins/Default/webcam_record.png (limited to 'main') diff --git a/main/survey/app/.htaccess b/main/survey/app/.htaccess index 05cd49a..a6dd393 100644 --- a/main/survey/app/.htaccess +++ b/main/survey/app/.htaccess @@ -1,3 +1,3 @@ -# Ne dovolimo direktnega dostopa do tega direktorija - -deny from al +# Ne dovolimo direktnega dostopa do tega direktorija + +deny from al diff --git a/main/survey/app/Controllers/AjaxController.php b/main/survey/app/Controllers/AjaxController.php index 33662e4..91a524b 100644 --- a/main/survey/app/Controllers/AjaxController.php +++ b/main/survey/app/Controllers/AjaxController.php @@ -10,6 +10,7 @@ namespace App\Controllers; // Osnovni razredi use App\Controllers\StatisticController as Statistic; use App\Controllers\Vprasanja\VprasanjaController as Vprasanja; +use App\Controllers\LanguageController as Language; use App\Models\Model; use Common; use Branching; @@ -17,57 +18,84 @@ use SurveyAdvancedParadataLog; use SurveySetting; use MailAdapter; use GDPR; +use AppSettings; +use SurveyEmailAccess; class AjaxController extends Controller { //ajax zahteve - public function __construct() - { + public function __construct(){ + if(empty($_GET['a'])){ return ''; } + + // inicializiramo jezik za multilang anketo + Language::getInstance()->multilang_init(); + + if ($_GET['a'] == 'accept_droppable') { $this->ajax_accept_droppable(); - } elseif ($_GET['a'] == 'accept_ranking') { + } + elseif ($_GET['a'] == 'accept_ranking') { $this->ajax_accept_ranking(); - } elseif ($_GET['a'] == 'accept_dragdrop1') { + } + elseif ($_GET['a'] == 'accept_dragdrop1') { $this->ajax_accept_dragdrop1(); - } elseif ($_GET['a'] == 'get_dragdrop1_data') { + } + elseif ($_GET['a'] == 'get_dragdrop1_data') { $this->ajax_get_dragdrop1_data(); - } elseif ($_GET['a'] == 'delete_dragdrop1_data') { + } + elseif ($_GET['a'] == 'delete_dragdrop1_data') { $this->ajax_delete_dragdrop1_data(); - } elseif ($_GET['a'] == 'delete_dragdrop2_data') { + } + elseif ($_GET['a'] == 'delete_dragdrop2_data') { $this->ajax_delete_dragdrop2_data(); - } elseif ($_GET['a'] == 'accept_dragdrop_grid') { + } + elseif ($_GET['a'] == 'accept_dragdrop_grid') { $this->ajax_accept_dragdrop_grid(); - } elseif ($_GET['a'] == 'accept_sortable_ranking') { + } + elseif ($_GET['a'] == 'accept_sortable_ranking') { $this->ajax_accept_sortable_ranking(); - } elseif ($_GET['a'] == 'edit_size') { + } + elseif ($_GET['a'] == 'edit_size') { $this->ajax_edit_size(); - } elseif ($_GET['a'] == 'dodaj_ime') { + } + elseif ($_GET['a'] == 'dodaj_ime') { $this->ajax_dodaj_ime(); - } elseif ($_GET['a'] == 'spol') { + } + elseif ($_GET['a'] == 'spol') { $this->ajax_glasovanje_spol(); - } elseif ($_GET['a'] == 'vote_spol') { + } + elseif ($_GET['a'] == 'vote_spol') { $this->ajax_glasovanje_vote_spol(); - } elseif ($_GET['a'] == 'captcha') { + } + elseif ($_GET['a'] == 'captcha') { $this->ajax_captcha(); - } elseif ($_GET['a'] == 'skin') { + } + elseif ($_GET['a'] == 'skin') { $this->ajax_skin(); - } elseif ($_GET['a'] == 'grupa_for_if') { + } + elseif ($_GET['a'] == 'grupa_for_if') { $this->ajax_grupa_for_if(); - } elseif ($_GET['a'] == 'enable_comments') { + } + elseif ($_GET['a'] == 'enable_comments') { $this->ajax_enable_comments(); - } elseif ($_GET['a'] == 'continue_later') { + } + elseif ($_GET['a'] == 'continue_later') { $this->ajax_continue_later(); - } elseif ($_GET['a'] == 'continue_later_send') { + } + elseif ($_GET['a'] == 'continue_later_send') { $this->ajax_continue_later_send(); - } elseif ($_GET['a'] == 'usr_id_data') { + } + elseif ($_GET['a'] == 'usr_id_data') { $this->ajax_delete_signature_data(); - }elseif ($_GET['a'] == 'get_tip_opozorila') { + } + elseif ($_GET['a'] == 'get_tip_opozorila') { $this->ajax_get_tip_opozorila(); - } // genericna resitev za vse nadaljne + } + // genericna resitev za vse nadaljne else { $ajax = 'ajax_' . $_GET['a']; if (method_exists($this, $ajax)) @@ -343,30 +371,22 @@ class AjaxController extends Controller } //asinhrono pobiranje podatkov za ureditev missing - public function ajax_get_dragdrop1_data() - { + public function ajax_get_dragdrop1_data(){ + Model::user_not_lurker(); + $anketa = $_GET['anketa']; $spremenljivka = $_GET['spremenljivka']; + $vre_id = array(); - //echo 'Spremenljivka: '.$spremenljivka; - //echo 'Anketa: '.$anketa; - //$sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$spremenljivka' AND other!=0 "); + $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$spremenljivka'"); $num = mysqli_num_rows($sql1); - /* echo ' - - '; */ - while ($row1 = mysqli_fetch_array($sql1)) { - //$vre_id[$i] = $row1['id']; array_push($vre_id, $row1['id']); } - //echo 'Podatek je: '.$num; - //echo $vre_id; + echo json_encode($vre_id); } @@ -472,14 +492,6 @@ class AjaxController extends Controller } } - // respondent se strinja z uporabo piskotvkov - nastavimo piskotek ok - public function ajax_cookie_ok() - { - - setcookie('cookie_ok', '1', time() + 2500000, '/'); - - } - //izpis statistike glede na spol public function ajax_glasovanje_spol() { @@ -494,7 +506,6 @@ class AjaxController extends Controller * */ public function ajax_captcha(){ - global $secret_captcha; $text = strtoupper($_GET['text']); $code = $_GET['code']; @@ -502,7 +513,7 @@ class AjaxController extends Controller $usr_id = $_GET['usr_id']; $recaptchaResponse = $_POST['g-recaptcha-response']; - $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse); + $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse); // zdaj pa zabeleži mail (pred pošiljanjem) // zdaj pa še v bazi tistih ki so se ročno dodali @@ -556,6 +567,7 @@ class AjaxController extends Controller public function ajax_continue_later(){ save('lang_id', (int)$_GET['language']); + save('anketa', (int)$_POST['anketa']); $url = $_POST['url'] . '&return=1'; @@ -571,13 +583,14 @@ class AjaxController extends Controller $srv_forma_send = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_forma_send' . $_lang); if ($srv_forma_send == '') $srv_forma_send = self::$lang['srv_forma_send']; + echo '
'; echo '

' . $srv_continue_later_txt . ':

' . $url . '

'; echo ''; - echo '

' . $srv_continue_later_email . ':

'; + echo '

' . $srv_continue_later_email . ':

'; echo '
'; } @@ -610,6 +623,38 @@ class AjaxController extends Controller catch (Exception $e) { } } + + public function ajax_return_edit_send(){ + global $mysql_database_name; + + ob_clean(); + + $s = self::$lang['srv_return_edit_subject']; + $t = self::$lang['srv_return_edit_content'] . ': ' . $_POST['url'] . ''; + + // Podpis + $signature = Common::getEmailSignature(); + $t .= $signature; + + $mail = $_POST['email']; + + if ($mail == ''){ + echo self::$lang['srv_continue_later_fail']; + return; + } + + try { + $MA = new MailAdapter(get('anketa'), $type='alert'); + $MA->addRecipients($mail); + $result = $MA->sendMail(stripslashes($t), $s); + } + catch (Exception $e) { + echo self::$lang['srv_continue_later_fail']; + return; + } + + echo self::$lang['srv_continue_later_success']; + } public function ajax_get_tip_opozorila() { $spr_id = $_POST['spr_id']; @@ -628,7 +673,7 @@ class AjaxController extends Controller $spremenljivka = $_POST['spremenljivka']; - echo '

'.self::$lang['srv_prevAnswers'].'

'; + echo '

'.self::$lang['srv_prevAnswers'].'

'; $sql = sisplet_query("SELECT text FROM srv_data_text" . get('db_table') . " WHERE spr_id='".$spremenljivka."' AND usr_id!='".get('usr_id')."' ORDER BY id DESC"); while($row = mysqli_fetch_array($sql)){ @@ -638,8 +683,8 @@ class AjaxController extends Controller } // Gumb zapri - echo '
'; - echo ''.self::$lang['srv_zapri'].''; + echo '
'; + echo ' '; echo '
'; echo ''; - - echo '
'; + } + + // Izpisemo popup s pogoji uporabe za modul dostop z emailom (mju) + public function ajax_show_email_access_terms() { + global $lang; + + $anketa = $_POST['anketa']; + + + echo '

'.$lang['user_agreement'].'

'; + + $sea = new SurveyEmailAccess($anketa); + $terms_text = $sea->getEmailAccessSettings('terms_text'); + echo nl2br($terms_text); + + + // Gumb zapri + echo '
'; + echo ' '; + echo '
'; + + echo ''; } diff --git a/main/survey/app/Controllers/BodyController.php b/main/survey/app/Controllers/BodyController.php index 308b30c..7a5f819 100644 --- a/main/survey/app/Controllers/BodyController.php +++ b/main/survey/app/Controllers/BodyController.php @@ -30,7 +30,9 @@ use SurveyGorenje; use SurveyNIJZ; use GDPR; use UserAccess; - +use AppSettings; +use BranchingAjax; +use SurveyEmailAccess; class BodyController extends Controller { @@ -216,10 +218,55 @@ class BodyController extends Controller $lang_array[$rowl['lang_id']] = $rowl['language']; } + echo '
' . "\n"; + // Posebna izbira jezika za špance - IAS skin + if($row['skin'] == 'IAS'){ + + echo '
'; + + // Ikona in text + echo '
'; + echo '
'; + echo ''.self::$lang['lang'].''; + echo '
'; + + // Div z jeziki ki se prikaze na kkliku na ikono + echo '
'; + + foreach ($lang_array AS $key => $val) { + echo '
'; + } + + echo '
'; + } // Izbira jezika z dropdown menijem - if (SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang_type') == 1) { + else if (SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang_type') == 1) { + echo '

' . self::$lang['lang'] . ': '; echo ' '; + echo '
'; + echo '
'; + + echo ''; + echo '
'; } + echo ''; } - echo '

' . "\n"; - } echo '
' . "\n"; // - grupa @@ -300,14 +351,11 @@ class BodyController extends Controller // JS na submitu prve strani - lahko da preverjamo privacy ali sprejetje cookija $survey_privacy = SurveySetting::getInstance()->getSurveyMiscSetting('survey_privacy'); - if(($row['cookie_continue'] == 0 && $row['cookie'] != -1) || $survey_privacy == 2){ + if($survey_privacy == 2){ $js_submit = ' onclick="'; if($survey_privacy == 2) - $js_submit .= 'privacy_check();'; - - if($row['cookie_continue'] == 0 && $row['cookie'] != -1) - $js_submit .= 'cookie_check();'; + $js_submit .= 'privacy_check();'; $js_submit .= 'return false;"'; } @@ -395,14 +443,13 @@ class BodyController extends Controller // Ce imamo staticen uvod in preverjanje s captcho if($row['intro_static'] == 2){ - global $recaptcha_sitekey; $captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false; echo '
'; echo '

'; - echo '

'; + echo '
'; echo '

'; if($captcha_error){ @@ -427,7 +474,7 @@ class BodyController extends Controller echo GDPR::getSurveyIntro(get('anketa')); // JS za prikaz popup-a - echo ''; + echo ''; echo '
' . "\n"; // Radio buttons @@ -445,7 +492,6 @@ class BodyController extends Controller ************************************************/ public function displayStaticIntroduction() { - $row = SurveyInfo::getInstance()->getSurveyRow(); // datapiping @@ -459,6 +505,24 @@ class BodyController extends Controller elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) $class .= ' tablet_preview'; + + // Spremenljivke, ki se rabijo v JS + echo ' ' . "\n"; + + + // crn div za ozadje popupov + echo '
'; + echo ''; + echo '
'; echo '
'; @@ -565,12 +629,19 @@ class BodyController extends Controller } echo ' '; echo '' . "\n"; - } // Izbira jezika z radio gumbi (default) + } + // Izbira jezika z radio gumbi (default) else { + echo '

' . self::$lang['lang'] . ':

'; - echo ''; + + echo ''; + foreach ($lang_array AS $key => $val) { + + echo '
'; echo ''; + echo '
'; } echo '
'; } @@ -610,14 +682,12 @@ class BodyController extends Controller if (!get('printPreview')) { - // JS na submitu prve strani - lahko da preverjamo privacy ali sprejetje cookija + // JS na submitu prve strani - lahko da preverjamo privacy $survey_privacy = SurveySetting::getInstance()->getSurveyMiscSetting('survey_privacy'); - if(($row['cookie_continue'] == 0 && $row['cookie'] != -1) || $survey_privacy == 2){ - $js_submit = ' onclick="'; + if($survey_privacy == 2){ + $js_submit = ' onclick="'; if($survey_privacy == 2) - $js_submit .= 'privacy_check();'; - if($row['cookie_continue'] == 0 && $row['cookie'] != -1) - $js_submit .= 'cookie_check();'; + $js_submit .= 'privacy_check();'; $js_submit .= 'return false;"'; } else{ @@ -647,6 +717,239 @@ class BodyController extends Controller echo '
'; // -outercontainer_holder } + /************************************************ + * Izrišemo uvod za modul email dostop - ne shranimo nicesar, samo prikazemo email s captcho ali pa polje za kodo + ************************************************/ + public function displayEmailAccessIntroduction($response){ + global $lang; + + $row = SurveyInfo::getInstance()->getSurveyRow(); + + // datapiping + $row['introduction'] = Helper::dataPiping($row['introduction']); + + SurveySetting::getInstance()->Init(get('anketa')); + $hide_mobile_img = SurveySetting::getInstance()->getSurveyMiscSetting('hide_mobile_img'); + $class = ($hide_mobile_img == '1') ? 'hide_mobile_img' : ''; + if (isset($_GET['mobile']) && $_GET['mobile'] == 1) + $class .= ' mobile_preview'; + elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) + $class .= ' tablet_preview'; + + + // Spremenljivke, ki se rabijo v JS + echo ' ' . "\n"; + + + // crn div za ozadje popupov + echo '
'; + echo ''; + + + echo '
'; + echo '
'; + + echo '
'; + echo '
'; + + + echo '
' . "\n"; + + Display::getInstance()->logo(); + + Display::getInstance()->progress_bar(); + + if (!get('printPreview')) { + echo '

checkSurveyModule('uporabnost') ? ' class="evalvacija"' : '') . '>' . Helper::getInstance()->displayAkronim() . '

' . "\n"; + } + + //opozorilo ce urejamo ze reseno anketo + if (get('quick_view') == true) { + echo '
'; + echo self::$lang['srv_quick_view_text']; + echo '
'; + } + //opozorilo ce urejamo ze reseno anketo + if (isset($_GET['urejanje'])) { + echo '
'; + echo self::$lang['srv_edit_text']; + echo '
'; + + // Preverimo ce gre za prvo popravljanje podatkov in avtomatsko ustvarimo arhiv podatkov ce je potrebno + ob_flush(); // ZAKAJ JE TUKAJ TA FLUSH? KER POTEM NE DELA NAKNADNO UREJANJE CE IMA ANKETA LOOPE + $sas = new SurveyAdminSettings(); + $sas->checkFirstDataChange(); + + // Updatamo tracking (ker gre za editiranje odgovorov) + TrackingClass::update(get('anketa'), 4); + } + + $sea = new SurveyEmailAccess(get('anketa')); + + + echo '
' . "\n"; + //echo '' . "\n"; + + echo '
' . "\n"; + + echo ' ' . "\n"; + echo ' ' . "\n"; + + + // Stran s kodo - napaka pri vnosu kode ali poslan email + if( (isset($_GET['step']) && $_GET['step'] == 'code') + || (isset($_POST['code']) && isset($response['error'])) + || (isset($_POST['email']) && !isset($response['error'])) + ){ + // Vnosno polje za kodo + echo ''; + } + // Stran z vnosom emaila + else{ + + // Na prvi strani nad vnosom emaila prikazemo uvod + $this->displayIntroductionContent(); + + $email = isset($_POST['email']) ? $_POST['email'] : ''; + + // Vnosno polje za email + echo ''; + + + // Captcha + if($sea->getEmailAccessSettings('captcha') == '1'){ + + $captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false; + echo ''; + } + } + + echo '
'; + + + echo '
' . "\n"; // - grupa + + + SurveySetting::getInstance()->Init(get('anketa')); + if (get('lang_id') != null) $_lang = '_' . get('lang_id'); else $_lang = ''; + $srv_nextpage = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_nextpage_uvod' . $_lang); + $label = $srv_nextpage != '' ? $srv_nextpage : self::$lang['srv_nextpage_uvod']; + + if (!get('printPreview')) { + + echo '
' . "\n"; + + if (isset($_GET['popup']) && $_GET['popup'] == '1') + echo '' . "\n"; + + echo '
'; + } + + echo '' . "\n"; + + + echo '
' . "\n"; // - container + + if (!get('printPreview')) { + $this->displayFooterNote(); + } + + echo '
' . "\n"; // - outercontainer + + echo '
'; + echo ''; // -outercontainer_holder + } + /************************************************ * Izrišemo konec ankete @@ -657,7 +960,6 @@ class BodyController extends Controller global $lang; global $admin_type; global $site_url; - global $app_settings; Header::getInstance()->displaySistemske(); @@ -676,6 +978,7 @@ class BodyController extends Controller $sql4 = sisplet_query("SELECT d.* FROM srv_spremenljivka s, srv_grupa g, srv_data_text" . get('db_table') . " d WHERE g.ank_id='" . get('anketa') . "'AND s.gru_id=g.id AND s.sistem='1' AND s.variable='sifizv1' AND d.spr_id=s.id AND d.usr_id='" . get('usr_id') . "'"); $sql5 = sisplet_query("SELECT s.* FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='" . get('anketa') . "'AND s.gru_id=g.id AND s.sistem='1' AND s.variable='podipl'"); $sql6 = sisplet_query("SELECT s.* FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='" . get('anketa') . "'AND s.gru_id=g.id AND s.sistem='1' AND s.variable='podipl2'"); + $sql7 = sisplet_query("SELECT s.* FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='" . get('anketa') . "'AND s.gru_id=g.id AND s.sistem='1' AND s.variable='podipl3'"); // Ce imamo sifro predmeta gre za anketo za ocenjevanje predmetov if (mysqli_num_rows($sql2) > 0) { @@ -714,8 +1017,18 @@ class BodyController extends Controller // Pobrisemo md5 (id studenta) iz zacasne tabele eval_data_user zaradi anonimnosti sisplet_query("DELETE FROM eval_data_user WHERE usr_id='".get('usr_id')."' AND ank_id='".get('anketa')."'"); } + // splosna PODIPLOMSKA anketa 3 (ena na studenta, brez predmetov) + elseif (mysqli_num_rows($sql7) > 0) { + $row1 = mysqli_fetch_array($sql1); + + // student je v celoti odgovoril na anketo + sisplet_query("INSERT INTO eval_data_podipl3 (student, ank_id) VALUES ('$row1[student]', '" . get('anketa') . "')"); + + // Pobrisemo md5 (id studenta) iz zacasne tabele eval_data_user zaradi anonimnosti + sisplet_query("DELETE FROM eval_data_user WHERE usr_id='".get('usr_id')."' AND ank_id='".get('anketa')."'"); + } // SPLOSNA anketa (ena na studenta, brez predmetov) - elseif (mysqli_num_rows($sql1) > 0) { + elseif ($sql1 !== false && mysqli_num_rows($sql1) > 0) { $row1 = mysqli_fetch_array($sql1); // student je v celoti odgovoril na anketo @@ -827,7 +1140,7 @@ class BodyController extends Controller $panel_settings = $sp->getPanelSettings(); // Posebno samo za ipanel - Izraelski projekt - if($app_settings['app_name'] == 'www.1ka.si' && (get('anketa') == '232992' || get('anketa') == '232795' || get('anketa') == '248217' || get('anketa') == '248757' || get('anketa') == '248762')){ + if(AppSettings::getInstance()->getSetting('app_settings-app_name') == 'www.1ka.si' && (get('anketa') == '232992' || get('anketa') == '232795' || get('anketa') == '248217' || get('anketa') == '248757' || get('anketa') == '248762')){ // Pridobimo id panelista ki je bil shranjen na zacetku resevanja v sistemsko spremenljivko $sqlP = sisplet_query("SELECT d.*, s.variable FROM srv_data_text".get('db_table')." d, srv_spremenljivka s, srv_grupa g @@ -868,10 +1181,25 @@ class BodyController extends Controller $panelist_id = $rowP['text']; // Pridobimo koncen status panelista (ce ni bil nikjer nastavljen uporabimo default) - $panel_status = (isset($_COOKIE['panel_status']) && $_COOKIE['panel_status'] != '') ? $_COOKIE['panel_status'] : $panel_settings['status_default']; + if(isset($_POST['panel_status']) && $_POST['panel_status'] != ''){ + $panel_status = $_POST['panel_status']; + } + elseif(isset($_COOKIE['panel_status']) && $_COOKIE['panel_status'] != ''){ + $panel_status = $_COOKIE['panel_status']; + } + else{ + $panel_status = $panel_settings['status_default']; + } - // Nastavimo koncen url za redirect - $finishUrl = $row['url'].'?'.$panel_settings['user_id_name'].'='.$panelist_id.'&'.$panel_settings['status_name'].'='.$panel_status; + // Dodaten pogoj, ce imamo slucajno ? ze v osnovnem delu urlja (da vracamo tudi recimo fiksen parameter) + if(strpos($row['url'], "?") !== false){ + // Nastavimo koncen url za redirect + $finishUrl = $row['url'].'&'.$panel_settings['user_id_name'].'='.$panelist_id.'&'.$panel_settings['status_name'].'='.$panel_status; + } + else{ + // Nastavimo koncen url za redirect + $finishUrl = $row['url'].'?'.$panel_settings['user_id_name'].'='.$panelist_id.'&'.$panel_settings['status_name'].'='.$panel_status; + } } } @@ -890,10 +1218,10 @@ class BodyController extends Controller // Glede na vrednost $naslednja = array_search($resevanje->koda, $kode) + 1; - $url = sisplet_query("SELECT url FROM srv_hierarhija_koda WHERE koda='".$kode[$naslednja]."'", "obj"); + $url = sisplet_query("SELECT h.url, a.hash FROM srv_hierarhija_koda h, srv_anketa a WHERE h.koda='".$kode[$naslednja]."' AND h.anketa_id=a.id", "obj"); $url_encode_spremenljivke = urlencode(base64_encode($url->url . '&supersifra=' . $resevanje->supersifra.'&resujem='.$naslednja)); - $redirect = $site_url .'a/'.get('anketa').'?enc='.$url_encode_spremenljivke; + $redirect = $site_url .'a/'.$url->hash.'?enc='.$url_encode_spremenljivke; header("Location: $redirect"); } @@ -943,8 +1271,8 @@ class BodyController extends Controller // URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php) - if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '') - $close_url = $app_settings['survey_finish_url']; + if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false) + $close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url'); else $close_url = 'https://www.1ka.si/'; @@ -1013,7 +1341,6 @@ class BodyController extends Controller echo '' . "\n"; //-grupa if ($row['user_from_cms'] == 2) { - //echo '

'.$lang['srv_nextins'].'

'; echo '

' . $lang['srv_nextins'] . '

'; } @@ -1088,11 +1415,15 @@ class BodyController extends Controller } + // Ce imamo url za naknadno urejanje - posiljanje na mail, posljemo avtomatsko mail, ce je vnesel email + if ((int)$row['concl_return_edit'] == 1) { + $js = 'continueLaterCheckEmail(\''.self::$lang['srv_continue_later_alert'].'\', function(){'.$js.'});'; + } + + if (!get('printPreview')) { $srv_konec = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_konec' . $_lang); - /*if ($row['text'] != '') // besedilo koncne povezave shranimo v misc setting, da bo konsistentno z ostalimi prevodi - $text = $row['text']; - else*/ + if ($srv_konec != '') $text = $srv_konec; else @@ -1108,7 +1439,7 @@ class BodyController extends Controller if ($row['user_from_cms'] == 2 && $row['user_from_cms_email'] == 1 && $admin_type <= 2) { // vnosos $sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='" . get('anketa') . "'ORDER BY vrstni_red ASC LIMIT 1"); $rowg = mysqli_fetch_array($sqlg); - //echo '

'.$lang['srv_nextins'].' | '.$lang['srv_insend'].'

'; + echo '

' . $lang['srv_nextins'] . ' | ' . $lang['srv_insend'] . '

'; } @@ -1230,7 +1561,7 @@ class BodyController extends Controller // SKAVTI - prikaz povzetka odgovorov in grafa global $mysql_database_name; - //if($mysql_database_name == '1ka' && get('anketa') == '64'){ + //if($mysql_database_name == '1ka' && get('anketa') == '52'){ if($mysql_database_name == 'real1kasi' && (get('anketa') == '293926' || get('anketa') == '314856' || get('anketa') == '332793')){ echo '
'; Display::getInstance()->displaySkavtiAnswers(); @@ -1263,11 +1594,10 @@ class BodyController extends Controller * @desc prikaze konec ankete */ public function displayKonecGlasovanje(){ - global $app_settings; echo ''; - //izpis zakljucka + // izpis zakljucka if (isset($_GET['glas_end']) && $_GET['glas_end'] == 1) { if (!get('printPreview')) { @@ -1287,8 +1617,8 @@ class BodyController extends Controller // URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php) - if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '') - $close_url = $app_settings['survey_finish_url']; + if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false) + $close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url'); else $close_url = 'https://www.1ka.si/'; @@ -1304,11 +1634,19 @@ class BodyController extends Controller } } + SurveySetting::getInstance()->Init(get('anketa')); + $hide_mobile_img = SurveySetting::getInstance()->getSurveyMiscSetting('hide_mobile_img'); + $class = ($hide_mobile_img == '1') ? 'hide_mobile_img' : ''; + if (isset($_GET['mobile']) && $_GET['mobile'] == 1) + $class .= ' mobile_preview'; + elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) + $class .= ' tablet_preview'; + - echo '
'; + echo '
'; echo '
'; - echo '
' . "\n"; + echo '
' . "\n"; echo '
'; echo '
' . "\n"; @@ -1328,7 +1666,7 @@ class BodyController extends Controller } else { $concl = $row['conclusion']; } - echo '

' . $concl . '

' . "\n"; + echo '

' . $concl . '

' . "\n"; echo '
' . "\n"; @@ -1397,14 +1735,29 @@ class BodyController extends Controller //ce statistike ne prikazujemo skocimo na zakljucek (ce imammo izklopljeno ali nastavleno na samo urednike in ni urednik) if ($rows['stat'] == 0 || ($rows['stat'] == 2 && self::$admin_type != 0 && self::$admin_type != 1)) { - //header('Location: '.self::$site_url.'a/'.get('anketa').'&grupa='.get('grupa').'&glas_end=1'.get('cookie_url').''); - header('Location: ' . SurveyInfo::getSurveyLink() . '&grupa=' . get('grupa') . (isset($_GET['language']) ? '&language=' . $_GET['language'] : '') . '&glas_end=1' . get('cookie_url') . ''); - } else { + header('Location: ' . SurveyInfo::getSurveyLink() + . '&grupa=' . get('grupa') + . (isset($_GET['language']) ? '&language=' . $_GET['language'] : '') + . '&glas_end=1' + . (isset($_GET['preview']) ? '&preview=' . $_GET['preview'] : '') + . (isset($_GET['mobile']) ? '&mobile=' . $_GET['mobile'] : '') + . get('cookie_url') . ''); + } + else { - echo '
'; + SurveySetting::getInstance()->Init(get('anketa')); + $hide_mobile_img = SurveySetting::getInstance()->getSurveyMiscSetting('hide_mobile_img'); + $class = ($hide_mobile_img == '1') ? 'hide_mobile_img' : ''; + if (isset($_GET['mobile']) && $_GET['mobile'] == 1) + $class .= ' mobile_preview'; + elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) + $class .= ' tablet_preview'; + + + echo '
'; echo '
'; - echo '
' . "\n"; + echo '
' . "\n"; echo '
'; echo '
' . "\n"; @@ -1420,8 +1773,8 @@ class BodyController extends Controller echo '
' . "\n"; echo '
'; - //$url_stat = ''.self::$site_url.'a/'.get('anketa').'&grupa='.get('grupa').'&glas_end=1'.get('cookie_url'); - $url_stat = '' . SurveyInfo::getSurveyLink() . '&grupa=' . get('grupa') . (isset($_GET['language']) ? '&language=' . $_GET['language'] : '') . '&glas_end=1' . get('cookie_url'); + + $url_stat = '' . SurveyInfo::getSurveyLink() . '&grupa=' . get('grupa') . (isset($_GET['language']) ? '&language=' . $_GET['language'] : '') . '&glas_end=1' . (isset($_GET['preview']) ? '&preview=' . $_GET['preview'] : '').(isset($_GET['mobile']) ? '&mobile=' . $_GET['mobile'] : '').get('cookie_url'); $js = 'document.location.href=\'' . $url_stat . '\';'; // Gumb nazaj @@ -1539,7 +1892,7 @@ class BodyController extends Controller elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) $class .= ' tablet_preview'; - echo '
'; + echo '
'; echo '
'; echo '
' . "\n"; @@ -1629,8 +1982,8 @@ class BodyController extends Controller if ($row['user_from_cms'] == 2 && $row['user_from_cms_email'] == 1 && $admin_type <= 2) { // vnosos $sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='" . get('anketa') . "'ORDER BY vrstni_red ASC LIMIT 1"); $rowg = mysqli_fetch_array($sqlg); - //echo '

'.$lang['srv_nextins'].' | '.$lang['srv_insend'].'

'; - echo '

' . $lang['srv_nextins'] . ' | ' . $lang['srv_insend'] . '

'; + + echo '

' . $lang['srv_nextins'] . ' | ' . $lang['srv_insend'] . '

'; } echo '
' . "\n"; // -container @@ -1664,8 +2017,9 @@ class BodyController extends Controller elseif (isset($_GET['mobile']) && $_GET['mobile'] == 2) $class .= ' tablet_preview'; + $grupa_class = 'grupa_'.get('grupa'); - echo '
'; + echo '
'; echo '
'; echo '
'; @@ -1693,7 +2047,7 @@ class BodyController extends Controller // Preverimo ce gre za prvo popravljanje podatkov in avtomatsko ustvarimo arhiv podatkov ce je potrebno //ob_flush(); // ZAKAJ JE TUKAJ TA FLUSH? KER POTEM NE DELA NAKNADNO UREJANJE CE IMA ANKETA LOOPE - $sas = new SurveyAdminSettings(); + $sas = new SurveyAdminSettings($action=0, $anketa=get('anketa')); $sas->checkFirstDataChange(); // Updatamo tracking (ker gre za editiranje odgovorov) @@ -1730,7 +2084,7 @@ class BodyController extends Controller { $row = SurveyInfo::getInstance()->getSurveyRow(); - echo '
'; + echo '
'; echo '
'; echo '
'; @@ -1842,10 +2196,13 @@ class BodyController extends Controller // Izbira jezika z radio gumbi (default) else { echo '

' . self::$lang['lang'] . ':

'; - echo ''; + echo ''; foreach ($lang_array AS $key => $val) { + + echo '
'; echo ''; + echo '
'; } echo '
'; } @@ -1907,7 +2265,7 @@ class BodyController extends Controller public function displayFooterNote(){ - global $mysql_database_name, $app_settings; + global $mysql_database_name; $row = SurveyInfo::getInstance()->getSurveyRow(); @@ -1919,9 +2277,8 @@ class BodyController extends Controller } // Custom footer - if(isset($app_settings['footer_survey_custom']) && $app_settings['footer_survey_custom'] == 1){ - - echo '

'.$app_settings['footer_survey_text'].'

'; + if(AppSettings::getInstance()->getSetting('app_settings-footer_survey_custom') !== false){ + echo '

'.AppSettings::getInstance()->getSetting('app_settings-footer_survey_text').'

'; } // Default footer else{ @@ -1931,49 +2288,14 @@ class BodyController extends Controller $link_privacy = (self::$lang['id'] == '1') ? 'https://www.1ka.si/d/sl/o-1ka/pogoji-uporabe-storitve-1ka/politika-zasebnosti' : 'https://www.1ka.si/d/en/about/terms-of-use/privacy-policy'; $link_paradata = (self::$lang['id'] == '1') ? 'https://www.1ka.si/d/sl/o-1ka/pogoji-uporabe-1ka/izklop-parapodatkov' : 'https://www.1ka.si/d/en/about/terms-of-use/turn-off-paradata'; + + // 1. vrstica - 1ka - spletne ankete echo ''; echo ''; echo ''; echo ''; - echo '

'; - - $survey_ip = SurveySetting::getInstance()->getSurveyMiscSetting('survey_ip'); - $ip_show = SurveySetting::getInstance()->getSurveyMiscSetting('survey_show_ip'); - $survey_browser = SurveySetting::getInstance()->getSurveyMiscSetting('survey_browser'); - $survey_referal = SurveySetting::getInstance()->getSurveyMiscSetting('survey_referal'); - $survey_date = SurveySetting::getInstance()->getSurveyMiscSetting('survey_date'); - - - $privacy_text = ''; - - // Ce imamo vse izklopljeno je anketa brez parapodatkov - if(($survey_ip == 1 || $ip_show == 0) && $survey_browser == 1 && $survey_referal == 1 && $survey_date == 1){ - - $privacy_text = '' . self::$lang['srv_no_paradata'] . ''; - - echo $privacy_text; - } - else{ - echo '' . self::$lang['srv_no_anketa'] . ' '; - - // Piskotki - if ($row['cookie'] == -1) - $privacy_text .= '' . self::$lang['srv_no_cookie'] . ', '; - - // IP sledenje - if ($survey_ip == 1) - $privacy_text .= '' . self::$lang['srv_no_ip'] . ', '; - - // Email povezovanje - if ($row['user_base'] == 1 && $row['show_email'] == 0) - $privacy_text .= '' . self::$lang['srv_no_email'] . ', '; - - echo substr($privacy_text, 0, -2); - } - - echo '

'; - + // 3. vrstica - politika zasebnosti echo ''; @@ -1983,26 +2305,26 @@ class BodyController extends Controller // OKNO Z NASTAVITVAMI ZA PREVIEW / TEST - if (isset($_GET['preview']) && $_GET['preview'] == 'on' && $_GET['no_preview'] != '1') { + if (isset($_GET['preview']) && $_GET['preview'] == 'on' && (!isset($_GET['no_preview']) || $_GET['no_preview'] != '1')) { echo '
'; + echo '
'; + // Preklop na celostranski preview + echo '
'; + echo ''.self::$lang['srv_mode'] . ':'; + echo '' . self::$lang['srv_normal'] . ''; + echo '' . self::$lang['srv_scrolling'] . ''; + echo '
'; + // Gump za odprtje/zaprtje okna - echo '
'; + echo '
'; echo ''; echo ''; echo '
'; - - - // Preklop na celostranski preview - echo '
'; - - echo ''.self::$lang['srv_mode'] . ':'; - echo '' . self::$lang['srv_normal'] . ''; - echo '' . self::$lang['srv_scrolling'] . ''; echo '
'; @@ -2010,9 +2332,9 @@ class BodyController extends Controller // Vsebina - preview-holder echo '
'; - echo '
'; + echo '
'; - if ($_GET['testdata'] == 'on') + if (isset($_GET['testdata']) && $_GET['testdata'] == 'on') echo '

' . self::$lang['srv_testalert'] . '

'; else echo '

' . self::$lang['srv_previewalert'] . '

'; @@ -2052,9 +2374,6 @@ class BodyController extends Controller if (isset($_GET['displayvariables'])) echo ''; - if (isset($_GET['disablealert'])) - echo ''; - if (isset($_GET['disablecode'])) echo ''; @@ -2080,7 +2399,7 @@ class BodyController extends Controller // Preklop med preview-ji za mobilnik, tablico in pc if(!get('displayAllPages')){ - echo '' . self::$lang['srv_para_graph_device'] . ': '; + echo '
' . self::$lang['srv_para_graph_device'] . ': '; if (isset($_GET['mobile']) && $_GET['mobile'] == '1') $device_value = 1; @@ -2089,16 +2408,16 @@ class BodyController extends Controller else $device_value = 0; - echo ''; + echo '
'; // Ce imamo izklopljene mobilne prilagoditve ne pustimo preview-ja na mobile, ker itak ne prikaze scalano $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly'); if($mobile_friendly != '0'){ - echo ''; - echo ''; + echo '
'; + echo '
'; } - echo ''; + echo '
'; } @@ -2122,9 +2441,6 @@ class BodyController extends Controller if (isset($_GET['displayvariables'])) echo ''; - if (isset($_GET['disablealert'])) - echo ''; - if (isset($_GET['disablecode'])) echo ''; @@ -2164,7 +2480,13 @@ class BodyController extends Controller // FORM s checkbox nastavitvami - $link = SurveyInfo::getSurveyLink(get('anketa')) . '' . Header::getSurveyParams(false, null, array('disableif', 'disablealert', 'disablecode', 'displayifs', 'displayvariables', 'hidecomment', 'mobile')) . '&survey-' . get('anketa') . '=' . $_GET['survey-' . get('anketa') . ''] . '&grupa=' . $_GET['grupa']; + $link = SurveyInfo::getSurveyLink(get('anketa')) . Header::getSurveyParams(false, null, array('disableif', 'disablecode', 'displayifs', 'displayvariables', 'hidecomment', 'mobile')); + if(isset($_GET['survey-'.get('anketa')])) + $link .= '&survey-' . get('anketa') . '=' . $_GET['survey-'.get('anketa')]; + if(isset($_GET['grupa'])) + $link .= '&grupa=' . $_GET['grupa']; + + echo '
'; echo ''; @@ -2175,22 +2497,22 @@ class BodyController extends Controller if (isset($_GET['code'])) echo ''; - echo '

'; + if (isset($_GET['glas_end'])) + echo ''; - echo '

'; + echo '

'; // Pogoj za izlapljanje kode ce imamo email vabila z zahtevano kodo if ($row['user_base'] == 1 && $row['individual_invitation'] != 0 && $row['usercode_skip'] == 0) { - echo '

'; } - echo '

'; - echo '

'; @@ -2201,7 +2523,7 @@ class BodyController extends Controller $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment'); $preview_disable_test_insert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disable_test_insert'); - if ($_GET['testdata'] == 'on' || $preview_disable_test_insert == 0) { + if ((isset($_GET['testdata']) && $_GET['testdata'] == 'on') || $preview_disable_test_insert == 0) { if ($question_resp_comment == 0) { echo '

'; @@ -2214,10 +2536,11 @@ class BodyController extends Controller echo '

'; } else { - if ($_GET['testdata'] == 'on') { + if (isset($_GET['testdata']) && $_GET['testdata'] == 'on') { echo '

'; - } else { + } + else { echo '

'; echo self::$lang['srv_savedatapreview']; echo '

'; @@ -2246,11 +2569,13 @@ class BodyController extends Controller } $sqlUserAutor = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id='" . get('anketa') . "' AND uid='" . self::$global_user_id . "'"); + (mysqli_num_rows($sqlUserAutor) > 0) ? save('userAutor', true) : save('userAutor', false); + // Komentarji urednikov na anketo if (get('userAutor')) { - echo '
'; + echo '
'; $view = 1; $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment'); @@ -2258,61 +2583,83 @@ class BodyController extends Controller if ((self::$admin_type <= $survey_comment && $survey_comment != '') && (/*$preview_hide_survey_comment != 1 ||*/ $_GET['testdata'] == 'on') ) { + echo '
'; + echo ''; + echo self::$lang['srv_survey_general_comment'] . ' '; + echo ''; - echo ''; + echo '
'; //.open_comment_box - $show_survey_comment = $_GET['show_survey_comment']; - if ($row['forum'] == 0 || $row['thread'] == 0) { - echo ''; - echo self::$lang['srv_comment_splosen'] . ' '; - echo ''; - echo ''; - } else { + echo ''; + echo ''; + } - $sqlf = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'"); - $rowf = mysqli_fetch_array($sqlf); - $rowf['count']--; //zaradi 1. avtomatskega posta - echo ''; - echo self::$lang['srv_comment_splosen'] . ' '; - echo ''; - - // ali prikazemo okno odprto - je dodan tak admin komentar - $sqlf1 = sisplet_query("SELECT * FROM post p WHERE p.tid='$row[thread]' AND p.ocena='5'"); - while ($rowf1 = mysqli_fetch_array($sqlf1)) { - $s = sisplet_query("SELECT * FROM views WHERE pid='$rowf1[id]' AND uid='self::$global_user_id'"); - if (mysqli_num_rows($s) == 0) - $show_survey_comment = 1; - } - echo ''; - } + // Uredniske nastavitve link + echo ''; + echo '
'; + echo ''; + echo '
'; - echo ''; - // Ce je tole vklopljeno se js porusi? - //echo ''; - echo ''; - echo ''; - echo ''; + echo '
'; // #comments_bottom_line - echo ''; - } - // Uredniske nastavitve link - echo '' . self::$lang['settings'] . ' '; + //dropdown na klik ikone + echo '
'; + $anketa = get('anketa'); + echo '
'; + $ba = new BranchingAjax($anketa); + $ba->add_comment_field(0, '0', '1', false, false); echo '
'; + + echo '
'; + echo ' '; + echo ' '; + echo '
'; + + echo '
'; //comment_dropdown } // Komentarji respondentov na anketo - elseif (self::$global_user_id > 0 || true) { + else{ - echo '

'; + echo '

'; $view = 1; $survey_comment_resp = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_resp'); $preview_hide_survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hide_survey_comment'); if (((self::$admin_type <= $survey_comment_resp && self::$admin_type != -1 && $survey_comment_resp != '') || $survey_comment_resp == 4) && ($preview_hide_survey_comment != 1 || $_GET['testdata'] == 'on')) { - $show_survey_comment = $_GET['show_survey_comment']; + echo '
'; + echo ''; + echo self::$lang['srv_survey_general_comment'] . ' '; + echo ''; + + echo '
'; //.open_comment_box + + echo ''; + echo ''; + + echo '
'; // #comments_bottom_line + + + //dropdown na klik ikone + echo '
'; + + $anketa = get('anketa'); + echo '
'; + $ba = new BranchingAjax($anketa); + $ba->add_comment_field(0, '0', '1', false, false); + echo '
'; + + echo '
'; + echo ' '; + echo ' '; + echo '
'; + + echo '
'; //comment_dropdown + + /*$show_survey_comment = $_GET['show_survey_comment']; if ($row['forum'] == 0 || $row['thread_resp'] == 0) { echo ''; @@ -2344,10 +2691,10 @@ class BodyController extends Controller //echo ''; echo ''; echo ''; - echo ''; + echo '';*/ } - echo '

'; + echo '
'; } } @@ -2358,8 +2705,6 @@ class BodyController extends Controller ?>'; echo self::$lang['srv_test_alert']; @@ -2423,7 +2750,7 @@ class BodyController extends Controller '; echo self::$lang['srv_preview_alert']; @@ -2447,12 +2774,6 @@ class BodyController extends Controller return false; }); '; - echo self::$lang['srv_javascript_warning']; - echo '
'; } } \ No newline at end of file diff --git a/main/survey/app/Controllers/CheckController.php b/main/survey/app/Controllers/CheckController.php index d39a6c2..36b11b6 100644 --- a/main/survey/app/Controllers/CheckController.php +++ b/main/survey/app/Controllers/CheckController.php @@ -14,7 +14,7 @@ use enkaParameters; use SurveyInfo; use SurveyMissingValues; use Common; -use Mobile_Detect; +use AppSettings; class CheckController extends Controller @@ -51,6 +51,9 @@ class CheckController extends Controller public function checkGrupa() { + if(get('grupa') == '0' || get('grupa') == '') + return false; + $sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id = '" . get('grupa') . "' ORDER BY vrstni_red"); if (!$sql) echo mysqli_error($GLOBALS['connect_db']); while ($row = mysqli_fetch_array($sql)) { @@ -197,7 +200,7 @@ class CheckController extends Controller if ($row['operator'] == 0 && mysqli_num_rows($sql3) == 0 && mysqli_num_rows($sql3b) == 0) return false; - elseif ($row['operator'] == 0 && mysqli_num_rows($sql3b) > 0 && mysqli_num_rows($sql4b) > 0) + elseif ($row['operator'] == 0 && mysqli_num_rows($sql3) == 0 && mysqli_num_rows($sql3b) > 0 && mysqli_num_rows($sql4b) > 0) return false; elseif ($row['operator'] == 1 && mysqli_num_rows($sql3) > 0) return false; @@ -404,7 +407,7 @@ class CheckController extends Controller $browser_detect = get_browser($useragent, true); - $detect = New Mobile_Detect(); + $detect = New \Detection\MobileDetect; $detect->setUserAgent($useragent); // Detect naprave (pc, mobi, tablet, robot) @@ -681,8 +684,7 @@ class CheckController extends Controller */ public function check_captcha() { - global $secret_captcha; - + // Ce urejamo podatke v admin vmesniku ne preverjamo nicesar if(isset($_GET['t']) && $_GET['t'] == 'postprocess' || get('grupa') == '0' || get('grupa') == ''){ return; @@ -696,7 +698,7 @@ class CheckController extends Controller if ($captcha == 1) { $recaptchaResponse = $_POST['g-recaptcha-response']; - $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse); + $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse); // zdaj pa zabeleži mail (pred pošiljanjem) // zdaj pa še v bazi tistih ki so se ročno dodali @@ -716,10 +718,9 @@ class CheckController extends Controller * */ public function check_captcha_intro(){ - global $secret_captcha; $recaptchaResponse = $_POST['g-recaptcha-response']; - $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse); + $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse); if(strstr($request,"true")){ // @@ -742,7 +743,7 @@ class CheckController extends Controller $qry = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$spremenljivka' AND other IN ('" . implode('\',\'', array_keys($missing_values)) . "')"); $missing_vrednosti = array(); while ($row = mysqli_fetch_assoc($qry)) { - $missing_vrednosti[] = $row[id]; + $missing_vrednosti[] = $row['id']; } # pogledamo ali imamo kak zapis v srv_data_vrednost. potem je to najbrž missing diff --git a/main/survey/app/Controllers/DisplayController.php b/main/survey/app/Controllers/DisplayController.php index c0cbf43..a783892 100644 --- a/main/survey/app/Controllers/DisplayController.php +++ b/main/survey/app/Controllers/DisplayController.php @@ -18,6 +18,8 @@ use SurveyInfo; use SurveySetting; use Common; use SurveyGorenje; +use SurveyPanel; +use AppSettings; class DisplayController extends Controller { @@ -39,8 +41,8 @@ class DisplayController extends Controller return new DisplayController(); } - public function logo() - { + public function logo(){ + // Za gorenje posebej prikazemo logo if(Common::checkModule('gorenje')){ SurveyGorenje::logoGorenje(get('anketa'), get('usr_id')); @@ -52,12 +54,31 @@ class DisplayController extends Controller // Logo prikazemo angleski v vseh primerih kjer respondentov jezik ni slovenscina in ce ni custom - popravimo tudi link na angleski frontend if (self::$lang['language'] != 'Slovenščina') { - $class = ' class="english"'; + + $class = 'english'; + if (strpos(self::$site_url, 'www.1ka.si') !== false) $url = self::$site_url.'d/en/'; } - echo ''; + // Ce gre za lastno namestitev ali virtualko prikazemo logo "namestitev" + if(isLastnaInstalacija() || isVirtual()){ + $class .= ' namestitev'; + } + // Ce gre za AAI prikazemo logo "arnes" + elseif(isAAI()){ + $class .= ' arnes'; + } + + // Ce imamo nastavljen custom logo za celo aplikacijo + $custom_logo_style = ''; + $custom_logo = AppSettings::getInstance()->getSetting('app_settings-custom_logo'); + if($custom_logo != false && $custom_logo != ''){ + $class = 'custom_logo'; + $custom_logo_style = 'style="background-image: url(\'../../../public/img/logo/custom_logo/'.$custom_logo.'\');"'; + } + + echo ''; } /** @@ -116,13 +137,39 @@ class DisplayController extends Controller // Prikaz opcije "nadaljuj kasneje" if ($row['continue_later'] == 1) { + SurveySetting::getInstance()->Init(get('anketa')); + if (get('lang_id') != null) $_lang = '_' . get('lang_id'); else $_lang = ''; $srv_continue_later = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_continue_later' . $_lang); if ($srv_continue_later == '') $srv_continue_later = self::$lang['srv_continue_later']; + // Pri panelu v url samo vnesemo panel id respondenta, ker nimamo piskotkov + if(SurveyInfo::getInstance()->checkSurveyModule('panel')){ + + $sp = new SurveyPanel(get('anketa')); + $panel_id_name = $sp->getPanelSettings('user_id_name'); + + if ($panel_id_name != '') { + + $sqlPanel = sisplet_query("SELECT d.text AS panel_id + FROM srv_spremenljivka s, srv_data_text".get('db_table')." d + WHERE s.variable='".$panel_id_name."' AND s.id=d.spr_id AND d.usr_id='".get('usr_id')."' + "); + + if (mysqli_num_rows($sqlPanel) > 0) { + $rowPanel = mysqli_fetch_array($sqlPanel); + $panel_id = $rowPanel['panel_id']; + + $panel_url = SurveyInfo::getSurveyLink().'?'.$panel_id_name.'='.$panel_id; + + echo ''; + } + } + } + echo ''; } @@ -138,8 +185,9 @@ class DisplayController extends Controller } // Prikaze ikono za izvoz pdf rezultatov v zakljucku - public function displayRespondetnPDF() - { + public function displayRespondetnPDF(){ + global $site_domain; + $row = SurveyInfo::getInstance()->getSurveyRow(); if ((int)$row['concl_PDF_link'] == 1) { @@ -182,7 +230,16 @@ class DisplayController extends Controller } echo '

'; - } + } + elseif( SurveyInfo::getInstance()->checkSurveyModule('nijz_radar_report') ){ + # parametre zapakiramo v array injih serializiramo in zakodiramo z base64 + $pdf_url = self::$site_url . 'admin/survey/izvoz.php?dc=' . base64_encode(serialize(array('m' => 'pdf_nijz', 'anketa' => get('anketa'), 'usr_id' => get('usr_id')))); + + #echo '
'; + echo '
'; + } else{ # parametre zapakiramo v array injih serializiramo in zakodiramo z base64 $pdf_url = self::$site_url . 'admin/survey/izvoz.php?dc=' . base64_encode(serialize(array('a' => 'pdf_results', 'anketa' => get('anketa'), 'usr_id' => get('usr_id'), 'type' => '0'))); @@ -205,10 +262,21 @@ class DisplayController extends Controller $return_url = $_POST['url'] . '&return=1'; $return_url = SurveyInfo::getSurveyLink() . get('cookie_url') . '&return=1'; - echo '

'; - echo self::$lang['srv_concl_return_edit_URL'].':
'; - echo ''.$return_url.''; - echo '

'; + echo '
'; + + echo '
'; + + echo '

'; + echo self::$lang['srv_concl_return_edit_URL'].':
'; + echo ' '.$return_url.''; + echo '

'; + + echo '
'; + + echo ' '; + echo '

' . self::$lang['srv_continue_later_email'] . ':

'; + + echo '
'; } } @@ -499,17 +567,23 @@ class DisplayController extends Controller $vprasanja = array(); $spr_ids = ''; - // Loop cez vsa ustrezna vprasanja in njihove vrednosti (jih zakesiramo) - $sqlS = sisplet_query("SELECT s.id AS spr_id, s.naslov AS spr_naslov, s.variable AS spr_variable - FROM srv_spremenljivka s, srv_grupa g + + // Loop cez vsa ustrezna vprasanja in njihove vrednosti (jih zakesiramo) in bloke v katerih se nahajajo (pohvale in izzivi morajo biti iz locenih blokov) + $sqlS = sisplet_query("SELECT s.id AS spr_id, s.naslov AS spr_naslov, s.variable AS spr_variable, i.label AS block_label, i.id AS block_id + FROM srv_spremenljivka s, srv_grupa g, srv_branching b, srv_if i WHERE g.ank_id='".get('anketa')."' AND s.gru_id=g.id AND s.variable LIKE 'R%' + AND b.ank_id='".get('anketa')."' AND b.element_spr=s.id AND i.id=b.parent AND i.tip='1' "); + if (!$sqlS) echo mysqli_error($GLOBALS['connect_db']); while($rowS = mysqli_fetch_array($sqlS)){ $vprasanje_number = substr($rowS['spr_variable'], 1); - $vprasanja[$rowS['spr_id']] = $vprasanje_number; + $vprasanja[$rowS['spr_id']]['number'] = $vprasanje_number; + + $vprasanja[$rowS['spr_id']]['block_id'] = $rowS['block_id']; + $vprasanja[$rowS['spr_id']]['block_label'] = $block_label; // ID-ji vprasanj za query $spr_ids .= $rowS['spr_id'].','; @@ -581,18 +655,28 @@ class DisplayController extends Controller echo '
'.$rowNagovor['naslov'].'
'; $i = 1; + $used_block_ids = array(); foreach($pohvale as $pohvala_vrednost => $vrednost){ + $spr_id = $vrednost['spr_id']; + + $block_id = $vprasanja[$spr_id]['block_id']; + + // Pohvala iz tega bloka je ze bila prikazana + if(in_array($block_id, $used_block_ids)) + continue; + + // Prikazane so bile ze 3 pohvale if($i > $max_odgovorov) break; - $spr_id = $vrednost['spr_id']; - $vprasanje_number = $vprasanja[$spr_id]; + $vprasanje_number = $vprasanja[$spr_id]['number']; echo '
'; echo '
'.$pohvale_besedilo[$vprasanje_number].'
'; echo '
'; + $used_block_ids[] = $block_id; $i++; } @@ -608,18 +692,28 @@ class DisplayController extends Controller echo '
'.$rowNagovor['naslov'].'
'; $i = 1; + $used_block_ids = array(); foreach($izzivi as $izziv_vrednost => $vrednost){ - + + $spr_id = $vrednost['spr_id']; + + $block_id = $vprasanja[$spr_id]['block_id']; + + // Izziv iz tega bloka je ze bil prikazan + if(in_array($block_id, $used_block_ids)) + continue; + + // Prikazani so bili ze 3 izzivi if($i > $max_odgovorov) break; - $spr_id = $vrednost['spr_id']; - $vprasanje_number = $vprasanja[$spr_id]; + $vprasanje_number = $vprasanja[$spr_id]['number']; echo '
'; echo '
'.$izzivi_besedilo[$vprasanje_number].'
'; echo '
'; + $used_block_ids[] = $block_id; $i++; } @@ -700,7 +794,7 @@ class DisplayController extends Controller $json_pohvale = json_encode($pohvale); $json_izzivi = json_encode($izzivi); - echo '

Pajkova mreža

'; + echo '

PAJKOVA MREŽA

'; // Nagovor za mrezo $sqlNagovor = sisplet_query("SELECT s.naslov, s.variable @@ -731,7 +825,7 @@ class DisplayController extends Controller $anketa = get('anketa'); - echo '
'; + echo '
'; echo '
'; echo '
'; @@ -781,35 +875,6 @@ class DisplayController extends Controller } } - /** - * @desc konstruktor - */ - public function PrintSurvey() - { - - if (isset($_GET['anketa'])) { - save('anketa', $_GET['anketa']); - - $rowa = SurveyInfo::getInstance()->getSurveyRow(); - - // uvodni nagovor - if ($rowa['show_intro'] != 0) { - Body::getInstance()->displayIntroduction(); - } - - // prikažemo ankete - do { - save('grupa', Find::getInstance()->findNextGrupa()); - - Body::getInstance()->displayAnketa(); - } while (get('grupa') != Find::getInstance()->findNextGrupa() && Find::getInstance()->findNextGrupa() > 0); - - // prikažemo konec - Body::getInstance()->displayKonec(); - } else - echo 'Ni podatkov o anketi!'; - } - /** * @desc prikaze chat okno za tawk chat, ce je modul vklopljen (js koda) diff --git a/main/survey/app/Controllers/HeaderController.php b/main/survey/app/Controllers/HeaderController.php index 1a7df13..ad77435 100644 --- a/main/survey/app/Controllers/HeaderController.php +++ b/main/survey/app/Controllers/HeaderController.php @@ -15,6 +15,7 @@ use SurveyAdvancedParadataLog; use SurveyInfo; use SurveyThemeEditor; use SurveyPanel; +use AppSettings; class HeaderController extends Controller { @@ -55,7 +56,6 @@ class HeaderController extends Controller 'urejanje', 'quick_view', 'disableif', - 'disablealert', 'disablecode', 'displayifs', 'displayvariables', @@ -116,9 +116,11 @@ class HeaderController extends Controller return header('Location: ' . self::$site_url); die("Missing anketa id!"); } - $anketa = (($get->anketa) ? $get->anketa : $_POST['anketa']); + $anketa_hash = (($get->anketa) ? $get->anketa : $_POST['anketa']); + $anketa = getSurveyIdFromHash($anketa_hash); // Shranimo vse spremenljivke iz get parametrov v classu VariableClass + save('anketa_hash', $anketa_hash); save('anketa', $anketa); save('get', $get); @@ -149,8 +151,6 @@ class HeaderController extends Controller * @desc zgenereira header */ public function header(){ - global $app_settings; - // preprecimo caching - tudi s klikom na gumb nazaj! header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT"); @@ -168,8 +168,8 @@ class HeaderController extends Controller $rowv = mysqli_fetch_array($sqlv); // Custom header title - if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){ - echo ''.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.$app_settings['head_title_text'].'' . "\n"; + if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){ + echo ''.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'' . "\n"; } // Default header title else{ @@ -181,6 +181,9 @@ class HeaderController extends Controller // Preprecimo vklop compatibility moda v IE echo ' ' . "\n"; + // Preprecimo indexiranje botov (google...) + echo ' ' . "\n"; + // nova verzija UI 1.8.10 - includamo minificirano skupaj z script.js (uporabimo iste jQuery fajle kot v adminu) echo ' ' . "\n"; echo '' . "\n"; @@ -188,13 +191,14 @@ class HeaderController extends Controller // tukaj nalozimo CSS za jquery in template temo echo ' ' . "\n"; - //nalozimo stringe iz langa za JS + // nalozimo stringe iz langa za JS echo '' . "\n"; - // nalozimo open sans fonte za nov design - echo ''; - /*echo '';*/ - echo ''; + // nalozimo source sans pro fonte za nov design + echo ''; + // Zaenkrat se obdrzimo montserratt zaradi kompatibilnosti za nazaj + echo ''; + // CSS mobile skin za telefone in tablice @@ -205,7 +209,15 @@ class HeaderController extends Controller // za MJU anketo nalozimo posebej custom skin if(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){ $this->loadCustomMadeSkin($custom_skin='MJU'); - } + } + // Custom skin za IAS (Spanci) + elseif($row['skin'] == 'IAS'){ + $this->loadCustomMadeSkin($custom_skin='IAS'); + } + // Custom skin za IAS (Spanci) + elseif($row['skin'] == 'Automaticservis'){ + $this->loadCustomMadeSkin($custom_skin='Automaticservis'); + } // CSS samo za mobilne telefone else{ $this->themeEditorMobileCustom(); @@ -220,6 +232,14 @@ class HeaderController extends Controller if(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){ $this->loadCustomMadeSkin($custom_skin='MJU'); } + // Custom skin za IAS (Spanci) + elseif($row['skin'] == 'IAS'){ + $this->loadCustomMadeSkin($custom_skin='IAS'); + } + // Custom skin za IAS (Spanci) + elseif($row['skin'] == 'Automaticservis'){ + $this->loadCustomMadeSkin($custom_skin='Automaticservis'); + } // profili tem - skinov else{ $this->themeEditor(); @@ -236,6 +256,14 @@ class HeaderController extends Controller elseif(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){ $this->loadCustomMadeSkin($custom_skin='MJU'); } + // Custom skin za IAS (Spanci) + elseif($row['skin'] == 'IAS'){ + $this->loadCustomMadeSkin($custom_skin='IAS'); + } + // Custom skin za Automaticservis + elseif($row['skin'] == 'Automaticservis'){ + $this->loadCustomMadeSkin($custom_skin='Automaticservis'); + } // profili tem - skinov else{ $this->themeEditor(); @@ -293,7 +321,7 @@ class HeaderController extends Controller $preview = ' class="preview"'; echo '' . "\n"; - // Zamenjamo class no_js z js -> test javacsripta za userje (javascript_warning) + echo " '; - //echo '
'; //vrednost_if_ID - //div ki vsebuje vrednost - //if($length > 30) - // if($length > 90){ - // $niz = substr($value, 0, 90); - //echo '
'.$niz.'...
'."\n"; - // echo '
'.$niz.'...
'."\n"; - // } - // else - //echo '
'.$value.'
'."\n"; - // echo '
'.$value.'
'."\n"; - //else{ - //echo '
'.$value.'
'."\n"; + echo '
' . $value . '
' . "\n"; //'#spremenljivka_'+spremenljivka+'_vrednost_'+id - //} } echo '' . "\n"; @@ -530,7 +508,7 @@ class DragDropController extends Controller echo ''; } echo ''; - echo 'arrow'; + //echo 'arrow'; echo ''; //izris desne strani*********************************************************************************** diff --git a/main/survey/app/Controllers/Vprasanja/DynamicController.php b/main/survey/app/Controllers/Vprasanja/DynamicController.php index 57e0127..92acc2d 100644 --- a/main/survey/app/Controllers/Vprasanja/DynamicController.php +++ b/main/survey/app/Controllers/Vprasanja/DynamicController.php @@ -183,18 +183,21 @@ class DynamicController extends Controller echo ''; + //vrstica z nadnaslovi echo ''; echo ' '; echo ' '; - //for($j = 1; $j <= $trak_num_of_titles; $j++){ + for ($j = 1; $j <= $row['grids']; $j++) { - //echo ''.$j.''; + if($j == 1){ $nadnaslov_floating = 'left'; - }else if($j == $row['grids']){ + } + else if($j == $row['grids']){ $nadnaslov_floating = 'right'; - }else{ + } + else{ $nadnaslov_floating = 'none'; } echo '
lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '
'; @@ -203,6 +206,7 @@ class DynamicController extends Controller echo ''; //vrstica z nadnaslovi - konec + echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; @@ -220,15 +224,20 @@ class DynamicController extends Controller // Datapiping $srv_grid['naslov'] = Helper::dataPiping($srv_grid['naslov']); - - if($diferencial_trak != 1){ //ce ni traku + //ce ni traku + if($diferencial_trak != 1){ # izpišemo labelo grida echo ' ' . $srv_grid['naslov'] . '' . "\n"; - }elseif($diferencial_trak == 1){ //ce je trak + } + //ce je trak + elseif($diferencial_trak == 1){ + # izpišemo ustrezno labelo grida if($srv_grid['other'] == 0){ //ce je labela za kategorijo odgovora, naj bo prazno echo ' ' . "\n"; - }else { //drugace, ce je labela za missing, izpisi labelo + } + //drugace, ce je labela za missing, izpisi labelo + else { echo ' ' . $srv_grid['naslov'] . '' . "\n"; } } @@ -263,15 +272,26 @@ class DynamicController extends Controller // Stevilo vseh vrednosti echo ''; + // Indikator da v js vemo ali smo ravnokar naloudali stran ali pa smo samo premaknili vrstico (potrebno zaradi prikazovanja glede na ife v dolocenih primerih) echo ''; while ($row1 = mysqli_fetch_array($sql1)) { + # po potrebi prevedemo naslov $naslov = Language::getInstance()->srv_language_vrednost($row1['id']); if ($naslov != '') { $row1['naslov'] = $naslov; } + + # po potrebi prevedemo naslov2 za diferencial + if ($row['enota'] == 1) { + $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true); + if ($naslov2 != '') { + $row1['naslov2'] = $naslov2; + } + } + # preverimo izbrano vrednost $grid_id = $srv_data_grid[$row1['id']]['grd_id']; @@ -545,11 +565,22 @@ class DynamicController extends Controller echo ''; while ($row1 = mysqli_fetch_array($sql1)) { + # po potrebi prevedemo naslov $naslov = Language::getInstance()->srv_language_vrednost($row1['id']); if ($naslov != '') { $row1['naslov'] = $naslov; } + + # po potrebi prevedemo naslov2 za diferencial + if ($row['enota'] == 1) { + $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true); + if ($naslov2 != '') { + $row1['naslov2'] = $naslov2; + } + } + + # preverimo izbrano vrednost $grid_id = $srv_data_grid[$row1['id']]['grd_id']; diff --git a/main/survey/app/Controllers/Vprasanja/HeatMapController.php b/main/survey/app/Controllers/Vprasanja/HeatMapController.php index 4a255dd..c3f1e2a 100644 --- a/main/survey/app/Controllers/Vprasanja/HeatMapController.php +++ b/main/survey/app/Controllers/Vprasanja/HeatMapController.php @@ -91,8 +91,8 @@ class HeatMapController extends Controller echo '
'; //imena obmocij iz srv_vrednost - $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red"); - $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='$row[id]' "); + $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='".$row['id']."' ORDER BY vrstni_red"); + $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='".$row['id']."'"); //ce so podatki ze v bazi (rec. uporabnik klikne 'Prejsnja stran') //$sql1a = sisplet_query("SELECT lat, lng, address, text FROM srv_data_map WHERE spr_id='$spremenljivka' AND usr_id='" . get('usr_id') . "' AND loop_id $loop_id"); @@ -102,20 +102,20 @@ class HeatMapController extends Controller $heatmap_data[] = $row1a; } - echo '