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/Controllers/BodyController.php | 771 +++++++++++++++++-------- 1 file changed, 546 insertions(+), 225 deletions(-) (limited to 'main/survey/app/Controllers/BodyController.php') 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 -- cgit v1.2.3