summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Controllers/BodyController.php
diff options
context:
space:
mode:
Diffstat (limited to 'main/survey/app/Controllers/BodyController.php')
-rw-r--r--main/survey/app/Controllers/BodyController.php771
1 files changed, 546 insertions, 225 deletions
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 ' <div class="spremenljivka lang_pick">' . "\n";
+ // Posebna izbira jezika za špance - IAS skin
+ if($row['skin'] == 'IAS'){
+
+ echo '<div class="ias_lang_pick">';
+
+ // Ikona in text
+ echo '<div class="ias_lang_pick_select" onClick="$(\'#ias_lang_pick_options\').toggle();">';
+ echo '<div class="ias_lang_icon"><div class="one"></div><div class="two"></div><div class="three"></div></div>';
+ echo '<span class="ias_lang_text">'.self::$lang['lang'].'</span>';
+ echo '</div>';
+
+ // Div z jeziki ki se prikaze na kkliku na ikono
+ echo '<div id="ias_lang_pick_options">';
+
+ foreach ($lang_array AS $key => $val) {
+ echo '<label for="language_'.$key.'" '.($key == $current ? ' class="active"' : '').'>';
+ echo '<input type="radio" name="language" id="language_'.$key.'"
+ value="'.$key.'"
+ '.($key == $current ? ' checked="checked"' : '').'
+ onchange="window.location.href =
+ \'' . SurveyInfo::getSurveyLink() . '?language=\'+document.getElementById(\'language_' . $key . '\').value+\'' .
+ '&survey-'.get('anketa').'=' . get('cookie_url') . '\'+\'' .
+ (isset($_GET['skupina']) ? '&skupina=' . $_GET['skupina'] : '') . '\'+\'' .
+ (isset($_GET['preview']) ? '&preview=' . $_GET['preview'] : '') . '\'+\'' .
+ (isset($_GET['testdata']) ? '&testdata=' . $_GET['testdata'] : '') . '\'+\'' .
+ (isset($_GET['code']) ? '&code=' . $_GET['code'] : '') . '\'+\'' .
+ (isset($_GET['params']) ? '&params=' . $_GET['params'] : '') . '\'+\'' .
+ (isset($_GET['usr_id']) ? '&usr_id=' . $_GET['usr_id'] : '') . '\'+\'' .
+ (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . '\'+\'' .
+ (isset($_GET['recnum']) ? '&recnum=' . $_GET['recnum'] : '') . '\'+\'' .
+ (isset($_GET['enc']) ? '&enc=' . urlencode($_GET['enc']) : '') . '\';
+ return false;">';
+
+ // Font awesome checkbox
+ //echo '<span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
+
+ echo $val;
+
+ echo '</label><br />';
+ }
+
+ echo '</div>';
+ }
// 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 ' <h3>' . self::$lang['lang'] . ': ';
echo ' <select
name="language"
@@ -248,40 +295,44 @@ class BodyController extends Controller
// Izbira jezika z radio gumbi (default)
else {
echo '<h3>' . self::$lang['lang'] . ': </h3>';
- echo '<span style="font-size:13px;">';
+ echo '<span>';
foreach ($lang_array AS $key => $val) {
- echo '<label for="language_' . $key . '">';
- echo '<input type="radio" name="language" id="language_' . $key . '"
- value="' . $key . '"' . ($key == $current ? '
- checked="checked"' : '') . '
- onchange="window.location.href =
- \'' . SurveyInfo::getSurveyLink() . '?language=\'+document.getElementById(\'language_' . $key . '\').value+\'' .
- '&survey-'.get('anketa').'=' . get('cookie_url') . '\'+\'' .
- (isset($_GET['skupina']) ? '&skupina=' . $_GET['skupina'] : '') . '\'+\'' .
- (isset($_GET['preview']) ? '&preview=' . $_GET['preview'] : '') . '\'+\'' .
- (isset($_GET['testdata']) ? '&testdata=' . $_GET['testdata'] : '') . '\'+\'' .
- (isset($_GET['code']) ? '&code=' . $_GET['code'] : '') . '\'+\'' .
- (isset($_GET['params']) ? '&params=' . $_GET['params'] : '') . '\'+\'' .
- (isset($_GET['usr_id']) ? '&usr_id=' . $_GET['usr_id'] : '') . '\'+\'' .
- (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . '\'+\'' .
- (isset($_GET['recnum']) ? '&recnum=' . $_GET['recnum'] : '') . '\'+\'' .
- (isset($_GET['enc']) ? '&enc=' . urlencode($_GET['enc']) : '') . '\';
- return false;">';
+ echo '<div class="variabla">';
+ echo '<label for="language_'.$key.'">';
+
+ echo '<input type="radio" name="language" id="language_' . $key . '"
+ value="' . $key . '"' . ($key == $current ? '
+ checked="checked"' : '') . '
+ onchange="window.location.href =
+ \'' . SurveyInfo::getSurveyLink() . '?language=\'+document.getElementById(\'language_' . $key . '\').value+\'' .
+ '&survey-'.get('anketa').'=' . get('cookie_url') . '\'+\'' .
+ (isset($_GET['skupina']) ? '&skupina=' . $_GET['skupina'] : '') . '\'+\'' .
+ (isset($_GET['preview']) ? '&preview=' . $_GET['preview'] : '') . '\'+\'' .
+ (isset($_GET['testdata']) ? '&testdata=' . $_GET['testdata'] : '') . '\'+\'' .
+ (isset($_GET['code']) ? '&code=' . $_GET['code'] : '') . '\'+\'' .
+ (isset($_GET['params']) ? '&params=' . $_GET['params'] : '') . '\'+\'' .
+ (isset($_GET['usr_id']) ? '&usr_id=' . $_GET['usr_id'] : '') . '\'+\'' .
+ (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . '\'+\'' .
+ (isset($_GET['recnum']) ? '&recnum=' . $_GET['recnum'] : '') . '\'+\'' .
+ (isset($_GET['enc']) ? '&enc=' . urlencode($_GET['enc']) : '') . '\';
+ return false;"
+ >';
+
// Font awesome checkbox
echo '<span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
-
+
echo $val;
-
- echo '</label><br />';
+
+ echo '</label>';
+ echo '</div>';
}
+
echo '</span>';
}
-
echo ' </div>' . "\n";
-
}
echo '</div>' . "\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 '<br />';
echo '<p>';
- echo '<div class="g-recaptcha" data-sitekey="' .$recaptcha_sitekey .'"></div>';
+ echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
echo '</p>';
if($captcha_error){
@@ -427,7 +474,7 @@ class BodyController extends Controller
echo GDPR::getSurveyIntro(get('anketa'));
// JS za prikaz popup-a
- echo '<script> $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''.get('lang_id').'\'); });</script>';
+ echo '<script> $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''.self::$lang['id'].'\'); });</script>';
echo '</div>' . "\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 ' <script> ' . "\n";
+
+ echo ' var srv_meta_anketa_id = ' . get('anketa') . '; ' . "\n";
+ echo ' var srv_site_url = \'' . self::$site_url . '\'; ' . "\n";
+ echo ' var _lang = \'' . self::$lang['language'] . '\'; ' . "\n";
+
+ // GDPR popup
+ echo ' $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''.self::$lang['id'].'\'); });' . "\n";
+
+ echo ' </script> ' . "\n";
+
+
+ // crn div za ozadje popupov
+ echo '<div id="fade"></div>';
+ echo '<div id="popup"></div>';
+
echo '<div class="outercontainer_holder ' . $class . ' uvod_static">';
echo '<div class="outercontainer_holder_top"></div>';
@@ -565,12 +629,19 @@ class BodyController extends Controller
}
echo ' </select>';
echo '</h3>' . "\n";
- } // Izbira jezika z radio gumbi (default)
+ }
+ // Izbira jezika z radio gumbi (default)
else {
+
echo '<h3>' . self::$lang['lang'] . ': </h3>';
- echo '<span style="font-size:13px;">';
+
+ echo '<span>';
+
foreach ($lang_array AS $key => $val) {
+
+ echo '<div class="variabla">';
echo '<label for="language_' . $key . '">';
+
echo '<input type="radio" name="language" id="language_' . $key . '"
value="' . $key . '"' . ($key == $current ? '
checked="checked"' : '') . '
@@ -593,7 +664,8 @@ class BodyController extends Controller
echo $val;
- echo '</label><br />';
+ echo '</label>';
+ echo '</div>';
}
echo '</span>';
}
@@ -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 '</div>'; // -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 ' <script> ' . "\n";
+
+ echo ' var srv_meta_anketa_id = ' . get('anketa') . '; ' . "\n";
+ echo ' var srv_site_url = \'' . self::$site_url . '\'; ' . "\n";
+ echo ' var _lang = \'' . self::$lang['language'] . '\'; ' . "\n";
+
+ // GDPR popup
+ echo ' $(".gdpr_popup_trigger").click(function(){ show_gdpr_about(\''.self::$lang['id'].'\'); });' . "\n";
+
+ echo ' </script> ' . "\n";
+
+
+ // crn div za ozadje popupov
+ echo '<div id="fade"></div>';
+ echo '<div id="popup"></div>';
+
+
+ echo '<div class="outercontainer_holder ' . $class . ' uvod_static">';
+ echo '<div class="outercontainer_holder_top"></div>';
+
+ echo '<div id="outercontainer" class="' . $class . ' uvod_static">';
+ echo '<div class="outercontainer_header"></div>';
+
+
+ echo '<div id="container">' . "\n";
+
+ Display::getInstance()->logo();
+
+ Display::getInstance()->progress_bar();
+
+ if (!get('printPreview')) {
+ echo '<h1 ' . (SurveyInfo::getInstance()->checkSurveyModule('uporabnost') ? ' class="evalvacija"' : '') . '>' . Helper::getInstance()->displayAkronim() . '</h1>' . "\n";
+ }
+
+ //opozorilo ce urejamo ze reseno anketo
+ if (get('quick_view') == true) {
+ echo '<div id="edit_warning">';
+ echo self::$lang['srv_quick_view_text'];
+ echo '</div>';
+ }
+ //opozorilo ce urejamo ze reseno anketo
+ if (isset($_GET['urejanje'])) {
+ echo '<div id="edit_warning">';
+ echo self::$lang['srv_edit_text'];
+ echo '</div>';
+
+ // 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 '<form method="post" action="' . SurveyInfo::getSurveyLink(false, false) . '&amp;grupa=0' . Header::getSurveyParams(true) . str_replace('&', '&amp;', get('cookie_url')) . '">' . "\n";
+ //echo '<form method="post" action="' . SurveyInfo::getSurveyLink(false, false) . '">' . "\n";
+
+ echo '<div class="grupa">' . "\n";
+
+ echo ' <input type="hidden" name="dummy" value="foo">' . "\n";
+ echo ' <input type="hidden" name="referer" value="' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '') . '">' . "\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 '<div class="spremenljivka email_access_code">';
+
+ echo ' <div class="naslov">';
+ echo ' <span class="reminder">*</span>';
+ echo ' <p>Vpišite 6-mestno kodo:</p>';
+ echo ' </div>';
+
+ echo ' <div class="variable_holder">';
+ echo ' <input type="text" name="code" value="" placeholder="000 000">';
+ // Napaka
+ if(isset($response['error'])){
+ echo ' <span class="red">'.$response['error'].'</span>';
+ }
+
+ // Text pod kodo - samo ce smo ravnokar vnesli email
+ if(isset($_POST['email'])){
+
+ $email = isset($_POST['email']) ? $_POST['email'] : '';
+
+ echo '<p>';
+ printf ($lang['srv_email_access_code_text1'], date('H:i'));
+ echo ' <a href="mailto:'.$email.'">'.$email.'</a>';
+ echo '</p>';
+
+ echo '<p><ul>';
+ echo '<span class="bold">'.$lang['srv_email_access_code_text2'].'</span>';
+
+ echo '<li>';
+ echo $lang['srv_email_access_code_text2_1'];
+ echo '</li>';
+
+ echo '<li>';
+ printf ($lang['srv_email_access_code_text2_2'], SurveyInfo::getSurveyLink(false, false));
+ echo '</li>';
+
+ echo '<li>';
+ printf ($lang['srv_email_access_code_text2_3'], '<a href="mailto:'.$email.'">'.$email.'</a>');
+ echo '</li>';
+
+ echo '</ul></p>';
+ }
+
+ echo ' </div>';
+
+ echo '</div>';
+ }
+ // 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 '<div class="spremenljivka email_access_email">';
+ echo ' <div class="naslov">';
+ echo ' <span class="reminder">*</span>';
+ echo ' <p>'.$lang['srv_email_access_email_input_title'].'</p>';
+ echo ' <p class="spremenljivka_info">'.$lang['srv_email_access_email_input_title_label'].'</p>';
+ echo ' </div>';
+
+ echo ' <div class="variable_holder '.(isset($response['error']['email']) ? 'error' : '').'">';
+ echo ' <input type="text" name="email" value="'.$email.'" size="30" placeholder="'.$lang['srv_email_access_email_input_placeholder'].'">';
+ // Napaka
+ if(isset($response['error']['email'])){
+ echo '<span class="red">'.$response['error']['email'].'</span>';
+ }
+ echo ' </div>';
+
+ // Pogoji uporabe
+ if(true){
+
+ $terms = isset($_POST['terms']) ? $_POST['terms'] : '';
+
+ echo ' <div class="variable_holder terms '.(isset($response['error']['terms']) ? 'error' : '').'">';
+
+ echo ' <input type="hidden" name="terms" value="0">';
+ echo ' <input type="checkbox" name="terms" id="terms" value="1" '.($terms == '1' ? 'checked="checked"' : '').'>';
+ echo ' <span class="enka-checkbox-radio"></span>';
+ echo ' <label for="terms">Strinjam se s</label>&nbsp;<span class="link" onClick="show_email_access_terms();">pogoji uporabe</span>';
+
+ // Napaka
+ /*if(isset($response['error']['terms'])){
+ echo '<span class="red">'.$response['error']['terms'].'</span>';
+ }*/
+
+ echo ' </div>';
+ }
+
+ echo '</div>';
+
+
+ // Captcha
+ if($sea->getEmailAccessSettings('captcha') == '1'){
+
+ $captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false;
+ echo '<div class="spremenljivka email_access_captcha '.($captcha_error ? 'required_require' : '').'">';
+ echo ' <div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
+ echo '</div>';
+ }
+ }
+
+ echo ' </div>';
+
+
+ echo '</div>' . "\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 ' <div class="buttons"><input class="next" type="submit" value="' . $label . '">' . "\n";
+
+ if (isset($_GET['popup']) && $_GET['popup'] == '1')
+ echo '<input class="next" type="submit" value="' . self::$lang['srv_zapri'] . '" onclick="$(\'#popup_div, #popup_iframe\', window.parent.document).hide(); return false;">' . "\n";
+
+ echo '</div>';
+ }
+
+ echo '</form>' . "\n";
+
+
+ echo '</div>' . "\n"; // - container
+
+ if (!get('printPreview')) {
+ $this->displayFooterNote();
+ }
+
+ echo '</div>' . "\n"; // - outercontainer
+
+ echo '<div class="outercontainer_holder_bottom"></div>';
+ echo '</div>'; // -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 '</div>' . "\n"; //-grupa
if ($row['user_from_cms'] == 2) {
- //echo '<p style="text-align:center"><a href="'.$site_url.'a/'.$this->anketa.'">'.$lang['srv_nextins'].'</a></p>';
echo '<p style="text-align:center"><a href="' . SurveyInfo::getSurveyLink() . '">' . $lang['srv_nextins'] . '</a></p>';
}
@@ -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 '<p class="vnos"><a href="'.$site_url.'a/'.$this->anketa.'&grupa='.$rowg['id'].'">'.$lang['srv_nextins'].'</a> | <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">'.$lang['srv_insend'].'</a></p>';
+
echo '<p class="vnos"><a href="' . SurveyInfo::getSurveyLink() . '&grupa=' . $rowg['id'] . '">' . $lang['srv_nextins'] . '</a> | <a href="' . $site_url . 'admin/survey/index.php?anketa=' . get('anketa') . '">' . $lang['srv_insend'] . '</a></p>';
}
@@ -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 '<div id="skavti_answers">';
Display::getInstance()->displaySkavtiAnswers();
@@ -1263,11 +1594,10 @@ class BodyController extends Controller
* @desc prikaze konec ankete
*/
public function displayKonecGlasovanje(){
- global $app_settings;
echo '<script>var srv_meta_anketa_id = ' . get('anketa') . ';</script>';
- //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 '<div class="outercontainer_holder concl_glasovanje">';
+ echo '<div class="outercontainer_holder '.$class.' concl_glasovanje">';
echo '<div class="outercontainer_holder_top"></div>';
- echo '<div id="outercontainer concl_glasovanje">' . "\n";
+ echo '<div id="outercontainer" class="'.$class.'">' . "\n";
echo '<div class="outercontainer_header"></div>';
echo '<div id="container">' . "\n";
@@ -1328,7 +1666,7 @@ class BodyController extends Controller
} else {
$concl = $row['conclusion'];
}
- echo ' <h3><p>' . $concl . '</p></h3>' . "\n";
+ echo ' <div class="naslov"><p>' . $concl . '</p></div>' . "\n";
echo ' </div>' . "\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 '<div class="outercontainer_holder concl_statistika">';
+ 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 '<div class="outercontainer_holder '.$class.' concl_statistika">';
echo '<div class="outercontainer_holder_top"></div>';
- echo '<div id="outercontainer concl_statistika">' . "\n";
+ echo '<div id="outercontainer" class="concl_statistika '.$class.'">' . "\n";
echo '<div class="outercontainer_header"></div>';
echo '<div id="container">' . "\n";
@@ -1420,8 +1773,8 @@ class BodyController extends Controller
echo '</div>' . "\n";
echo '<div class="buttons">';
- //$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 '<div class="outercontainer_holder ' . $class . '">';
+ echo '<div class="outercontainer_holder ' . $class . '" concl_evoli>';
echo '<div class="outercontainer_holder_top"></div>';
echo '<div id="outercontainer" class="' . $class . '">' . "\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 '<p class="vnos"><a href="'.$site_url.'a/'.$this->anketa.'&grupa='.$rowg['id'].'">'.$lang['srv_nextins'].'</a> | <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">'.$lang['srv_insend'].'</a></p>';
- echo '<p class="vnos"><a href="' . SurveyInfo::getSurveyLink() . '&grupa=' . $rowg['id'] . '">' . $lang['srv_nextins'] . '</a> | <a href="' . $site_url . 'admin/survey/index.php?anketa=' . get('anketa') . '">' . $lang['srv_insend'] . '</a></p>';
+
+ echo '<p class="vnos"><a href="' . SurveyInfo::getSurveyLink() . '&grupa=' . $rowg['id'] . '">' . $lang['srv_nextins'] . '</a> | <a href="' . $site_url . 'admin/survey/index.php?anketa=' . get('anketa') . '">' . $lang['srv_insend'] . '</a></p>';
}
echo '</div>' . "\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 '<div class="outercontainer_holder ' . $class . '">';
+ echo '<div class="outercontainer_holder '.$class.' '.$grupa_class.'">';
echo '<div class="outercontainer_holder_top"></div>';
echo '<div id="outercontainer" class="' . $class . '">';
@@ -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 '<div class="outercontainer_holder">';
+ echo '<div class="outercontainer_holder all_pages">';
echo '<div class="outercontainer_holder_top"></div>';
echo '<div id="outercontainer">';
@@ -1842,10 +2196,13 @@ class BodyController extends Controller
// Izbira jezika z radio gumbi (default)
else {
echo '<h3>' . self::$lang['lang'] . ': </h3>';
- echo '<span style="font-size:13px;">';
+ echo '<span>';
foreach ($lang_array AS $key => $val) {
+
+ echo '<div class="variabla">';
echo '<label for="language_' . $key . '">';
+
echo '<input type="radio" name="language" id="language_' . $key . '"
value="' . $key . '"' . ($key == $current ? '
checked="checked"' : '') . '
@@ -1868,7 +2225,8 @@ class BodyController extends Controller
echo $val;
- echo '</label><br />';
+ echo '</label>';
+ echo '</div>';
}
echo '</span>';
}
@@ -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 '<p>'.$app_settings['footer_survey_text'].'</p>';
+ if(AppSettings::getInstance()->getSetting('app_settings-footer_survey_custom') !== false){
+ echo '<p>'.AppSettings::getInstance()->getSetting('app_settings-footer_survey_text').'</p>';
}
// 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 '<p class="footer_survey_UL">Univerza <i>v Ljubljani</i></p>';
echo '<p class="footer_survey_FDV"><i>Fakulteta za dru&#382;bene vede</i></p>';
echo '<p class="footer_survey_PoweredBy"><a href="'.$link.'" target="_blank">Powered by: 1KA</a></p>';
echo '<p class="footer_1ka"><a href="'.$link.'" target="_blank">1KA - ' . self::$lang['srv_footer_1ka'] . '</a></p>';
- echo '<p class="privacy">';
-
- $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 = '<a href="'.$link_paradata.'" target="_blank">' . self::$lang['srv_no_paradata'] . '</a>';
-
- echo $privacy_text;
- }
- else{
- echo '<a href="'.$link.'" target="_blank">' . self::$lang['srv_no_anketa'] . ' </a>';
-
- // Piskotki
- if ($row['cookie'] == -1)
- $privacy_text .= '<a href="'.$link_cookie.'" target="_blank">' . self::$lang['srv_no_cookie'] . '</a>, ';
-
- // IP sledenje
- if ($survey_ip == 1)
- $privacy_text .= '<a href="'.$link_paradata.'" target="_blank">' . self::$lang['srv_no_ip'] . '</a>, ';
-
- // Email povezovanje
- if ($row['user_base'] == 1 && $row['show_email'] == 0)
- $privacy_text .= '<a href="'.$link_paradata.'" target="_blank">' . self::$lang['srv_no_email'] . '</a>, ';
-
- echo substr($privacy_text, 0, -2);
- }
-
- echo '</p>';
-
+ // 3. vrstica - politika zasebnosti
echo '<p class="privacy_link">';
echo '<a href="' . $link_privacy . '" target="_blank">' . self::$lang['srv_privacy_policy'] . '</a>';
echo '</p>';
@@ -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 '<div id="preview-window">';
+ echo '<div id="preview_switch">';
+ // Preklop na celostranski preview
+ echo '<div id="nacina">';
+ echo '<span class="bold">'.self::$lang['srv_mode'] . ':</span>';
+ echo '<span id="normalni" class="'.(get('displayAllPages') ? 'nonactive' : 'active').'"><a href="' . SurveyInfo::getSurveyLink() . Header::getSurveyParams(false, null, array('pages')) . '" title="' . self::$lang['srv_normal_x'] . '">' . self::$lang['srv_normal'] . '</a></span>';
+ echo '<span id="celostranski" class="'.(get('displayAllPages') ? 'active' : 'nonactive').'"><a href="' . SurveyInfo::getSurveyLink() . Header::getSurveyParams(false, array('pages' => 'all', 'mobile' => '0')) . '" title="' . self::$lang['srv_scrolling_x'] . '">' . self::$lang['srv_scrolling'] . '</a></span>';
+ echo '</div>';
+
// Gump za odprtje/zaprtje okna
- echo '<div id="preview_open" '.($_GET['testdata'] == 'on' ? ' class="testdata"' : '').'>';
+ echo '<div id="preview_open" '.(isset($_GET['testdata']) && $_GET['testdata'] == 'on' ? ' class="testdata"' : '').'>';
echo '<a href="#" onclick="preview_popup_open(); return false;" class="preview_icon_open" style="display:none;"><span class="faicon dropdown_blue"></span></a>';
echo '<a href="#" onclick="preview_popup_close(); return false;" class="preview_icon_close"><span class="faicon dropup_blue"></span></a>';
echo '</div>';
-
-
- // Preklop na celostranski preview
- echo '<div id="preview_switch">';
-
- echo '<span class="bold">'.self::$lang['srv_mode'] . ':</span>';
- echo '<span class="'.(get('displayAllPages') ? 'nonactive' : 'active').'"><a href="' . SurveyInfo::getSurveyLink() . Header::getSurveyParams(false, null, array('pages')) . '" title="' . self::$lang['srv_normal_x'] . '">' . self::$lang['srv_normal'] . '</a></span>';
- echo '<span class="'.(get('displayAllPages') ? 'active' : 'nonactive').'"><a href="' . SurveyInfo::getSurveyLink() . Header::getSurveyParams(false, array('pages' => 'all', 'mobile' => '0')) . '" title="' . self::$lang['srv_scrolling_x'] . '">' . self::$lang['srv_scrolling'] . '</a></span>';
echo '</div>';
@@ -2010,9 +2332,9 @@ class BodyController extends Controller
// Vsebina - preview-holder
echo '<div id="preview-holder">';
- echo '<div id="preview" class="' . ($_GET['testdata'] == 'on' ? 'testdata' : '') . '">';
+ echo '<div id="preview" class="' . (isset($_GET['testdata']) && $_GET['testdata'] == 'on' ? 'testdata' : '') . '">';
- if ($_GET['testdata'] == 'on')
+ if (isset($_GET['testdata']) && $_GET['testdata'] == 'on')
echo '<p>' . self::$lang['srv_testalert'] . '</p>';
else
echo '<p>' . self::$lang['srv_previewalert'] . '</p>';
@@ -2052,9 +2374,6 @@ class BodyController extends Controller
if (isset($_GET['displayvariables']))
echo '<input type="hidden" name="displayvariables" value="' . $_GET['displayvariables'] . '">';
- if (isset($_GET['disablealert']))
- echo '<input type="hidden" name="disablealert" value="' . $_GET['disablealert'] . '">';
-
if (isset($_GET['disablecode']))
echo '<input type="hidden" name="disablecode" value="' . $_GET['disablecode'] . '">';
@@ -2080,7 +2399,7 @@ class BodyController extends Controller
// Preklop med preview-ji za mobilnik, tablico in pc
if(!get('displayAllPages')){
- echo '<span id="preview_device"><span>' . self::$lang['srv_para_graph_device'] . ': </span>';
+ echo '<div id="preview_device"><span>' . self::$lang['srv_para_graph_device'] . ': </span>';
if (isset($_GET['mobile']) && $_GET['mobile'] == '1')
$device_value = 1;
@@ -2089,16 +2408,16 @@ class BodyController extends Controller
else
$device_value = 0;
- echo '<a href="#" title="PC" onClick="$(\'#device_value\').val(\'0\'); document.change_diable.submit();"><span class="faicon monitor ' . ($device_value == 0 ? ' active' : '') . '"></span></a>';
+ echo '<a href="#" title="PC" onClick="$(\'#device_value\').val(\'0\'); document.change_diable.submit();"><div id="monitor" class="' . ($device_value == 0 ? ' active' : '') . '"><span class="faicon monitor"></span></div></a>';
// 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 '<a href="#" title="' . self::$lang['srv_preview_tablet'] . '" onClick="$(\'#device_value\').val(\'2\'); document.change_diable.submit();"><span class="faicon tablet ' . ($device_value == 2 ? ' active' : '') . '"></span></a>';
- echo '<a href="#" title="' . self::$lang['srv_preview_mobile'] . '" onClick="$(\'#device_value\').val(\'1\'); document.change_diable.submit();"><span class="faicon mobile ' . ($device_value == 1 ? ' active' : '') . '"></span></a>';
+ echo '<a href="#" title="' . self::$lang['srv_preview_mobile'] . '" onClick="$(\'#device_value\').val(\'1\'); document.change_diable.submit();"><div id="mobile" class="' . ($device_value == 1 ? ' active' : '') . '"><span class="faicon mobile"></span></div></a>';
+ echo '<a href="#" title="' . self::$lang['srv_preview_tablet'] . '" onClick="$(\'#device_value\').val(\'2\'); document.change_diable.submit();"><div id="tablet" class="' . ($device_value == 2 ? ' active' : '') . ' ' . ($device_value == 1 ? ' mobile' : '') . ' ' . ($device_value == 0 ? ' monitor' : '') . '"><span class="faicon tablet"></span></div></a>';
}
- echo '</span>';
+ echo '</div>';
}
@@ -2122,9 +2441,6 @@ class BodyController extends Controller
if (isset($_GET['displayvariables']))
echo '<input type="hidden" name="displayvariables" value="' . $_GET['displayvariables'] . '">';
- if (isset($_GET['disablealert']))
- echo '<input type="hidden" name="disablealert" value="' . $_GET['disablealert'] . '">';
-
if (isset($_GET['disablecode']))
echo '<input type="hidden" name="disablecode" value="' . $_GET['disablecode'] . '">';
@@ -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 '<form name="change_diable" action="' . $link . '" method="get">';
echo '<input type="hidden" name="mobile" id="device_value" value="' . $device_value . '">';
@@ -2175,22 +2497,22 @@ class BodyController extends Controller
if (isset($_GET['code']))
echo '<input type="hidden" name="code" value="' . $_GET['code'] . '">';
- echo '<p><label for="disableif"><input type="checkbox" value="1" ' . ($_GET['disableif'] == '1' ? ' checked' : '') . ' name="disableif" id="disableif" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
- echo ' ' . self::$lang['srv_disableif'] . '</label></p>';
+ if (isset($_GET['glas_end']))
+ echo '<input type="hidden" name="glas_end" value="' . $_GET['glas_end'] . '">';
- echo '<p><label for="disablealert"><input type="checkbox" value="1" ' . ($_GET['disablealert'] == '1' ? ' checked' : '') . ' name="disablealert" id="disablealert" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
- echo ' ' . self::$lang['srv_disablealert'] . '</label></p>';
+ echo '<p><label for="disableif"><input type="checkbox" value="1" ' . (isset($_GET['disableif']) && $_GET['disableif'] == '1' ? ' checked' : '') . ' name="disableif" id="disableif" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
+ echo ' ' . self::$lang['srv_disableif'] . '</label></p>';
// 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 '<p><label for="disablecode"><input type="checkbox" value="1" ' . ($_GET['disablecode'] == '1' ? ' checked' : '') . ' name="disablecode" id="disablecode" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
+ echo '<p><label for="disablecode"><input type="checkbox" value="1" ' . (isset($_GET['disablecode']) && $_GET['disablecode'] == '1' ? ' checked' : '') . ' name="disablecode" id="disablecode" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
echo ' ' . self::$lang['srv_disablecode'] . '</label></p>';
}
- echo '<p><label for="displayifs"><input type="checkbox" value="1" ' . ($_GET['displayifs'] == '1' ? ' checked' : '') . ' name="displayifs" id="displayifs" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
+ echo '<p><label for="displayifs"><input type="checkbox" value="1" ' . (isset($_GET['displayifs']) && $_GET['displayifs'] == '1' ? ' checked' : '') . ' name="displayifs" id="displayifs" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
echo ' ' . self::$lang['srv_displayifs'] . '</label></p>';
- echo '<p><label for="displayvariables"><input type="checkbox" value="1" ' . ($_GET['displayvariables'] == '1' ? ' checked' : '') . ' name="displayvariables" id="displayvariables" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
+ echo '<p><label for="displayvariables"><input type="checkbox" value="1" ' . (isset($_GET['displayvariables']) && $_GET['displayvariables'] == '1' ? ' checked' : '') . ' name="displayvariables" id="displayvariables" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
echo ' ' . self::$lang['srv_displayvariables'] . '</label></p>';
@@ -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 '<p><a href="#" onclick="$.post(\'' . self::$site_url . '/main/survey/ajax.php?a=enable_comments\', {anketa: ' . get('anketa') . '}, function () { window.location = window.location + \'&testdata=on\' }); return false;">';
@@ -2214,10 +2536,11 @@ class BodyController extends Controller
echo '</a></p>';
}
else {
- if ($_GET['testdata'] == 'on') {
+ if (isset($_GET['testdata']) && $_GET['testdata'] == 'on') {
echo '<p><label for="hidecomment"><input type="checkbox" value="1" ' . ($_GET['hidecomment'] == '1' ? ' checked' : '') . ' name="hidecomment" id="hidecomment" onchange="document.change_diable.submit();"><span class="enka-checkbox-radio"></span>';
echo ' ' . self::$lang['srv_preview_comments2'] . '</label></p>';
- } else {
+ }
+ else {
echo '<p><a href="#" onclick="$.post(\'' . self::$site_url . '/main/survey/ajax.php?a=enable_comments\', {anketa: ' . get('anketa') . '}, function () { window.location = window.location + \'&testdata=on\' }); return false;">';
echo self::$lang['srv_savedatapreview'];
echo '</a></p>';
@@ -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 '<div style="margin: 20px 0 15px; width: 100%;">';
+ echo '<div id="comments_bottom_line">';
$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 '<div class="open_comment_box" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0" onclick="toggleCommentDropdownTestSurvey();">';
+ echo '<span class="faicon fa-comment empty"></span>';
+ echo self::$lang['srv_survey_general_comment'] . ' ';
+ echo '</a>';
- echo '<span class="stngs floatLeft">';
+ echo '</div>'; //.open_comment_box
- $show_survey_comment = $_GET['show_survey_comment'];
- if ($row['forum'] == 0 || $row['thread'] == 0) {
- echo '<a href="#" onclick="return false;" class="surveycomment bold" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
- echo self::$lang['srv_comment_splosen'] . ' ';
- echo '<span class="faicon comment" title="' . self::$lang['srv_survey_comment'] . '" alt="' . self::$lang['srv_survey_comment'] . '"></span>';
- echo '</a>';
- } else {
+ echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/js-lang.php?lang='.self::$lang['lang_short'].'&amp;v=13.06.07"></script>';
+ echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/comments.js"></script>';
+ }
- $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 '<a href="#" onclick="return false;" class="surveycomment bold" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
- echo self::$lang['srv_comment_splosen'] . ' ';
- echo '<span class="faicon comment" title="' . self::$lang['srv_survey_comment'] . '" alt="' . self::$lang['srv_survey_comment'] . '"></span>';
-
- // 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 '</a>';
- }
+ // Uredniske nastavitve link
+ echo '<a href="' . self::$site_url . '/admin/survey/index.php?anketa=' . get('anketa') . '&a=urejanje" target="_blank" title="' . self::$lang['srv_uredniske_nastavitve'] . '">';
+ echo '<div id="comment_settings">';
+ echo '<span class="faicon settings"></span>';
+ echo '</div></a>';
- echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/js-lang.php?lang='.self::$lang['lang_short'].'&amp;v=13.06.07"></script>';
- // Ce je tole vklopljeno se js porusi?
- //echo '<script type="text/javascript" src="'.self::$site_url.'/admin/survey/minify/g=jsnew?v=13.06.07"></script>';
- echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/jquery/jquery.qtip-1.0.js"></script>';
- echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/script.js"></script>';
- echo '<script> $(function() { load_comment(\'#surveycomment_0_' . $view . '\'' . ($show_survey_comment == '1' ? ', \'2\'' : '') . '); });</script>';
+ echo '</div>'; // #comments_bottom_line
- echo '</span>';
- }
- // Uredniske nastavitve link
- echo '<span class="floatRight bold"><a href="' . self::$site_url . '/admin/survey/index.php?anketa=' . get('anketa') . '&a=testiranje&popup=open" target="_blank" title="' . self::$lang['srv_uredniske_nastavitve'] . '">' . self::$lang['settings'] . ' <span class="faicon settings"></span></a></span>';
+ //dropdown na klik ikone
+ echo '<div id="comment_dropdown_test_survey" class="displayNone">';
+ $anketa = get('anketa');
+ echo '<div class="first_holder_div" id="survey_comment_0_1">';
+ $ba = new BranchingAjax($anketa);
+ $ba->add_comment_field(0, '0', '1', false, false);
echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="small white-blue" onclick="toggleCommentDropdownTestSurvey(); return false;">'.self::$lang['edit1338'].'</button>';
+ echo ' <button class="small blue" onclick="add_comment(\'0\', \'0\', \'1\', $(\'#vsebina_0_1\').val()); actionNotePopup(\'comment_added\', \'success\'); return false;">'.self::$lang['srv_comments_new'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_dropdown
}
// Komentarji respondentov na anketo
- elseif (self::$global_user_id > 0 || true) {
+ else{
- echo '<p class="stngs">';
+ echo '<div id="comments_bottom_line">';
$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 '<div class="open_comment_box" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0" onclick="toggleCommentDropdownTestSurvey();">';
+ echo '<span class="faicon fa-comment empty"></span>';
+ echo self::$lang['srv_survey_general_comment'] . ' ';
+ echo '</a>';
+
+ echo '</div>'; //.open_comment_box
+
+ echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/js-lang.php?lang='.self::$lang['lang_short'].'&amp;v=13.06.07"></script>';
+ echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/comments.js"></script>';
+
+ echo '</div>'; // #comments_bottom_line
+
+
+ //dropdown na klik ikone
+ echo '<div id="comment_dropdown_test_survey" class="displayNone">';
+
+ $anketa = get('anketa');
+ echo '<div class="first_holder_div" id="survey_comment_0_1">';
+ $ba = new BranchingAjax($anketa);
+ $ba->add_comment_field(0, '0', '1', false, false);
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="small white-blue" onclick="toggleCommentDropdownTestSurvey(); return false;">'.self::$lang['edit1338'].'</button>';
+ echo ' <button class="small blue" onclick="add_comment(\'0\', \'4\', \'1\', $(\'#vsebina_0_1\').val()); actionNotePopup(\'comment_added\', \'success\'); return false;">'.self::$lang['srv_comments_new'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_dropdown
+
+ /*$show_survey_comment = $_GET['show_survey_comment'];
if ($row['forum'] == 0 || $row['thread_resp'] == 0) {
echo '<a href="#" onclick="return false;" class="surveycomment bold" id="surveycomment_0_' . $view . '" type="4" view="' . $view . '" spremenljivka="0">';
@@ -2344,10 +2691,10 @@ class BodyController extends Controller
//echo '<script type="text/javascript" src="'.self::$site_url.'/admin/survey/minify/g=jsnew?v=13.06.07"></script>';
echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/jquery/jquery.qtip-1.0.js"></script>';
echo '<script type="text/javascript" src="' . self::$site_url . '/admin/survey/script/script.js"></script>';
- echo '<script> $(function() { load_comment(\'#surveycomment_0_' . $view . '\'' . ($show_survey_comment == '1' ? ', \'2\'' : '') . '); });</script>';
+ echo '<script> $(function() { load_comment(\'#surveycomment_0_' . $view . '\'' . ($show_survey_comment == '1' ? ', \'2\'' : '') . '); });</script>';*/
}
- echo '</p>';
+ echo '</div>';
}
}
@@ -2358,8 +2705,6 @@ class BodyController extends Controller
?><script>
if (localStorage.preview_popup == 1) {
- $('#preview-holder, #preview_switch').hide();
-
$('.preview_icon_open').show();
$('.preview_icon_close').hide();
@@ -2391,26 +2736,8 @@ class BodyController extends Controller
save('cookie_expire', $row['cookie']);
- // alert za shranjevanje cookiejev
- if (get('cookie_expire') != -1 && !(isset($_COOKIE['cookie_ok']) && $_COOKIE['cookie_ok'] == 1) && !empty($row)) {
-
- echo '<div id="cookie_alert">';
- if($mysql_database_name == 'vprasalnikirsrssi')
- echo self::$lang['srv_cookie_ok_rsrs'];
- else
- echo self::$lang['srv_cookie_ok'];
- echo '</div>';
-
- ?><script>
- $(function () {
- $('#cookie_alert').slideDown();
- });
- $('#cookie_ok').on('click', cookie_ok);
- </script><?
- }
-
// alert da je testna anketa
- if ((get('cookie_expire') == -1 || (isset($_COOKIE['cookie_ok']) && $_COOKIE['cookie_ok'] == 1)) && isset($_GET['testdata']) && $_GET['testdata'] == 'on') {
+ if (isset($_GET['testdata']) && $_GET['testdata'] == 'on') {
echo '<div id="test_alert">';
echo self::$lang['srv_test_alert'];
@@ -2423,7 +2750,7 @@ class BodyController extends Controller
</script><?
}
// alert da je predogled
- elseif ((get('cookie_expire') == -1 || (isset($_COOKIE['cookie_ok']) && $_COOKIE['cookie_ok'] == 1)) && isset($_GET['preview']) && $_GET['preview'] == 'on') {
+ elseif (isset($_GET['preview']) && $_GET['preview'] == 'on') {
echo '<div id="test_alert">';
echo self::$lang['srv_preview_alert'];
@@ -2447,12 +2774,6 @@ class BodyController extends Controller
return false;
});
</script><?
-
-
- // Alert ce ni javascripta
- echo '<div id="javascript_alert">';
- echo self::$lang['srv_javascript_warning'];
- echo '</div>';
}
} \ No newline at end of file