anketa = $anketa; SurveyInfo::getInstance()->SurveyInit($this->anketa); UserSetting :: getInstance()->Init($global_user_id); } /** * @desc prikaze vprasanje, uvod, zakljucek, statistiko v glasovanju */ function vprasanja() { global $lang; global $site_url; global $admin_type; $Branching = new Branching($this->anketa); // naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej Cache::cache_all_srv_spremenljivka($this->anketa, true); // enako za srv_branching Cache::cache_all_srv_branching($this->anketa, true); // cachiramo tudi srv_if Cache::cache_all_srv_if($this->anketa); // cache vseh spremenljivk //$this->find_all_spremenljivka(); SurveyInfo::getInstance()->SurveyInit($this->anketa); $rowA = SurveyInfo::getInstance()->getSurveyRow(); $Branching->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); echo ''; //$Branching->showVprasalnikBottom(); } /** * @desc prikaze levi meni s hitrimi nastavitvami */ function display_glasovanje_settings ($displayExtra = 0) { global $lang; global $site_url; global $site_path; global $admin_type; echo '
'.NEW_LINE; echo '
'.NEW_LINE; echo '
' . $lang['srv_glasovanja_settings'] . Help :: display('srv_type_glasovanje') . '
' . NEW_LINE; echo '
'; echo '
'; echo '
'; $sql2 = sisplet_query("SELECT * FROM srv_glasovanje WHERE ank_id='$this->anketa'"); $row2 = mysqli_fetch_array($sql2); $row = Cache::srv_spremenljivka($row2['spr_id']); $rowA = SurveyInfo::getInstance()->getSurveyRow(); //Vkljucenost ankete (embeddana ali samostojna) echo '
'; echo '' . $lang['glasovanja_embed'] . ''; echo '
'; echo ' '; echo '
'; //Izbira spola ob resevanju echo '
'; echo '' . $lang['glasovanja_spol'] . ''; //echo ''; echo ' '; echo ' '; echo '
'; //Prikaz dodatnih strani echo '
'; echo '' . $lang['glasovanja_strani'] . ''; echo ''; echo ' '; echo '
'; echo ''; echo ' '; echo ' '; //echo ' '; // tega ni treba vec /*if($rowA['show_concl'] != 1) echo '(' . $lang['edit3'] . ')';*/ echo '
'; // Prikaz naslova... echo '
'; echo '' . $lang['glasovanja_naslov'] . ''; // prikaz naslova ankete SurveySetting::getInstance()->Init($this->anketa); $survey_hide_title = SurveySetting::getInstance()->getSurveyMiscSetting('survey_hide_title'); echo ''; echo ' '; echo '
'; /*echo ' '; echo ' '; echo '
';*/ //anketa v arhivu - prikaz arhiva echo ''; echo ' '; echo '
'; //echo '
'; echo '
'; //Prikaz statistike - nastavitve echo '
'; echo '' . $lang['glasovanja_results'] . ''; //prikaz statistike echo '
'; echo ' '; echo ' '; echo '
'; if($row['stat'] > 0){ //prikaz stevila glasov, v procentih in z grafom echo '
'; echo ' '; echo ' '; echo '
'; //prikaz stevila glasov echo ''; echo ' '; echo '
'; //prikaz casa glasovanja echo ''; echo ' '; echo '
'; //prikaz naslova vprasanja echo ''; echo ' '; echo '
'; } echo '
'; // SPODNJE EXTRA NASTAVITVE echo ''; // gumb VEC if($displayExtra==1){ echo ''; echo ''.$lang['srv_less'].''; } else{ echo ''.$lang['srv_more'].''; echo ''; } } /** * @desc prikaze vprasanje */ function vprasanje($spremenljivka) { global $lang; $Branching = new Branching($this->anketa); echo '
  • '; $Branching->vprasanje($spremenljivka); echo '
  • '; } /** * @desc prikaze statistiko */ function edit_statistika ($editmode = 0) { global $lang; global $site_path, $site_url; $row = SurveyInfo::getInstance()->getSurveyRow(); $id = -3; $text = $row['statistics']; echo '
    '."\n\r"; if ($editmode == 0) { // <-- Zgornja vrstica pri editiranju vprasanj --- echo '
    '; echo '
    '; // variabla echo '
    '; echo $lang['srv_statistic_label']; echo '
    '."\n\r"; echo '
    '; // prikažemo nastavitve vprasanja $fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false; echo '
    '."\n\r"; echo '
    '; /*if (!$fullscreen && false) { // right spremenljivka icon menu echo '
    '."\n\r"; echo ' '.$lang['srv_editirajspremenljivko'].''."\n\r"; echo ' '.$lang['srv_editirajspremenljivko_fs'].''."\n\r"; echo ' '.$lang['srv_predogled_spremenljivka'].''."\n\r"; echo '
    '."\n\r"; echo ''; } */ echo '
    '; echo '
    '; // --- Zgornja vrstica pri editiranju vprasanj --> // <-- Editor teksta vprasanja --- echo '
    '; echo '
    '.$text.'
    '; echo '
    '; // opomba if ($opomba != '') { echo ''; echo ''; echo ''; echo '
    '.$lang['note'].' ('.$lang['srv_internal'].'):'; echo ''.$opomba.''; echo '
    '; } echo '
    '; /*echo '
    ';*/ } else { // urejanje uvoda,zakljucka // <-- Zgornja vrstica pri editiranju vprasanj --- echo '
    '; echo '
    '; // variabla echo '
    '; echo $lang['srv_statistic_label']; echo '
    '."\n\r"; echo '
    '; // prikažemo nastavitve vprasanja $fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false; echo '
    '."\n\r"; echo ' '; //$this->introconcl_visible($id); echo ' '."\n\r"; echo '
    '; if (!$fullscreen) { // right spremenljivka icon menu echo '
    '."\n\r"; echo ' '.$lang['srv_preglejspremenljivko'].''."\n\r"; echo ' '.$lang['srv_editirajspremenljivko_fs'].''."\n\r"; echo ' '.$lang['srv_predogled_spremenljivka'].''."\n\r"; echo '
    '."\n\r"; } echo '
    '; echo '
    '; // --- Zgornja vrstica pri editiranju vprasanj --> echo '
    '."\n\r"; // <-- Editor teksta vprasanja --- echo '
    '; echo '
    '; echo '
    '; //echo ''; echo $lang['srv_editor'] . ' »'; echo'
    '; echo '
    '; echo ''; echo '
    '; // opomba echo ''; echo ''; echo ''; echo '
    '.$lang['note'].' ('.$lang['srv_internal'].'):'; echo ''; echo '
    '; echo ''; echo '
    '; echo '
    '; echo '
    '; echo ' '; echo '
    '; echo '
    '; } echo '
    '."\n\r"; /* //if ($row['statistics'] == '') { // $text = $lang['results']; //} else { // $text = $row['statistics']; //} $text = $row['statistics']; echo '
    '."\n\r"; if ($editmode == 0) { // <-- Zgornja vrstica pri editiranju vprasanj --- echo '
    '; echo '
    '; // variabla echo '
    '; echo $lang['srv_statistics_edit']; echo '
    '."\n\r"; echo '
    '; echo '
    '; echo '
    '; // --- Zgornja vrstica pri editiranju vprasanj --> // <-- Editor teksta vprasanja --- echo '
    '; echo ''.$text.''; echo '
    '; echo '
    '; // --- Editor teksta vprasanja --> echo '
    '; } else { // <-- Zgornja vrstica pri editiranju vprasanj --- echo '
    '; echo '
    '; // variabla echo '
    '; echo $lang['srv_statistics_edit']; echo '
    '."\n\r"; echo '
    '; echo '
    '; echo '
    '; // --- Zgornja vrstica pri editiranju vprasanj --> echo '
    '."\n\r"; // <-- Editor teksta vprasanja --- echo '
    '; echo '
    Editor
    '; echo ''; echo '
    '; echo '
    '; echo '
    '; // --- Editor teksta vprasanja --> echo '
    '; echo ' '; echo '
    '; echo '
    '; } echo '
    '."\n\r"; */ } /** * @desc pohendla ajax requeste */ function ajax () { global $lang; global $site_url; if (isset ($_POST['results'])) $results = $_POST['results']; if (isset ($_POST['spremenljivka'])) $spremenljivka = $_POST['spremenljivka']; if (isset ($_POST['what'])) $what = $_POST['what']; $displayExtra = (isset($_POST['displayExtra'])) ? $_POST['displayExtra'] : 0; if ($_GET['a'] == 'glasovanje_settings') { if($what == 'stat'){ sisplet_query("UPDATE srv_spremenljivka SET stat = '$results' WHERE id = '$spremenljivka'"); // ce vklopimo statistiko, izklopimo zakljucek if($results != 0) sisplet_query("UPDATE srv_anketa SET show_concl='0' WHERE id = '$this->anketa'"); else sisplet_query("UPDATE srv_anketa SET show_concl='1' WHERE id = '$this->anketa'"); } elseif($what == 'show_intro' || $what == 'show_concl' || $what == 'cookie' || $what == 'user_from_cms' || $what == 'block_ip' || $what == 'starts' || $what == 'expire' || $what == 'vote_limit' || $what == 'vote_count' || $what == 'countType' || $what == 'progressbar') { sisplet_query("UPDATE srv_anketa SET $what = '$results' WHERE id = '$this->anketa'"); } elseif($what == 'survey_hide_title') { SurveySetting::getInstance()->Init($this->anketa); SurveySetting::getInstance()->setSurveyMiscSetting('survey_hide_title', $results); } elseif($what == 'finish_author' || $what == 'finish_respondent_cms' || $what == 'finish_other' | $what == 'finish_other_emails') { sisplet_query("INSERT INTO srv_alert (ank_id, $what) VALUES ('$this->anketa', '$results') ON DUPLICATE KEY UPDATE $what = '$results' "); //sisplet_query("UPDATE srv_alert SET $what = '$results' WHERE ank_id = '$this->anketa'"); } elseif($what == 'akronim') { if($results == 0) sisplet_query("UPDATE srv_anketa SET $what = ' ' WHERE id = '$this->anketa'"); elseif($results == 1) sisplet_query("UPDATE srv_anketa SET $what = '' WHERE id = '$this->anketa'"); else sisplet_query("UPDATE srv_anketa SET $what = '$lang[poll]' WHERE id = '$this->anketa'"); } elseif($what == 'skin_anketa') { sisplet_query("UPDATE srv_anketa SET skin = '$results' WHERE id = '$this->anketa'"); } elseif($what == 'embed'){ sisplet_query("UPDATE srv_glasovanje SET $what = '$results' WHERE spr_id = '$spremenljivka'"); $rowS = Cache::srv_spremenljivka($spremenljivka); if($results == 1 && $rowS['stat'] == 0){ // updatamo skin, ne prikazemo gumba konec, vklopimo zakljucek $url = SurveyInfo::getSurveyLink(); sisplet_query("UPDATE srv_anketa SET skin='Embed', concl_link='0', url='', concl_end_button='0', concl_back_button='0', show_concl='1' WHERE id = '$this->anketa'"); } elseif($results == 1 && $rowS['stat'] > 0){ sisplet_query("UPDATE srv_anketa SET skin='Embed', concl_link='0', url='', concl_end_button='0', concl_back_button='0' WHERE id = '$this->anketa'"); } else{ sisplet_query("UPDATE srv_anketa SET skin='Default', concl_end_button='1', concl_back_button='1' WHERE id = '$this->anketa'"); } } else{ sisplet_query("UPDATE srv_glasovanje SET $what = '$results' WHERE spr_id = '$spremenljivka'"); } if($what == 'spol'){ //ustvarimo vprasanje za spol if($results == 1){ $sqlGrupe = sisplet_query("SELECT id, naslov FROM srv_grupa g WHERE g.ank_id='$this->anketa' ORDER BY g.vrstni_red"); $rowGrupe = mysqli_fetch_assoc($sqlGrupe); $grupa = $rowGrupe['id']; //ustvarimo v bazi novo spremenljivko $b = new Branching($this->anketa); $spr_id = $b->nova_spremenljivka($grupa, 1, 1); $sqlSpr = sisplet_query("UPDATE srv_spremenljivka SET size='2', naslov='Spol', vrstni_red='2' WHERE id='$spr_id'"); //dodamo 2 vrednosti (moski in zenska) $sql = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$spr_id'"); $sql = sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, variable, vrstni_red, other) VALUES ('', '$spr_id', 'Moški', 'M', '1', '')"); $sql = sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, variable, vrstni_red, other) VALUES ('', '$spr_id', 'Ženska', 'Ž', '2', '')"); } //zbrisemo vprasanje za spol else{ $sqlS = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='$this->anketa' AND s.gru_id=g.id AND s.vrstni_red='2'"); $rowS = mysqli_fetch_array($sqlS); $spr_id = $rowS['id']; //pobrisemo iz baze spremenljivko $sql = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$spr_id'"); $sql = sisplet_query("DELETE FROM srv_spremenljivka WHERE id='$spr_id'"); } } // Vsilimo refresh podatkov SurveyInfo :: getInstance()->resetSurveyData(); $this->display_glasovanje_settings($displayExtra); } else if ($_GET['a'] == 'glasovanje_vprasanja') { $this->vprasanja(); } } } ?>