tip) * radio -> tip = 1 * checkbox -> tip = 2 * select -> tip = 3 * text -> tip = 4 // ni vec v uporabi * besedilo* -> tip = 21 * label -> tip = 5 * multigrid -> tip = 6 * multicheckbox -> tip = 16 * multitext -> tip = 19 * multinumber -> tip = 20 * number -> tip = 7 * compute -> tip = 22 // samo v naprednejših anketah (ifi ali test anketa) * quota -> tip = 25 // samo v naprednejših anketah (ifi ali test anketa) * datum -> tip = 8 * ranking -> tip = 17 * vsota -> tip = 18 * grid - multiple -> tip = 24 * iz knjiznice -> tip = 23 // podtip nam pove za tip vprasanja, ki ga poiscemo glede na variablo * SN-imena -> tip = 9 * Lokacija -> tip = 26 * HeatMap -> tip = 27 * * * Tipi anket: (srv_anketa -> survey_type) * Glasovanja -> survey_type = 0 * Forma -> survey_type = 1 * Navadna anketa -> survey_type = 2 || survey_type = 3 (oboje enako - ostanek starih verzij) * * * Moduli anket: (srv_anketa_module) * email (email vabila) * phone (telefonska anketa) * slideshow (prezentacija) * social_network (socialna omrežja - generator imen) * quiz (kviz s pravilnimi/napacnimi odgovori) * voting (volitve z anonimnimi vabili) * uporabnost (evalvacija strani - split screen) * panel (povezovanje ankete s panelom - npr. Valicon, GFK...) * email_access (enkratni dostop do ankete z emailom - narejeno za mju po narocilu) * 360_stopinj (adecco) * 360_stopinj_1ka * evoli * evoli team meter * evoli employeeship meter * hierarhija * mfdps * borza * mju * excelleration matrix * advanced paradata (zbiranje in izvoz naprednih parapodatkov) * maza (mobilna aplikacija za anketirance - 1kapanel) * wpn (web push notifications) **/ /** * KONSTANTE * */ // STARO define("A_IZVOZI", "izvozi"); define("M_IZVOZI_EXCEL", "excel"); define("M_IZVOZI_SPSS", "spss"); define("M_IZVOZI_txt", "txt"); define("A_REPORT_VPRASALNIK_PDF", "vprasalnik_pdf"); define("A_REPORT_VPRASALNIK_RTF", "vprasalnik_rtf"); define("M_REPORT_TEXT", "text"); define("M_REPORT_GRAPHICAL", "graphical"); define("M_REPORT_TOTAL", "total"); // ali je enka še v fazi razvoja (za potrebe skrivanja navigacije,zavihkov,ipd...) // skrite elemente prikaže samo administratorju define("SRV_DEVELOPMENT_VERSION", true); // tipi uporabnikov, (za kontrolo prikaza posameznih elementov) za preverjanje kličemo funkcijo user_role_cehck if (!defined('U_ROLE_ADMIN')) define("U_ROLE_ADMIN", 0); if (!defined('U_ROLE_MANAGER')) define("U_ROLE_MANAGER", 1); if (!defined('U_ROLE_CLAN')) define("U_ROLE_CLAN", 2); if (!defined('U_ROLE_NAROCNIK')) define("U_ROLE_NAROCNIK", 3); global $site_path; class SurveyAdmin { var $anketa; // trenutna anketa var $grupa; // trenutna grupa var $spremenljivka; // trenutna spremenljivka var $branching = 0; // pove, ce smo v branchingu var $stran; var $podstran; var $skin = 0; var $survey_type; // privzet tip je anketa na vecih straneh var $displayLinkIcons = false; // zaradi nenehnih sprememb je trenutno na false, se kasneje lahko doda v nastavitve var $displayLinkText = true; // zaradi nenehnih sprememb je trenutno na true, se kasneje lahko doda v nastavitve var $setting = null; var $db_table = ''; var $icons_always_on = false; # ali ima uporabnik nastavljeno da so ikone vedno vidne var $full_screen_edit = false; # ali ima uporabnik nastavljeno da ureja vprašanja v fullscreen načinu var $isAnketar = false; # Ali je uporabnik anketar ankete privzeto je ne var $first_action = ''; // Prvi nivo navigacije kjer se nahajamo var $second_action = ''; // Drugi nivo navigacije kjer se nahajamo var $third_action = ''; // Tretji nivo navigacije kjer se nahajamo var $layout_width = ''; // Layout strani kjer se nahajamo - "fullwidth", "wide" ali "narrow" var $layout_menu = ''; // Layout strani kjer se nahajamo - "menu_lef" (prisoten levi meni) /** * @desc konstruktor */ function __construct($action = 0, $anketa = 0) { global $surveySkin, $site_url, $global_user_id; if (isset ($surveySkin)) $this->skin = $surveySkin; else $this->skin = 0; // polovimo anketa ID if ($anketa != 0) $this->anketa = $anketa; elseif (isset ($_GET['anketa'])) $this->anketa = $_GET['anketa']; elseif (isset ($_POST['anketa'])) $this->anketa = $_POST['anketa']; # clearing E_NOTICE if (!isset($_GET['a'])) { $_GET['a'] = null; } if (!isset($_GET['m'])) { $_GET['m'] = null; } if (!isset($_GET['t'])) { $_GET['t'] = null; } if (!isset($_GET['mode'])) { $_GET['mode'] = null; } UserSetting:: getInstance()->Init($global_user_id); $this->icons_always_on = UserSetting:: getInstance()->getUserSetting('icons_always_on'); $this->full_screen_edit = UserSetting:: getInstance()->getUserSetting('full_screen_edit'); $this->isAnketar = Common::isUserAnketar($this->anketa, $global_user_id); SurveyInfo::getInstance()->SurveyInit($this->anketa); $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString(); $this->survey_type = $this->getSurvey_type($this->anketa); if ($_GET['a'] == 'branching' || $this->survey_type > 1) $this->branching = 1; if ($this->anketa > 0) { // preverimo ali anketa sploh obstaja if (!$this->checkAnketaExist()) { header('location: ' . $site_url . 'admin/survey/index.php'); } else { // preverimo userjev dostop - ZAKAJ SMO TUKAJ IMELI DODATNE POGOJE??? NEKDO BREZ DOSTOPA DO ANKETE NE MORE KAR VEDNO DOSTOPATI DO ANALIZ //if ($this->checkDostop() || $_GET['a'] == A_ANALYSIS || $_GET['a'] == 'analiza' || $_GET['a'] == 'analizaReloadData' || $_GET['t'] == A_ANALYSIS || $_GET['a'] == A_REPORTI) { //if ($this->checkDostop() && ($this->isAnketar || $this->checkDostopAktiven() || $_GET['a']=='redirectLink' || $_GET['a']==A_ANALYSIS || $_GET['a']=='analiza' || $_GET['a']=='analizaReloadData' || $_GET['t']==A_ANALYSIS || $_GET['a']==A_REPORTI)) { if ($this->checkDostop()){ // pasivne uporabnike preusmerimo na status tudi pri neaktivni anketi if ($this->checkDostop() && !$this->checkDostopAktiven() && !isset($_GET['a'])) { header('location: ' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI); die(); } // ugotovimo ali je uporabnik telefonski anketar else if ($this->isAnketar && $_GET['a'] != A_TELEPHONE) { #če je anketar lahko samo kliče header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_TELEPHONE . '&m=start_call'); exit(); } // ok } else { // pri ajax klicih ne sme naprej, da ne more pisat v bazo header('location: ' . $site_url . 'admin/survey/'); die(); } } } if ($action == 0) { if (isset ($_GET['anketa'])) { SurveyInfo:: getInstance()->SurveyInit($this->anketa); if (isset ($_GET['grupa'])) { $this->grupa = $_GET['grupa']; } elseif (!isset ($_GET['a'])) { $sql = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='$this->anketa' ORDER BY vrstni_red LIMIT 1"); $row = mysqli_fetch_array($sql); $this->grupa = $row['id']; } // meta podatki, ki jih beremo z JS echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; // Ce imamo vklopljene komercialne pakete if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){ $userAccess = UserAccess::getInstance($global_user_id); // Ce gre za staro anketo nimamo omejitev if($userAccess->isAnketaOld()){ $commercial_package = '-1'; } else{ $commercial_package = $userAccess->getPackage(); } } else{ $commercial_package = '-1'; } echo ''; echo '
'; ?> anketa == 0) die(); } $this->stran = $_GET['a']; } /** * @desc pohendla zadeve in prikaze ustrezne elemente ankete */ function display(){ global $site_url; global $global_user_id; global $lang; global $admin_type; global $site_domain; // prvi in drugi nivo (tretji samo za mobilno navigacijo) $navigationArray = CrossRoad::MainNavigation($this->anketa, true); $this->first_action = $navigationArray['first_action']; $this->second_action = $navigationArray['second_action']; $this->third_action = $navigationArray['third_action']; // Layout strani $this->layout_width = $navigationArray['layout_width']; $this->layout_menu = $navigationArray['layout_menu']; $this->hide_header = $navigationArray['hide_header']; echo '
'; /********************* GLAVA *********************/ echo '
'; // DESKTOP HEADER echo '
'; // Znotraj posamezne ankete if($this->anketa > 0){ // Prikaze podatke o anketi in navigacijo - na vrhu (top bar) $this->displayHeaderAnketa(); } // Seznam anket else{ $this->displayHeaderSeznamAnket(); } echo '
'; // MOBILE HEADER echo '
'; $mobile_admin = new MobileSurveyAdmin($this); $mobile_admin->displayHeaderMobile(); echo '
'; echo '
'; /********************* GLAVA - END *********************/ /********************* MAIN *********************/ echo '
'; // SEZNAM ANKET - Ce ni nastavljene ankete, potem prikazujemo seznam na prvi strani *****/ if (!($this->anketa > 0)) { $this->displaySeznamAnket(); } // ZNOTRAJ ANKETE else{ echo '
'; // breadcrumbs echo ''; echo '
'; $this->displayAnketa(); echo '
'; echo '
'; } /***** SKRITI DIVI ZA POPUPE *****/ $this->displayHiddenPopups(); echo '
'; /********************* MAIN - END *********************/ /********************* FOOTER *********************/ $this->displayFooter(); /********************* FOOTER - END *********************/ echo '
'; // Preklop domene - javimo popup if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->visibleSwitchPopup()){ echo ''; } } // Prikazemo skrite dive za popupe private function displayHiddenPopups(){ global $lang; // Loading ikona echo '
'; echo ' '; echo ' '.$lang['srv_saving'].''; echo '
'; // Okencki spodaj levo echo '
'; // Trenutno aktivni uredniki echo '
'; $this->check_online_users(); echo '
'; // Obvestilo o akciji (success...) spodaj levo echo '
'; echo '
'; echo '
'; $this->clipboard_display(); echo '
'; echo '
'; // fade pri fullscreen urejanje spremenljivke echo '
'; echo ''; echo '
'; } // Utripajoc napis "Demo anketa" private function displayHeaderDemoSurvey(){ global $lang; // Demo anketa utripanje if (!Dostop::isMetaAdmin()) { echo '
'; echo '
' . $lang['srv_close_invisible'] . '
'; ?> displayHeaderTopLine(); // Prvi nivo navigacije $this->showMainNavigation(); // Preverimo, ce ima uporabnik dostop do te podstrani $d = new Dostop(); if($d->checkDostopSubFromNavigation($this->first_action)){ // Drugi nivo navigacije $this->secondNavigation(); // Tretji nivo navigacije po potrebi glede na podstran $this->thirdNavigation(); } } /** * prikaze glavo v seznamu anket * */ private function displayHeaderSeznamAnket(){ global $lang, $site_url, $global_user_id, $admin_type, $site_domain, $cookie_domain; // Pobrisemo vse preview vnose Common::deletePreviewData($this->anketa); # naložimo razred z seznamom anket $SL = new SurveyList(); $SLCount = $SL->countSurveys(); $SLCountPhone = $SL->countPhoneSurveys(); // Obvestilo da ima uporabnik neprebrano sporocilo $NO = new Notifications(); $countMessages = $NO->countMessages(); if ($countMessages > 0) { echo '
'; echo $lang['srv_notifications_alert']; echo '
'; // Ce imamo vklopljen avtomatski prikaz sporcila (za pomembne zadeve), ga prikazemo po loadu if($NO->checkForceShow()) echo ''; } // GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah if ( ($site_url == 'http://test.1ka.si/' || isWWW() || isAAI() || ($cookie_domain == '.1ka.si' && isVirtual())) && User::getInstance()->getSetting($setting='gdpr_agree') == '-1' ) { // Avtomatsko prikazemo po loadu echo ''; } // Zgornja vrstica v headerju $this->displayHeaderTopLine($class='folders'); // Navigacija echo '
'; $SL->display_tabs(); echo '
'; # smo v knjižnici $SL->display_sub_tabs(); } public function displayHeaderTopLine($class=''){ global $lang, $site_url, $global_user_id, $admin_type, $site_domain; echo '
'; // logotip $this->displayHeaderLogo(); // Nastavitve ankete if($class != 'folders') $this->displayHeaderAnketaSettings(); // Nastavitve zgoraj desno v headerju (search, help, profil...) $this->displayHeaderRight(); // Utripajoc napis "Demo anketa" if(isDemoSurvey($this->anketa)){ $this->displayHeaderDemoSurvey(); } echo '
'; } // Prikazemo podatke zgoraj desno v glavi (search, user, help) private function displayHeaderRight(){ global $site_url; global $global_user_id; global $lang; // user navigacija echo '
'; // Gumb za nadgraditev paketa v mojih anketah (ce imamo vklopljene pakete in nimamo 3ka paketa) if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){ // Preverimo trenuten paket uporabnika $userAccess = UserAccess::getInstance($global_user_id); $current_package = $userAccess->getPackage(); if($current_package != '3' && !$userAccess->userNotAuthor() && !isDemoSurvey($this->anketa)){ $drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/'; $upgrade_url = $drupal_url.'izvedi-nakup/3/podatki'; $button_text = ($current_package == '2') ? $lang['srv_access_upgrade2'] : $lang['srv_access_upgrade']; if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){ /*echo '
'; echo ' '; echo '
';*/ } else{ echo '
'; echo ' '; echo '
'; } } } // Grid vseh linkov za pomoc, cenik,... echo ''; // Search po zunanji lupini - preusmeri na drupalov search echo '
'; if($lang['id'] != "1") $drupal_search_url = 'https://www.1ka.si/d/en/iskanje/'; else $drupal_search_url = 'https://www.1ka.si/d/sl/iskanje/'; echo '
'; echo ''; echo ' '; echo ''; echo ''; echo '
'; echo '
'; // Hitra pomoč - povezave na linke s pomočjo na www.1ka.si $subdomain = ($lang['id'] == "1") ? 'www' : 'english'; $help_url = Common::getHelpUrl($subdomain, $this->first_action); echo '
'; echo ' '; echo ' '; echo ' '; echo '
'; // povezava na fieldwork sync if ($this->anketa > 0) { // poglej če je tale ID ankete v srv_fieldwork $sql = sisplet_query("SELECT id FROM srv_fieldwork where sid_server='" . $this->anketa . "'"); if (mysqli_num_rows($sql) > 0) { // nariši link. echo '
'; echo ''; echo ''; echo ' '; echo '
'; } } // User profil $sql = $this->db_select_user($global_user_id); $row = mysqli_fetch_array($sql); $text = $row['name'] . ' ' . $row['surname']; $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text; echo '
'.$text.' '; echo '
'; echo '
'; echo '
'; } // Prikazemo logo zgoraj levo private function displayHeaderLogo(){ global $lang; global $site_url; // Logo glede na jezik in namestitev $logo_class = ''; if(isLastnaInstalacija() || isVirtual()) $logo_class = 'namestitev'; elseif(isAAI()) $logo_class = 'arnes'; if($lang['id'] != "1") $logo_class .= ' english'; $url = ($site_url == "https://www.1ka.si/" && $lang['id'] != "1") ? "https://www.1ka.si/d/en/" : $site_url; echo '
'; echo ' '; echo '
'; } // Prikaze ime ankete, zvezdico in tiste linke spodi (ker se vse refresha z ajaxom) private function displayHeaderAnketaSettings() { global $lang; global $site_url; global $admin_type; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); // ajaxa se poslje skupaj z ajaxom, da ob updatu vemo kaksen 'a' je bil na originalni strani // (drugace se ob updatu z ajaxom informacija o 'a'ju zgubi) $get = $_GET['a']; if (isset ($_GET['ajaxa'])) $get = $_GET['ajaxa']; SurveyInfo::getInstance()->SurveyInit($this->anketa); $row = SurveyInfo::getInstance()->getSurveyRow(); SurveySetting::getInstance()->Init($this->anketa); if ($this->skin == 0) { // Top navigacija echo '
'; // aktivni ki lahko tudi urejajo if ($this->checkDostopAktiven()) { echo '
'; if($hierarhija_type == 10){ echo '' . $row['naslov'] . ''; } else{ echo '' . $row['naslov'] . ''; } echo '
'; } // pasivni lahko samo gledajo else { echo '
'.$row['naslov'].'
'; } // Pomoc echo '
'; $this->request_help(); echo '
'; echo ''; // URL, aktivacija, deaktivacija echo '
isAnketar == true ? ' class="visibility_hidden"' : '') . '>'; $this->displayAktivnost(); echo '
'; // Nastavitve ankete - ikona $d = new Dostop(); if ($d->checkDostopSub('edit')) { echo '
'; if ($hierarhija_type == 10) { echo ''; echo ''; echo ''.$lang['settings'].''; echo ''; } else { echo ''; echo ''; echo ''.$lang['settings'].''; echo ''; } echo '
'; } // email anketa $reloadSetting = ($_GET['a'] == "nastavitve") ? "'1'" : "'0'"; echo ''; echo '
'; SurveySetting::getInstance()->Init($this->anketa); // komentar na anketo, ki je vedno viden if (SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_showalways') == 1 && $admin_type <= SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment') ) { echo ' '; } } } // Prikazemo prvi nivo navigacije in nastavimo stran in podstran na katerem se nahajamo private function showMainNavigation(){ global $lang, $site_url, $admin_type; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); $row = SurveyInfo::getInstance()->getSurveyRow(); SurveyInfo:: getInstance()->SurveyInit($this->anketa); $modules = SurveyInfo::getSurveyModules(); $css_status = 'off'; $css_urejanje = 'off'; $css_testiranje = 'off'; $css_objava = 'off'; $css_data = 'off'; $css_analysis = 'off'; if ($this->first_action == NAVI_STATUS) { $css_status = 'on'; } if ($this->first_action == NAVI_UREJANJE) { $css_urejanje = 'on'; } if ($this->first_action == NAVI_TESTIRANJE) { $css_testiranje = 'on'; } if ($this->first_action == NAVI_OBJAVA) { $css_objava = 'on'; } if ($this->first_action == NAVI_RESULTS && $_GET['m'] != 'monitoring') { $css_data = 'on'; } if ($this->first_action == NAVI_ANALYSIS) { $css_analysis = 'on'; } $d = new Dostop(); echo '
'; echo '
'; echo ''; // Ikone na desni echo '
'; # zavhiki dodatnih nastavitev echo ''; // Ikone komentarjev, jezika... $d = new Dostop(); if ($d->checkDostopAktiven()) { echo '
    '; // V kolikor je vklopljena hierarhija in imamo gor splošne uporabnike, potem nastavitev ne prikazujemo $hierarhija_prikaz = true; if(SurveyInfo::getInstance()->checkSurveyModule('hierarhija') && $hierarhija_type == 10) $hierarhija_prikaz = false; // ikonco za jezik prikazujemo po potrebi if ($row['multilang'] == 1) { $p = new Prevajanje($this->anketa); global $lang1; echo '
  1. '; echo ''; echo ''; echo ''; echo '
  2. '; } // Ikona za vklop jezika, če je v globalnih nastavitvah vklopljena opcija //elseif (UserSetting::getInstance()->getUserSetting('showLanguageShortcut')) { else{ echo '
  3. '; echo ''; echo ''; echo ''; echo '
  4. '; } // Ikonca ce je izklopljeno prilagajanje za mobitel (mobile friendly) $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly'); if ($mobile_friendly == 0) { echo '
  5. '; echo ''; echo ''; echo ''; echo '
  6. '; } #ikonco za komentarje prikazujemo po potrebi if ($this->survey_type > 1 && $hierarhija_prikaz) { $sc = new SurveyComments($this->anketa); $sc->display_comments_icon(); } echo '
'; } echo '
'; # class="right_items" echo '
'; # id="firstNavigation" echo '
'; # id="surveyNavigation" } // Prikazemo drugi nivo navigacije private function secondNavigation(){ global $lang, $site_url, $admin_type; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); # ajaxa se poslje skupaj z ajaxom, da ob updatu vemo kaksen 'a' je bil na originalni strani # (drugace se ob updatu z ajaxom informacija o 'a'ju zgubi) $get = isset($_GET['a']) ? $_GET['a'] : ''; if (isset ($_GET['ajaxa'])) $get = $_GET['ajaxa']; if (trim($get) == '') $get = A_BRANCHING; //*** druga vrstica navigacije ***// echo '
'; # podzavihek: urejanje ankete if ($this->first_action == NAVI_UREJANJE) { echo ''; # link arhivi if (!$this->isAnketar) { echo '
'; echo ''; } } # podzavihek: testiranje if ($this->first_action == NAVI_TESTIRANJE) { echo ''; // Ce imamo testne vnose prikazemo povezavo na arhiv testnih vnosov if ($this->survey_type > 1) { $str_testdata = "SELECT count(*) FROM srv_user WHERE ank_id='" . $this->anketa . "' AND (testdata='1' OR testdata='2') AND deleted='0'"; $query_testdata = sisplet_query($str_testdata); [$testdata] = mysqli_fetch_row($query_testdata); # link arhivi if ((int)$testdata > 0) { echo '
'; echo ''; } } } # podzavihek: email-vabila, objava if ($this->first_action == NAVI_OBJAVA) { $tab = $_GET['m']; $get = $_GET['m']; echo ''; # link arhivi echo '
'; echo ''; } # podzavihek: analize if ($this->first_action == NAVI_ANALYSIS) { echo ''; # link arhivi echo '
'; echo ''; } # podzavihek: rezultati if ($this->first_action == NAVI_RESULTS) { if ($_GET['m'] != 'monitoring') { echo ''; # link arhivi if ($d->checkDostopSub('edit')) { echo '
'; echo ''; } } } # podzavihek: napredne možnosti if ($this->first_action == NAVI_ADVANCED) { # preštejemo katere module imamo. če imamo samo nastavitve prikažemo kot samostojn zavihek $row = SurveyInfo::getInstance()->getSurveyRow(); $modules = SurveyInfo::getSurveyModules(); $cnt_modules = (int)count($modules) + (int)($row['user_from_cms'] == 2 && $row['cookie'] == -1); echo ''; } # podzavihek: status if ($this->first_action == NAVI_STATUS || $this->first_action == 'para_graph' || $this->first_action == 'nonresponse_graph' || $this->first_action == 'AAPOR' || $this->first_action == 'langStatistic' || $this->first_action == 'usable_resp' || $this->first_action == 'speeder_index' || $this->first_action == 'reminder_tracking' || $this->first_action == 'status_advanced') { echo ''; } # še sinle elementi za posebne linke: #quicksettings if ($_GET['a'] == 'quicksettings') { echo ''; } if ($_GET['a'] == 'data' && $_GET['m'] == 'monitoring') { echo ''; } # Ikonce za pdf rtf word if($hierarhija_type < 5) { echo ''; echo '
'; #
} } // Prikazemo dodaten tretji nivo navigacije po potrebi private function thirdNavigation(){ global $global_user_id; $podstran = ''; if($_GET['a'] == 'theme-editor'){ $podstran = 'theme-editor'; } elseif($_GET['a'] == A_COLLECT_DATA_EXPORT){ $podstran = 'export'; } elseif($_GET['a'] == A_HIERARHIJA && ($_GET['m'] == M_ANALIZE)){ $podstran = 'means'; } // Zavihki TESTIRANJE elseif($_GET['a'] == 'testiranje' && $_GET['m'] == 'predvidenicas'){ $podstran = 'ocena_trajanja'; } elseif($_GET['a'] == 'testiranje' && $_GET['m'] == 'cas'){ $podstran = 'dejanski_casi'; } elseif($_GET['a'] == 'komentarji_anketa'){ $podstran = 'komentarji_anketa'; } elseif($_GET['a'] == 'komentarji'){ $podstran = 'komentarji'; } // Zavihki PODATKI elseif($_GET['a'] == 'data'){ if(!isset($_GET['m']) || $_GET['m'] == 'view'){ $podstran = 'data'; } elseif($_GET['m'] == 'quick_edit'){ $podstran = 'quick_edit'; } elseif($_GET['m'] == 'variables'){ $podstran = 'variables'; } } // Zavihki ANALIZA elseif($_GET['a'] == 'analysis' && $_GET['m'] != 'anal_arch' && $_GET['m'] != 'vizualizacija'){ if (isset($_GET['podstran'])) { $podstran = $_GET['podstran']; } else if (isset($_POST['podstran'])) { $podstran = $_POST['podstran']; } else if (isset($_GET['m'])) { $podstran = $_GET['m']; } else { $podstran = M_ANALYSIS_SUMMARY; } } elseif($_GET['a'] == 'usable_resp'){ $podstran = 'usable_resp'; } elseif($_GET['a'] == 'AAPOR'){ $podstran = 'aapor'; } elseif($_GET['a'] == 'reminder_tracking'){ $podstran = 'reminder_tracking'; } elseif($_GET['a'] == 'para_graph'){ $podstran = 'para_graph'; } elseif($_GET['a'] == 'nonresponse_graph'){ $podstran = 'para_analysis_graph'; } // Izrisemo ustrezen meni, ce je prisoten if($podstran != ''){ SurveyStatusProfiles::Init($this->anketa, $global_user_id); $SSH = new SurveyStaticHtml($this->anketa); $SSH->displayTopSettings($podstran); } } // Priakz footerja private function displayFooter(){ global $lang; global $site_frontend; global $mysql_database_name; global $admin_type; echo ''; } // Pohendla prikazovanje vsebine ankete private function displayAnketa(){ global $global_user_id; // Preverimo, ce ima uporabnik dostop do te podstrani $d = new Dostop(); if(!$d->checkDostopSubFromNavigation($this->first_action)){ $d->displayDostopNoAccess(); return; } // Imamo levi meni if($this->layout_menu == 'menu_left'){ $userAccess = UserAccess::getInstance($global_user_id); // Prikazemo meni na levi po potrebi glede na podstran echo '
'; $this->displayLeftMenu(); echo '
'; // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); if(!$userAccess->checkUserAccess()){ $userAccess->displayNoAccess(); return; } // Prikazemo glavni del urejanja ankete echo '
'; $this->displayAnketaMain(); echo '
'; } // Ni levega menija else{ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); if(!$userAccess->checkUserAccess()){ $userAccess->displayNoAccess(); return; } // Prikazemo glavni del urejanja ankete $this->displayAnketaMain(); } } // Prikazemo glavni del urejanja ankete private function displayAnketaMain(){ // Ustrezno redirectamo anketo na ustrezno stran if ($_GET['a'] == 'redirectLink') { // Preverimo, če gre za anketo, ki vsebuje hierarhijo unset($_SESSION['hierarhija'][$this->anketa]); if(SurveyInfo::checkSurveyModule('hierarhija', $this->anketa)) $_SESSION['hierarhija'][$this->anketa]['type'] = \Hierarhija\HierarhijaHelper::preveriTipHierarhije($this->anketa); $this->redirectLink(); } // Kreira arhiv elseif ($_GET['a'] == 'backup_create') { $sas = new SurveyAdminSettings(); $sas->backup_create(); } // Skopira anketo na drugo stran elseif ($_GET['a'] == 'anketa_copy') { $sas = new SurveyAdminSettings(); $sas->anketa_copy(); } // Restore ankete elseif ($_GET['a'] == 'backup_restore') { $sas = new SurveyAdminSettings(); $sas->backup_restore(); } // Prikazemo arhive elseif(in_array($_GET['a'], ['arhivi', 'tracking', 'tracking-hierarhija'])){ $this->displayAnketaTabArhiv(); } // Prikazemo vsebino glede na zavihek else{ switch($this->first_action){ // Zavihek status case NAVI_STATUS: $this->displayAnketaTabStatus(); break; // Zavihek urejanje case NAVI_UREJANJE: $this->displayAnketaTabUrejanje(); break; // Zavihek testiranje case NAVI_TESTIRANJE: $this->displayAnketaTabTestiranje(); break; // Zavihek objava case NAVI_OBJAVA: $this->displayAnketaTabObjava(); break; // Zavihek podatki case NAVI_RESULTS: $this->displayAnketaTabPodatki(); break; // Zavihek analize case NAVI_ANALYSIS: $this->displayAnketaTabAnalize(); break; // Zavihek hierarhija case NAVI_HIERARHIJA: $this->displayAnketaTabHierarhija(); break; default: break; } } } // Prikazemo levi meni po potrebi private function displayLeftMenu(){ global $lang, $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); // Levi meni v nastavitvah ankete if ($_GET['a'] == 'nastavitve' || $_GET['a'] == 'urejanje' || $_GET['a'] == 'alert' || $_GET['a'] == 'dostop' || $_GET['a'] == 'jezik' || $_GET['a'] == 'osn_pod' || $_GET['a'] == 'piskot' || $_GET['a'] == 'trajanje' || $_GET['a'] == 'forma' || $_GET['a'] == 'metadata' || $_GET['a'] == 'mobile_settings' || $_GET['a'] == 'table_settings' || $_GET['a'] == A_PRIKAZ || $_GET['a'] == A_MISSING || $_GET['a'] == A_SKUPINE || $_GET['a'] == A_EXPORTSETTINGS || $_GET['a'] == A_GDPR || $_GET['a'] == 'uporabnost' || ($_GET['a'] == 'hierarhija_superadmin' && $hierarhija_type < 5) || $_GET['a'] == 'kviz' || $_GET['a'] == 'voting' || $_GET['a'] == 'slideshow' || $_GET['a'] == 'vnos' || $_GET['a'] == A_TELEPHONE || $_GET['a'] == A_CHAT || $_GET['a'] == A_PANEL || $_GET['a'] == A_EMAIL_ACCESS || $_GET['a'] == A_FIELDWORK || $_GET['a'] == A_MAZA || $_GET['a'] == A_WPN || $_GET['a'] == 'social_network' || $_GET['a'] == A_360 || $_GET['a'] == A_360_1KA || $_GET['a'] == 'evoli' || $_GET['a'] == 'evoli_teammeter' || $_GET['a'] == 'evoli_quality_climate' || $_GET['a'] == 'evoli_teamship_meter' || $_GET['a'] == 'evoli_organizational_employeeship_meter' || $_GET['a'] == 'evoli_employmeter' || $_GET['a'] == 'mfdps' || $_GET['a'] == 'borza' || $_GET['a'] == 'mju' || $_GET['a'] == 'excell_matrix' || $_GET['a'] == 'advanced_paradata' || $_GET['a'] == 'advanced_timestamps' || $_GET['a'] == 'json_survey_export' ){ if ($this->isAnketar) { return; } $this->showGlobalSettingsLinks(); if ($this->survey_type > 1) { $this->showAdvancedModulesLinks(); } $this->showAdditionalSettingsLinks(); } // Uvoz podatkov levi meni elseif ($_GET['a'] == A_COLLECT_DATA && in_array($_GET['m'], ['append', 'merge', 'upload_xls', 'append_xls', 'merge_xls'])) { echo '
'; echo ''; echo '
'; } // Kalkulacija podatkov levi meni elseif ($_GET['a'] == A_COLLECT_DATA && in_array($_GET['m'], ['calculation', 'coding_auto', 'coding', M_COLLECT_DATA_RECODING])) { echo '
'; echo ''; echo '
'; } // Izvoz podatkov levi meni elseif ($_GET['a'] == A_COLLECT_DATA_EXPORT) { echo '
'; echo ''; echo '
'; } // Arhiv levi meni elseif(in_array($_GET['a'], ['arhivi', 'tracking', 'tracking-hierarhija']) || in_array($_GET['m'], ['anal_arch', 'view_archive'])){ //echo ''.$lang['srv_arhivi'].''; echo ''; } } private function displayAnketaTabStatus(){ global $lang; global $admin_type; // Osnovni statusi if ($_GET['a'] == A_REPORTI) { Common::deletePreviewData($this->anketa); $ss = new SurveyStatistic(); $ss->Init($this->anketa); echo '
'; $ss->Display(); echo '
'; } // prikaze reporte elseif ($_GET['a'] == 'AAPOR') { $ss = new SurveyStatistic(); $ss->Init($this->anketa); echo '
'; $ss->DisplayAaporCalculations(); echo '
'; } // prikaze grafe neodgovorov elseif ($_GET['a'] == A_NONRESPONSE_GRAPH) { echo '
'; $SPA = new SurveyParaAnalysis($this->anketa); $SPA->DisplayGraph(); echo '
'; } // prikaze stevilo neodgovorov za posamezne respondente elseif ($_GET['a'] == A_USABLE_RESP) { echo '
'; $SUR = new SurveyUporabnost($this->anketa); $SUR->displayUporabnost(); echo '
'; } // prikaze modul kakovost elseif ($_GET['a'] == A_KAKOVOST_RESP) { echo '
'; $SUR = new SurveyKakovost($this->anketa); $SUR->displayKakovost(); echo '
'; } // Prikaze analizo hitrosti respondenta elseif ($_GET['a'] == A_SPEEDER_INDEX) { echo '
'; $SUR = new SurveySpeedIndex($this->anketa); $SUR->displaySpeedIndex(); echo '
'; } // prikaze stevilo znakov v anketi, stevilo besed... elseif ($_GET['a'] == A_TEXT_ANALYSIS) { echo '
'; $STA = new SurveyTextAnalysis($this->anketa); $STA->displayTable(); echo '
'; } // analize editiranja elseif ($_GET['a'] == A_EDITS_ANALYSIS) { $sea = new SurveyEditsAnalysis($this->anketa); echo '
'; $sea->displayTable(); echo '
'; } // prikaze analizo lokacij na podlagi ip stevilk elseif ($_GET['a'] == A_GEOIP_LOCATION) { echo '
'; $STA = new SurveyGeoIP($this->anketa); $STA->displayData(); echo '
'; } // prikaze analizo opozoril elseif ($_GET['a'] == A_REMINDER_TRACKING) { echo '
'; $SRT = new SurveyReminderTracking($this->anketa); $SRT->displayTable(); echo '
'; } // prikaze analizo anket za evalvacijo (ul) elseif ($_GET['a'] == A_UL_EVALVATION) { $EVAL = new Evalvacija($this->anketa); $EVAL->displayStats(); } // prikaze grafe parapodatkov (js, device type, browser...) elseif ($_GET['a'] == A_PARA_GRAPH) { echo '
'; $SPG = new SurveyParaGraph($this->anketa, $skipInit = true); $SPG->DisplayParaGraph($this->anketa); echo '
'; } // prikaze reporte elseif ($_GET['a'] == 'langStatistic') { $ss = new SurveyStatistic(); $ss->Init($this->anketa); echo '
'; $ss->DisplayLangStatistic(); echo '
'; } //prikaze napredne statuse elseif ($_GET['a'] == A_STATUS_ADVANCED) { echo '
'; // Uporabni respondenti echo ''; echo '
'; echo $lang['srv_usable_respondents']; echo '
'; // Kakovost respondentov - v delu, zaenkrat samo admini if ($admin_type === '0') { echo ''; echo '
'; echo $lang['srv_kakovost']; echo '
'; } // Index hitrosti - v delu, zaenkrat samo admini if ($admin_type === '0') { echo ''; echo '
'; echo $lang['srv_speeder_index']; echo '
'; } // Analiza besedil if ($admin_type === '0' || $admin_type === '1') { echo ''; echo '
'; echo $lang['srv_text_analysis']; echo '
'; } // IP lokacija - gorenje ima to ugasnjeno, volitve imajo tudi ugasnjeno if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) { echo ''; echo '
'; echo $lang['srv_geoip_location']; echo '
'; } // Analize urejanja - v delu, zaenkrat samo admini if ($admin_type === '0') { echo ''; echo '
'; echo $lang['srv_edits_analysis']; echo '
'; } // reminder tracking - pokazi, ce je admin in so vklopljeni napredni parapodatki $survey_track_reminders = SurveySetting::getInstance()->getSurveyMiscSetting('survey_track_reminders'); if ($survey_track_reminders == '') $survey_track_reminders = 0; if (($admin_type === '0' || $admin_type === '1') && SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) { echo ''; echo '
'; echo $lang['srv_reminder_tracking']; echo '
'; } // ul evalvacija if (Common::checkModule('evalvacija') == '1') { echo ''; echo '
'; echo 'UL evalvacije'; echo '
'; } // AAPOR // aapor naj bo viden samo če so vabila if (SurveyInfo::getSurveyColumn('user_base') == 1 || SurveyInfo::getInstance()->checkSurveyModule('email')) { echo ''; echo '
'; echo $lang['srv_aapor']; echo '
'; } // langStatistic // langStatistic naj bo viden samo če imamo različne jezike in nimamo volitev if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) { $qry_string = "SELECT language FROM srv_user WHERE ank_id = '" . $this->anketa . "' AND preview = '0' AND deleted='0' group by language"; $qry = (sisplet_query($qry_string)); $cntLang = mysqli_num_rows($qry); if ($cntLang > 1) { echo ''; echo '
'; echo $lang['srv_languages_statistics']; echo '
'; } } echo '
'; } } private function displayAnketaTabUrejanje(){ $a = isset($_GET['a']) ? $_GET['a'] : ''; // Prikaze branching if ($a == 'branching' || $a == '') { $bn = new Branching($this->anketa); $bn->display_new(); return; } $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); echo '
'; // Prikaze nastavitve if ($a == 'nastavitve' || $a == 'urejanje' || $a == 'dostop' || $a == 'jezik' || $a == 'osn_pod' || $a == 'piskot' || $a == 'trajanje' || $a == 'forma' || $a == 'metadata' || $a == 'mobile_settings' || $a == 'table_settings' || $a == A_PRIKAZ || $a == A_EXPORTSETTINGS || $a == A_GDPR ) { $sas = new SurveyAdminSettings(); $sas->anketa_nastavitve_global(); } elseif ($a == 'prevajanje' || $a == 'prevajanje2') { $p = new Prevajanje($this->anketa); $p->prevajaj(); } elseif ($a == 'tema') { $st = new SurveyTheme($this->anketa); $st->displayGroup(); } elseif ($a == 'theme-editor') { $ste = new SurveyTheme($this->anketa); $ste->displayEditing(); } // nastavitve manjkajočih vrednosti za anketos elseif ($a == A_MISSING) { $smv = new SurveyMissingValues($this->anketa); $smv->displayMissingForSurvey(); } // skupine respondentov elseif ($a == A_SKUPINE) { $ss = new SurveySkupine($this->anketa); $ss->displayEdit(); } // prikaze nastavitve za obvescanje elseif ($a == 'alert') { $sas = new SurveyAdminSettings(); $sas->alert_nastavitve(); } // Prikaze urejanje teme elseif ($a == 'edit_css') { $sas = new SurveyAdminSettings(); $sas->anketa_editcss(); } // Napredni moduli elseif ($a == 'uporabnost' || ($a == 'hierarhija_superadmin' && $hierarhija_type < 5) || $a == 'kviz' || $a == 'voting' || $a == 'slideshow' || $a == 'vnos' || $a == A_TELEPHONE || $a == A_CHAT || $a == A_PANEL || $a == A_EMAIL_ACCESS || $a == A_FIELDWORK || $a == A_MAZA || $a == A_WPN || $a == 'social_network' || $a == A_360 || $a == A_360_1KA || $a == 'evoli' || $a == 'evoli_teammeter' || $a == 'evoli_quality_climate' || $a == 'evoli_teamship_meter' || $a == 'evoli_organizational_employeeship_meter' || $a == 'evoli_employmeter' || $a == 'mfdps' || $a == 'borza' || $a == 'mju' || $a == 'excell_matrix' || $a == 'advanced_paradata' || $a == 'advanced_timestamps' || $a == 'json_survey_export' ) { $sas = new SurveyAdminSettings(); $sas->showAdvancedModules(); } echo '
'; echo '
'; } private function displayAnketaTabTestiranje(){ $a = isset($_GET['a']) ? $_GET['a'] : ''; $m = isset($_GET['m']) ? $_GET['m'] : ''; if($a == 'komentarji' || $a == 'komentarji_anketa'){ $sc = new SurveyComments($this->anketa); $sc->display_komentarji(); } elseif (trim($m) == '' || $m == 'diagnostika') { $sd = new SurveyDiagnostics($this->anketa); $sd->doDiagnostics(); $sd->displayDiagnostic(); } elseif ($m == 'predvidenicas' || $m == 'cas') { $sas = new SurveyAdminSettings(); $sas->tabTestiranje(); } elseif($a == A_TESTIRANJE) { $sas = new SurveyAdminSettings(); $sas->tabTestiranje(); } } private function displayAnketaTabObjava(){ if ($_GET['a'] == A_VABILA) { echo '
'; $sas = new SurveyAdminSettings(); $sas->anketa_vabila(); echo '
'; } elseif ($_GET['a'] == A_OTHER_INV) { echo '
'; $sas = new SurveyAdminSettings(); $sas->anketa_vabila_drugo(); echo '
'; } elseif ($_GET['a'] == A_INVITATIONS) { $SI = new SurveyInvitationsNew($this->anketa); $SI->action($_GET['m']); } } private function displayAnketaTabPodatki(){ // Izvoz podatkov if ($_GET['a'] == A_COLLECT_DATA_EXPORT) { if ($_GET['m'] == 'excel_xls_mfdps') { $mfdps = new SurveyMFDPS($this->anketa); if (isset($_GET['n']) && $_GET['n'] == 'izv') $mfdps->executeExportIzvajalci(); else $mfdps->executeExportPredmeti(); } elseif ($_GET['m'] == 'excel_xls_mju') { $mju = new SurveyMJU($this->anketa); $mju->executeExport(); } else { echo '
'; Common::deletePreviewData($this->anketa); $sas = new SurveyAdminSettings(); $sas->displayIzvozi(); echo '
'; echo '
'; } } elseif ($_GET['m'] == '' || $_GET['m'] == 'view' || $_GET['m'] == 'edit' || $_GET['m'] == 'print' || $_GET['m'] == 'monitoring') { Common::deletePreviewData($this->anketa); echo '
'; $SDS = new SurveyDataDisplay($this->anketa); $SDS->displayFilters(); $SDS->displayVnosiHTML(); echo '
'; // div_analiza_data } elseif ($_GET['m'] == M_COLLECT_DATA_VARIABLE_VIEW) { $vv = VariableView::instance(); $vv->init($this->anketa); $vv->displayVariables(); } elseif ($_GET['m'] == 'calculation') { $spp = new SurveyPostProcess($this->anketa); $spp->displayTab(); } elseif ($_GET['m'] == 'coding_auto') { $spp = new SurveyPostProcess($this->anketa); $spp->displayCodingAuto(); } elseif ($_GET['m'] == 'coding') { $spp = new SurveyPostProcess($this->anketa); $spp->displayCoding(); } elseif ($_GET['m'] == M_COLLECT_DATA_RECODING) { $SR = new SurveyRecoding($this->anketa); $SR->DisplaySettings(); } elseif ($_GET['m'] == 'quick_edit') { Common::deletePreviewData($this->anketa); echo '
'; $SDS = new SurveyDataDisplay($this->anketa); $SDS->displayQuickEditFilters(); $SDS->displayQuickEdit(); echo '
'; // div_analiza_data } elseif ($_GET['m'] == 'append' || $_GET['m'] == 'merge') { $spp = new SurveyAppendMerge($this->anketa); $spp->display($_GET['m'] == 'merge' ? true : false); } elseif ($_GET['m'] == 'upload_xls') { $spp = new SurveyAppendMerge($this->anketa); $spp->upload_xls(); } elseif ($_GET['m'] == 'append_xls') { $spp = new SurveyAppendMerge($this->anketa); $spp->append_xls(); } elseif ($_GET['m'] == 'merge_xls') { $spp = new SurveyAppendMerge($this->anketa); $spp->merge_xls(); } elseif ($_GET['m'] == 'evoli') { // Posebno PDF porocilo za Evoli // Dobimo usr_id za katerega pripravljamo porocilo $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; $evoli = new SurveyEvoli($this->anketa); $evoli->executeExport($usr_id); } elseif ($_GET['m'] == 'evoli_employmeter') { // Posebno PDF porocilo za Evoli // Dobimo usr_id za katerega pripravljamo porocilo $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; $em = new SurveyEmployMeter($this->anketa); $em->executeExport($usr_id); } elseif ($_GET['m'] == 'mfdps') { // Posebno PDF porocilo za MFDPS // Dobimo usr_id za katerega pripravljamo porocilo $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; $mfdps = new SurveyMFDPS($this->anketa); $mfdps->executePDFExport($usr_id); } elseif ($_GET['m'] == 'borza') { // Posebni grafi za BORZA // Dobimo usr_id za katerega pripravljamo porocilo $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0; $borza = new SurveyBORZA($this->anketa); $borza->executeChartExport($usr_id); } } private function displayAnketaTabAnalize(){ $this->podstran = isset($_GET['m']) ? $_GET['m'] : M_ANALYSIS_STATISTICS; // Povprečje pri hierarhiji in onemogočene ostale možnosti if ($this->podstran == M_ANALYSIS_MEANS_HIERARHY || SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) { SurveyAnalysis::Init($this->anketa); $HA = new HierarhijaAnalysis($this->anketa); $HA->Display(); } // V kolikor gre za običajno analizo potem prikažemo vse opcije else { switch ($this->podstran) { case M_ANALYSIS_LINKS : // linki za vprašalnik SurveyAnalysis::Init($this->anketa); SurveyAnalysis::DisplayReportsLinks(); break; case M_ANALYSIS_CREPORT : // porocilo po meri SurveyAnalysis::Init($this->anketa); SurveyAnalysis::DisplayFilters(); echo '
'; $SCM = new SurveyCustomReport($this->anketa); $SCM->displayReport(); echo '
'; break; case M_ANALYSIS_MEANS: SurveyAnalysis::Init($this->anketa); $SM = new SurveyMeans($this->anketa); $SM->Display(); break; case M_ANALYSIS_TTEST : SurveyAnalysis::Init($this->anketa); $STT = new SurveyTTest($this->anketa); $STT->Display(); break; case M_ANALYSIS_BREAK : $SB = new SurveyBreak($this->anketa); $SB->Display(); break; case M_ANALYSIS_PARA : $SPA = new SurveyParaAnalysis($this->anketa); $SPA->Display(); break; case M_ANALYSIS_CHARTS : SurveyChart::Init($this->anketa); SurveyChart::display(); break; case M_ANALYSIS_MULTICROSSTABS : $SMC = new SurveyMultiCrosstabs($this->anketa); $SMC->display(); break; // Vizualizacija (R modul) case M_ANALYSIS_VIZUALIZACIJA : $sv = new SurveyVizualizacija($this->anketa); $sv->display(); break; // 360 stopinjske analize (adecco) case M_ANALYSIS_360 : $S360 = new Survey360($this->anketa); $S360->displayReports(); break; // 360 stopinjske analize (1ka) case M_ANALYSIS_360_1KA : $S360 = new Survey3601ka($this->anketa); $S360->displayReports(); break; // HEATMAP case M_ANALYSIS_HEATMAP : SurveyHeatMap::Init($this->anketa); SurveyHeatMap::display($this->spremenljivka); break; default: if (isset($_GET['podstran'])) { $podstran = $_GET['podstran']; } else if (isset($_POST['podstran'])) { $podstran = $_POST['podstran']; } else if (isset($_GET['m'])) { $podstran = $_GET['m']; } else { $podstran = M_ANALYSIS_SUMMARY; } SurveyAnalysis::Init($this->anketa); SurveyAnalysis::DisplayFilters(); echo '
'; SurveyAnalysis::Display(); echo '
'; // div_analiza_data break; } } } private function displayAnketaTabArhiv(){ $a = isset($_GET['a']) ? $_GET['a'] : ''; $m = isset($_GET['m']) ? $_GET['m'] : ''; $d = isset($_GET['d']) ? $_GET['d'] : ''; echo '
'; $sas = new SurveyAdminSettings(); if ($m == 'data') { $sas->arhivi_data(); } else if ($m == 'testdata') { $sas->arhivi_testdata(); } else if ($m == 'survey' || $m == 'survey_data') { $sas->arhivi_survey(); } else if ($a == 'tracking') { if($d == 'download') return TrackingClass::init()->filter([20,21,22])->csvExport(); TrackingClass::init()->filter([20,21,22])->trackingDisplay(); } else if ($a == 'tracking-hierarhija') { if($m == 'udelezenci') { if ($d == 'download') return TrackingClass::init()->filter(22, true)->csvExport(); return TrackingClass::init()->filter(22, true)->trackingDisplay(); } if ($d == 'download') return TrackingClass::init()->filter([20,21], true)->csvExport(); return TrackingClass::init()->filter([20,21], true)->trackingDisplay(); } else { $sas->arhivi(); } echo '
'; echo '
'; } private function displayAnketaTabHierarhija(){ echo '
'; $hir_nav = new \Hierarhija\Hierarhija($this->anketa); $hir_nav->displayHierarhijaNavigation(); echo '
'; echo '
'; $hierarhija = new \Hierarhija\Hierarhija($this->anketa); // m=uredi-sifrante if ($_GET['m'] == M_ADMIN_UREDI_SIFRANTE) { $hierarhija->hierarhijaSuperadminSifranti(); } elseif ($_GET['m'] == M_ADMIN_UVOZ_SIFRANTOV) { $hierarhija->hierarhijaSuperadminUvoz(); } elseif ($_GET['m'] == M_ANALIZE) { // V kolikor gre za poročila po meri if($_GET['r'] == 'custom'){ $HC = new \Hierarhija\HierarhijaPorocilaClass($this->anketa); $HC->izvoz(); } else{ $HA = new HierarhijaAnalysis($this->anketa); $HA->Display(); } } elseif ($_GET['m'] == M_ADMIN_AKTIVACIJA) { $hierarhija->aktivacijaHierarhijeInAnkete(); } elseif ($_GET['m'] == M_HIERARHIJA_STATUS) { $hierarhija->statistikaHierjearhije(); } elseif($_GET['m'] == M_UREDI_UPORABNIKE && $_GET['izvoz'] == 1) { // za vse ostalo je uredi uporabnike - M_UREDI_UPORABNIKE \Hierarhija\HierarhijaIzvoz::getInstance($this->anketa)->csvIzvozVsehUporabnikov(); } else { // za vse ostalo je ure uredi uporabnike - M_UREDI_UPORABNIKE $hierarhija->izberiDodajanjeUporabnikovNaHierarhijo(); } echo '
'; echo '
'; } function showExportLinks() { global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); if(!$userAccess->checkUserAccess('data_export')){ echo '
'; } if (!isset($_GET['m']) || trim($_GET['m']) == '') { $_GET['m'] = M_EXPORT_EXCEL_XLS; } echo ''.$lang['srv_survey_archives'].''; echo ''; if(!$userAccess->checkUserAccess('data_export')){ echo '
'; } } function showcalculationsLinks(){ global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); if(!$userAccess->checkUserAccess('data_calculation')){ echo '
'; } echo ''.$lang['srv_data_navigation_calculate'].''; echo ''; if(!$userAccess->checkUserAccess('data_calculation')){ echo '
'; } } function showImportLinks(){ global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); if(!$userAccess->checkUserAccess('data_append')){ echo '
'; } echo ''.$lang['srv_data_navigation_import'].''; echo ''; if(!$userAccess->checkUserAccess('data_append')){ echo '
'; } } function showGlobalSettingsLinks(){ global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); $get = $_GET['a']; $d = new Dostop(); //echo ''.$lang['srv_survey_settings'].''; echo ''.$lang['srv_survey_settings'].''; echo ''; } function showAdditionalSettingsLinks() { global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $userAccess = UserAccess::getInstance($global_user_id); $get = $_GET['a']; $d = new Dostop(); echo '' . $lang['set_links'] . ''; echo ''; } // Linki za napredne module private function showAdvancedModulesLinks() { global $lang; global $site_url; global $site_path; global $admin_type; global $global_user_id; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); $get = $_GET['a']; $row = SurveyInfo::getInstance()->getSurveyRow(); $d = new Dostop(); if ($d->checkDostopAktiven()) { $userAccess = UserAccess::getInstance($global_user_id); $user_package = $userAccess->getPackage(); // paket, ki ga ima uporabnik (1, 2 , 3) $dostop_styling = ""; if ($user_package != "-1" && $user_package != "" && !$userAccess->isAnketaOld()) $dostop_styling = "dostop_".$user_package."ka"; if(/*!$userAccess->checkUserAccess('kviz') &&*/ $user_package==1 && $dostop_styling != ""){ echo '
'; #zacetek napredni moduli } if($user_package != 3 && $dostop_styling != ""){ echo '
'; #zacetek lock } echo '' . $lang['srv_moduli'] . ''; if ($dostop_styling != "") { //echo ''; } echo ''; if($user_package != 3 && $dostop_styling != ""){ echo '
'; #konec lock } if($user_package==1 && $dostop_styling != ""){ echo '
'; #konec napredni moduli } } } /** * prikaze admin vmesnik izven specificne ankete (seznam anket in polje za dodajanje na prvi strani, nastavitve uporabnika, uporabnike...) * */ private function displaySeznamAnket(){ global $lang, $site_url, $global_user_id, $admin_type, $site_domain; # naložimo razred z seznamom anket $SL = ($has_folders = SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList(); $SLCount = $SL->countSurveys(); $SLCountPhone = $SL->countPhoneSurveys(); // VSEBINA POSAMEZNEGA TABA PRI MOJIH ANKETAH echo '
'; // izpis pregledovanja if ((!isset($_GET['a']) && !isset($_GET['anketa'])) || ($_GET['a'] == 'pregledovanje')) { if ($SLCount > 0) { echo '
'; $SL->getSurveys(); echo '
'; } else { $newSurvey = new NewSurvey(); if (isset($_GET['b']) && $_GET['b'] == 'new_survey'){ echo ''; } else{ echo '
'; $newSurvey->displayNoSurveySequence(); echo '
'; } } } // Izpis okna za ustvarjanje ankete (enako kot ce nimamo nobene ankete) if ($_GET['a'] == 'ustvari_anketo') { echo ''; } // izpis pregledovanja if ($_GET['a'] == 'phoneSurveys') { if ($SLCountPhone > 0) { echo '
'; $SL->getSurveys(); echo '
'; } else { echo ''; } } // izpis diagnostike if ($_GET['a'] == 'diagnostics' && !isset ($_GET['t'])) { echo '
'; $sa = new SurveyAktivnost(); $sa->diagnostics(); echo '
'; } // izpis uporabnikov if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'uporabniki') { $sas = new SurveyAdminSettings(); echo '
'; if($_GET['m'] == 'sa-modul') { $sas->SAuserListIndex(); } elseif($_GET['m'] == 'izbrisani'){ $sas->deletedUsersList(); } elseif($_GET['m'] == 'nepotrjeni'){ $sas->unconfirmedMailUsersList(); } elseif($_GET['m'] == 'odjavljeni'){ $sas->unsignedUsersList(); } elseif($_GET['m'] == 'all'){ $sas->allUsersList(); } elseif($_GET['m'] == 'add'){ $sas->dodeljeniUporabniki(); } else { $sas->assignedUsersList(); } echo '
'; } if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'time_span') { $sa = new SurveyAktivnost(); echo '
'; $sa->diagnostics_time_span(); echo '
'; } if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'time_span_daily') { $sa = new SurveyAktivnost(); echo '
'; $sa->diagnostics_time_span_daily(); echo '
'; } if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'time_span_monthly') { $sa = new SurveyAktivnost(); echo '
'; $sa->diagnostics_time_span_monthly(); echo '
'; } if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'time_span_yearly') { $sa = new SurveyAktivnost(); echo '
'; $sa->diagnostics_time_span_yearly(); echo '
'; } if ($_GET['a'] == 'diagnostics' && $_GET['t'] == 'paradata') { $sa = new SurveyAktivnost(); echo '
'; $sa->diagnostics_paradata(); echo '
'; } // izpis nastavitev if ($_GET['a'] == 'nastavitve') { echo '
'; if (($_GET['m'] == 'system' || $_GET['m'] == '')) { $sas = new SurveyAdminSettings(); $sas->anketa_nastavitve_system(); } if ($_GET['m'] == 'predvidenicasi' && $this->user_role_cehck(U_ROLE_ADMIN)) { $sas = new SurveyAdminSettings(); $sas->anketa_nastavitve_predvidenicasi(); } if ($_GET['m'] == 'global') { $sas = new SurveyAdminSettings(); $sas->anketa_nastavitve_global(); } if ($_GET['m'] == 'nice_links' && $this->user_role_cehck(U_ROLE_ADMIN)) { $sas = new SurveyAdminSettings(); $sas->anketa_nice_links(); } if ($_GET['m'] == 'anketa_admin' && $this->user_role_cehck(U_ROLE_ADMIN)) { $sas = new SurveyAdminSettings(); $sas->anketa_admin(); } if ($_GET['m'] == 'anketa_deleted' && $this->user_role_cehck(U_ROLE_ADMIN)) { $sas = new SurveyAdminSettings(); $sas->anketa_deleted(); } if ($_GET['m'] == 'data_deleted' && $this->user_role_cehck(U_ROLE_ADMIN)) { $sas = new SurveyAdminSettings(); $sas->data_deleted(); } if ($_GET['m'] == 'help_settings' && $this->user_role_cehck(U_ROLE_ADMIN)) { Help::displaySettings(); } if ($_GET['m'] == 'global_user_settings') { $sas = new SurveyAdminSettings(); $sas->globalUserSettings(); } if ($_GET['m'] == 'global_user_myProfile') { $sas = new SurveyAdminSettings(); $sas->globalUserMyProfile(); } if ($_GET['m'] == 'global_user_ChangeArchive') { $sas = new SurveyAdminSettings(); $sas->globalUserChangeArchive(); } echo '
'; } if ($_GET['a'] == 'knjiznica') { if (!isset ($_GET['t'])) { // zavihek sistemske ankete $_tab = 2; $_prva = 1; } else if ($_GET['t'] == 'moje_ankete') { // zavihek moje ankete $_tab = 3; $_prva = 1; } $f = new Library(array('tab' => $_tab, 'prva' => $_prva)); echo '
'; echo '
'; $f->display_folders(); echo '
'; echo '
'; } // izpis obvestil if ($_GET['a'] == 'obvestila') { echo '
'; $NO = new Notifications(); $NO->display(); echo '
'; } // izpis obvestil if ($_GET['a'] == 'narocila') { if($admin_type == 0 && isset($_GET['m']) && $_GET['m'] == 'placila'){ echo '
'; $UP = new UserPlacila(); $UP->displayPlacila(); echo '
'; } else{ echo '
'; $UN = new UserNarocila(); if($admin_type == 0) $UN->displayNarocilaTableAdmin(); else $UN->displayNarocila(); echo '
'; } } // nastavitve za gdpr if ($_GET['a'] == 'gdpr') { echo '
'; if (!isset($_GET['m']) || $_GET['m'] == 'gdpr_user') { $gdpr = new GDPR(); $gdpr->displayGDPRUser(); } elseif ($_GET['m'] == 'gdpr_survey_list') { $gdpr = new GDPR(); $gdpr->displayGDPRSurveyList(); } elseif ($_GET['m'] == 'gdpr_requests') { $gdpr = new GDPR(); $gdpr->displayGDPRRequests(); } elseif ($_GET['m'] == 'gdpr_requests_all') { if($admin_type == 0){ $gdpr = new GDPR(); $gdpr->displayGDPRRequestsAll(); } } elseif ($_GET['m'] == 'gdpr_dpa') { $gdpr = new GDPR(); $gdpr->displayGDPRDPA(); } echo '
'; } // nastavitve, izvozi... za UL evalvacije if ($_GET['a'] == 'ul_evalvation') { if (!isset($_GET['t']) || $_GET['t'] == 'export') { echo '
'; $EVAL = new Evalvacija(); $EVAL->displayExport(); echo '
'; } elseif ($_GET['t'] == 'import') { echo '
'; $EVAL = new Evalvacija(); $EVAL->displayImport(); echo '
'; } elseif ($_GET['t'] == 'emailing') { echo '
'; $EVAL = new Evalvacija(); $EVAL->displayEmailing(); echo '
'; } elseif ($_GET['t'] == 'test') { echo '
'; $EVAL = new Evalvacija(); $EVAL->displayTestSurveys(); echo '
'; } elseif ($_GET['t'] == 'gc') { echo '
'; $GC = new GC(); $GC->displayGC(); echo '
'; } } // kolektor modul if ($_GET['a'] == 'kolektor') { echo '
'; $kolektor = new Kolektor(); $kolektor->display(); echo '
'; } // Konec moje_ankete_edit echo '
'; } /** * vrne kodo ankete, ki se jo uporabi za embed * */ static function getEmbed($js = true) { global $site_url; $iframe = ''; $javascript = ''; if ($js) return htmlentities($iframe . $javascript, ENT_QUOTES); else return htmlentities($iframe, ENT_QUOTES); } function check_online_users(){ global $global_user_id; global $lang; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); $sqlx = sisplet_query("SELECT uid FROM srv_dostop WHERE ank_id = '$this->anketa'"); if (mysqli_num_rows($sqlx) <= 1) return; $sql = sisplet_query("SELECT DISTINCT user FROM srv_tracking".$this->db_table." WHERE ank_id='$this->anketa' AND user != '$global_user_id' AND datetime > NOW() - INTERVAL 15 MINUTE"); if (!$sql) return; if (mysqli_num_rows($sql) > 0 && $hierarhija_type < 5) { echo '
'; echo ' '; echo ' '.$lang['srv_users_viewing3'].': ' . (mysqli_num_rows($sql) + 1) . ''; /* if(is_null($hierarhija_type) || $hierarhija_type == 1){ while ($row = mysqli_fetch_array($sql)) { $sql1 = sisplet_query("SELECT name, surname, email FROM users WHERE id = '$row[user]'"); if ($row1 = mysqli_fetch_array($sql1)) { echo ' ' . $row1['email'] . ' (' . $row1['name'] . ' ' . $row1['surname'] . ')'; } } } */ echo '
'; } } function request_help(){ global $lang; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); if ($hierarhija_type == 10) { echo ''; return ''; } echo ''; echo ''; echo ' '; echo ''; echo '
'; $this->tooltip_request_help(); echo '
'; // expanded-tooltip bottom echo '
'; // request-help } // Tooltip "prosi za pomoc" public function tooltip_request_help(){ global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); echo '
'; echo '

'.$lang['srv_multilang_users'].'

'; $d = new Dostop(); $users = $d->getDostop(); if (is_countable($users[2]) && count($users[2]) > 0) { echo '
'; if ($d->checkDostopAktiven()) echo $lang['srv_users'].' ('.$lang['srv_add_edit'].'):'; else echo $lang['srv_users'].':'; echo '
'; foreach ($users[2] AS $user) { echo '
'; echo $user['email']; echo '
'; } } if (is_countable($users[1]) && count($users[1]) > 0) { echo '
'; echo $lang['managers'].':'; if ($d->checkDostopAktiven()) echo $lang['managers'].' (' . $lang['srv_add_edit'] . '):'; else echo $lang['managers'].':'; echo '
'; foreach ($users[1] AS $user) { echo '
'; echo $user['email']; echo '
'; } } echo '
'; echo $lang['srv_request_help_txt3'].' '.Help::display('help-centre'); echo '
'; echo '
'; if ($users[0] !== false) { echo ' '; echo ' '; //echo $lang['srv_request_help_txt4'] . ' ' . date('j.n.Y', strtotime($users[0])) . ' (' . $lang['hour_remove'] . ')'; } else { echo ' '; echo ' '; //echo '' . $lang['srv_dostop_admin'] . ''; } echo '
'; echo '
'; } // Tooltip "aktivnost ankete" public function tooltip_survey_activity(){ global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); echo '
'; // Aktivna if($row['active'] == 1){ echo '

'.$lang['srv_anketa_active2'].'

'; echo '
'.$lang['srv_anketa_active2_text'].'
'; } // Ni aktivna else{ echo '

'.$lang['srv_anketa_noactive2'].'

'; echo '
'.$lang['srv_anketa_noactive2_text'].'
'; } echo '
'; } // Tooltip "zaklenjena/odklenjena anketa" public function tooltip_survey_locked(){ global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); echo '
'; // Zaklenjena if($row['locked'] == 1){ echo '

'.$lang['srv_anketa_locked'].'

'; echo '
'.$lang['srv_anketa_locked_text'].'
'; } // Ni zaklenjena else{ echo '

'.$lang['srv_anketa_unlocked'].'

'; echo '
'.$lang['srv_anketa_unlocked_text'].'
'; } echo '
'; } // Tooltip "testni vnos" public function tooltip_test_data(){ global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); echo '
'; echo '

'.$lang['srv_survey_testdata'].'

'; echo '
'.$lang['srv_testdata_text'].'
'; echo '
'; } // Tooltip "predogled anekte" public function tooltip_preview_data(){ global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); $link = SurveyInfo::getSurveyLink(); echo '
'; echo '

'.$lang['srv_poglejanketo2'].'

'; echo '
'.$lang['srv_monitor_toolbox_preview'].'
'; 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 ''; } else{ echo ''; } echo '
'; echo '
'; } // Tooltip gridi pomembnih zunanjih linkov public function tooltip_link_grid(){ global $lang; $subdomain = ($lang['id'] == "1") ? 'www' : 'english'; $links = array('www' => array('https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja', 'https://www.1ka.si/d/sl/pomoc/prirocniki', 'https://www.1ka.si/d/sl/cenik/zasebni-paketi', 'https://www.1ka.si/d/sl/cenik/poslovni-paketi', 'https://www.1ka.si/d/sl/novice', 'https://www.1ka.si/d/sl/o-1ka/splosen-opis/nove-funkcionalnosti'), 'english' => array('https://www.1ka.si/d/en/help/frequently-asked-questions', 'https://www.1ka.si/d/en/help/manuals', 'https://www.1ka.si/d/en/cenik/zasebni-paketi', 'https://www.1ka.si/d/sl/cenik/poslovni-paketi', 'https://www.1ka.si/d/en/news', 'https://www.1ka.si/d/en/about/general-description/new-functionalities')); echo '
'; echo ''; echo '
'; } function displaySecondNavigationLinks($navigation = 0){ global $lang, $site_url; global $global_user_id; $row = SurveyInfo::getInstance()->getSurveyRow(); // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); if ($navigation == 0) { # stran status (reporti) ali urejanje if ($this->first_action == NAVI_UREJANJE || $_GET['a'] == '' || $_GET['a'] == A_REPORTI) { $p = new Prevajanje($this->anketa); global $lang1; $lang_more = ''; $sqll = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$this->anketa' AND uid='$global_user_id'"); $rowl = mysqli_fetch_array($sqll); $dostop = explode(',', $rowl['dostop']); if (!in_array('edit', $dostop)) { $sqll = sisplet_query("SELECT lang_id FROM srv_dostop_language WHERE ank_id='$this->anketa' AND uid='$global_user_id'"); if (mysqli_num_rows($sqll) == 1) { $rowl = mysqli_fetch_array($sqll); $p->include_lang($rowl['lang_id']); $lang_more = ' | ' . $lang['lang_short']; $p->include_base_lang(); } } if ($lang_more == '' && isset($_GET['lang_id'])) { $p->include_lang((int)$_GET['lang_id']); $lang_more = ' | ' . $lang['lang_short']; $p->include_base_lang(); } } if (($_GET['a'] == A_COLLECT_DATA || $_GET['a'] == A_USABLE_RESP || $_GET['a'] == A_KAKOVOST_RESP || $_GET['a'] == A_SPEEDER_INDEX || $_GET['a'] == A_REMINDER_TRACKING || $_GET['a'] == A_TEXT_ANALYSIS || $_GET['a'] == A_EDITS_ANALYSIS || $_GET['a'] == A_ANALYSIS) && $_GET['m'] != 'analysis_links' && $_GET['m'] != 'anal_arch') $this->displayExportHover($navigation); } else if ($navigation == 1) { # stran status (reporti) ali urejanje if ($this->first_action == NAVI_UREJANJE || $_GET['a'] == '' || $_GET['a'] == 'reporti') { // V kolikor imamo hierarhijo potem je tudi možnost kopiranja ankete in hierarhije if($_GET['a'] == A_HIERARHIJA_SUPERADMIN) echo ''; // Uvoz iz besedila if($this->second_action == NAVI_UREJANJE_BRANCHING || $_GET['a'] == ''){ if($userAccess->checkUserAccess($what='ustvari_anketo_from_text')) echo ''; else echo ''; } # kopiranje if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){ //echo ''; } else{ echo ''; } # brisanje echo ''; if ($this->second_action == NAVI_UREJANJE_BRANCHING || $_GET['a'] == 'reporti' || ($_GET['a'] == A_HIERARHIJA_SUPERADMIN && $_GET['m'] == 'analize')) $this->displayExportHover($navigation); } // Pri komentarjih imamo izvoz pdf/rtf if ($_GET['a'] == 'komentarji') { $this->displayExportHover($navigation); } } } // Ikona in hover div za izvoz function displayExportHover($navigation){ global $lang, $site_url, $global_user_id, $admin_type; // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); $current_package = $userAccess->getPackage(); $dostop_styling = ""; if ($current_package != "-1" && $current_package != "") $dostop_styling = "dostop_".$current_package."ka"; $hidden_icon = (in_array($_GET['m'], array(M_ANALYSIS_CROSSTAB, M_ANALYSIS_MULTICROSSTABS, M_ANALYSIS_MEANS, M_ANALYSIS_TTEST, M_ANALYSIS_BREAK))) ? 'hidden' : ''; echo ''; echo ''; echo ''; echo '
checkUserAccess('public_link') ? 'class= "user_access_locked"' : '').'>'; if ($navigation == 0) { $lan_archive = ' title="' . $lang['srv_analiza_arhiviraj_ttl'] . '"'; $lan_archive_send = ' title="' . $lang['srv_analiza_arhiviraj_email_ttl'] . '"'; $lan_print = ' title="' . $lang['PRN_Izpis'] . '"'; $lan_pdf = ' title="' . $lang['PDF_Izpis'] . '"'; $lan_rtf = ' title="' . $lang['RTF_Izpis'] . '"'; $lan_xls = ' title="' . $lang['XLS_Izpis'] . '"'; $lan_ppt = ' title="' . $lang['PPT_Izpis'] . '"'; if ($_GET['m'] == M_ANALYSIS_DESCRIPTOR) { if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_public'] . ''; if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_archive'] . ''; echo '' . $lang['srv_export_hover_archive_mail'] . ''; if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_print'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_FREQUENCY) { if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_public'] . ''; if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_archive'] . ''; echo '' . $lang['srv_export_hover_archive_mail'] . ''; if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_print'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_SUMMARY) { if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){ echo '
'; } echo '
' . $lang['srv_export_hover_public'] . '
'; if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){ echo '
'; } if($current_package == 2 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_archive'] . ''; echo '' . $lang['srv_export_hover_archive_mail'] . ''; if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_print'] . ''; if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){ echo '
'; } if($current_package == 2 && $dostop_styling != ""){ echo ''; } } else if ($_GET['m'] == M_ANALYSIS_CROSSTAB) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_MULTICROSSTABS) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_CHARTS) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_public'] . ''; echo '' . $lang['srv_export_hover_archive'] . ''; echo '' . $lang['srv_export_hover_archive_mail'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_print'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; echo '' . $lang['srv_export_hover_ppt'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_MEANS) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_TTEST) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_BREAK) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } //echo ''; //echo ''; echo ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['m'] == M_ANALYSIS_CREPORT) { if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_public'] . ''; echo '' . $lang['srv_export_hover_archive'] . ''; echo '' . $lang['srv_export_hover_archive_mail'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_print'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; if($userAccess->checkUserAccess('export') && $dostop_styling != ""){ echo '
'; } } else if ($_GET['a'] == A_COLLECT_DATA) { if($dostop_styling != ""){ if($current_package == 2){ echo '
'; echo '' . $lang['srv_export_hover_public'] . ''; echo '
'; echo '' . $lang['srv_export_hover_spss'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_export_hover_txt'] . ''; }elseif($current_package == 3){ echo '' . $lang['srv_export_hover_public'] . ''; echo '' . $lang['srv_export_hover_spss'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_export_hover_txt'] . ''; }else{ echo '
'; echo '' . $lang['srv_export_hover_public'] . ''; echo '' . $lang['srv_export_hover_spss'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_export_hover_txt'] . ''; echo '
'; } }else{ echo '' . $lang['srv_export_hover_public'] . ''; echo '' . $lang['srv_export_hover_spss'] . ''; echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_export_hover_txt'] . ''; } // poseben excel izvoz za mfdps if(SurveyInfo::getInstance()->checkSurveyModule('mfdps')){ echo 'MFDPŠ - predmeti'; echo 'MFDPŠ - izvajalci'; } // poseben excel izvoz za mju if(SurveyInfo::getInstance()->checkSurveyModule('mju')){ echo 'MJU seminarji'; } } else if ($_GET['a'] == A_USABLE_RESP) { echo '' . $lang['srv_export_hover_xls'] . ''; } else if ($_GET['a'] == A_SPEEDER_INDEX) { echo '' . $lang['srv_export_hover_xls'] . ''; } else if ($_GET['a'] == A_TEXT_ANALYSIS) { echo '' . $lang['srv_export_hover_xls'] . ''; echo '' . $lang['srv_lnk_excel'] . ' (' . $lang['srv_table'] . ' 1)'; echo '' . $lang['srv_lnk_excel'] . ' (' . $lang['srv_table'] . ' 2)'; } else if ($_GET['a'] == A_EDITS_ANALYSIS) { echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_print'] . ''; } else if ($_GET['a'] == A_REMINDER_TRACKING) { echo '' . $lang['srv_export_hover_xls'] . ''; } } else { if ($this->first_action == NAVI_UREJANJE || $_GET['a'] == '' || $_GET['a'] == 'reporti') { if ($_GET['a'] == '' || $_GET['a'] == 'branching') { if($userAccess->checkUserAccess('export')){ echo '
'; } echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; //za enkrat samo za admine if($admin_type == 0){ echo '' . $lang['srv_export_hover_xml'] . ''; } if($userAccess->checkUserAccess('export')){ echo '
'; } } if ($_GET['a'] == 'reporti') { echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_print'] . ''; } if ($_GET['a'] == A_HIERARHIJA_SUPERADMIN) { echo ''; echo ''; echo ''; } } elseif ($_GET['a'] == 'komentarji') { $commentType = (isset($_GET['only_unresolved'])) ? $_GET['only_unresolved'] : 1; $commentType = ($commentType == 'undefined') ? 0 : $commentType; echo '' . $lang['srv_export_hover_pdf'] . ''; echo '' . $lang['srv_export_hover_rtf'] . ''; } } echo ''; // Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){ echo ''; } } /** * @desc uploada skin */ function upload_skin() { global $site_path; global $lang; global $global_user_id; if (isset ($_FILES['fajl']['name'])) { $mini = $_FILES['fajl']['name']; // skin if ((strtolower(substr($mini, -4, 4)) == '.css' || (strtolower(substr($mini, -4, 4)) == '.zip')) && strpos(strtolower($mini), ".exe") === false && strpos(strtolower($mini), ".bat") === false && strpos(strtolower($mini), ".com") === false && strpos(strtolower($mini), ".vbs") === false && strpos(strtolower($mini), ".pl") === false && strpos(strtolower($mini), ".php") === false ) { $sql = sisplet_query("SELECT usr_id, skin FROM srv_theme_profiles WHERE id = '" . $_GET['profile'] . "'"); $row = mysqli_fetch_array($sql); $user_id = $row['usr_id']; // ce ima svojo temo, jo zbrisemo if (strpos($row['skin'], $user_id . '_') !== false) { $dir = $site_path . 'main/survey/skins/'; unlink($dir . $row['skin'] . '.css'); } // Odzipaj ga if (strtolower(substr($mini, -4, 4)) == '.zip') { if (!is_file($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4))) mkdir($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4)); $file = $site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/' . $user_id . '_' . $_FILES['fajl']['name']; move_uploaded_file($_FILES['fajl']['tmp_name'], $file); exec('unzip -d ' . $site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . ' ' . $file); copy($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/' . substr($_FILES['fajl']['name'], 0, -4) . ".css", $site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . ".css"); // malo kvazi varnosti unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.php'); unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.exe'); unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.pl'); unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.bat'); unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.vbs'); unlink($site_path . 'main/survey/skins/' . $user_id . '_' . substr($_FILES['fajl']['name'], 0, -4) . '/*.py'); } else { $file = $site_path . 'main/survey/skins/' . $user_id . '_' . $_FILES['fajl']['name']; move_uploaded_file($_FILES['fajl']['tmp_name'], $file); } $s = sisplet_query("UPDATE srv_theme_profiles SET skin='" . str_replace('.css', '', $user_id . '_' . $mini) . "' WHERE id = '" . $_GET['profile'] . "'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); header('Location: index.php?anketa=' . $this->anketa . '&a=theme-editor&t=css&profile=' . $_GET['profile']); // slika } elseif ((strtolower(substr($mini, -4, 4)) == '.jpg' || (strtolower(substr($mini, -4, 4)) == '.jpeg') || (strtolower(substr($mini, -4, 4)) == '.gif') || (strtolower(substr($mini, -4, 4)) == '.png')) && strpos(strtolower($mini), ".exe") === false && strpos(strtolower($mini), ".bat") === false && strpos(strtolower($mini), ".com") === false && strpos(strtolower($mini), ".vbs") === false && strpos(strtolower($mini), ".pl") === false && strpos(strtolower($mini), ".php") === false ) { if ($_GET['logo'] == 1) { $replace = array(' ', '+'); $logo = 'logo_' . $this->anketa . '_' . str_replace($replace, '_', $_FILES['fajl']['name']) . ''; $file = $site_path . 'main/survey/uploads/' . $logo; $fileExt = pathinfo($_FILES['fajl']['name'], PATHINFO_EXTENSION); [$width, $height] = getimagesize($_FILES['fajl']['tmp_name']); // If logo too large resize uploaded logo to max 150px height if($height > 150){ $new_h = 150; $resize_percent = $new_h / $height; $new_w = $width * $resize_percent; switch($fileExt){ case 'jpg': case 'jpeg': $resourceType = imagecreatefromjpeg($_FILES['fajl']['tmp_name']); $imageLayer = imagecreatetruecolor($new_w, $new_h); imagecopyresampled($imageLayer, $resourceType, 0,0,0,0, $new_w, $new_h, $width, $height); imagejpeg($imageLayer, $_FILES['fajl']['tmp_name']); break; case 'png': $resourceType = imagecreatefrompng($_FILES['fajl']['tmp_name']); $imageLayer = imagecreatetruecolor($new_w, $new_h); imagecopyresampled($imageLayer, $resourceType, 0,0,0,0, $new_w, $new_h, $width, $height); imagepng($imageLayer, $_FILES['fajl']['tmp_name']); break; case 'gif': $resourceType = imagecreatefromgif($_FILES['fajl']['tmp_name']); $imageLayer = imagecreatetruecolor($new_w, $new_h); imagecopyresampled($imageLayer, $resourceType, 0,0,0,0, $new_w, $new_h, $width, $height); imagegif($imageLayer, $_FILES['fajl']['tmp_name']); break; } } move_uploaded_file($_FILES['fajl']['tmp_name'], $file); sisplet_query("UPDATE srv_theme_profiles SET logo = '$logo' WHERE id = '" . $_GET['profile'] . "'"); header('Location: index.php?anketa=' . $this->anketa . '&a=theme-editor&profile=' . $_GET['profile']); } else { $file = $site_path . 'main/survey/uploads/' . $this->uid() . '_' . $_FILES['fajl']['name']; move_uploaded_file($_FILES['fajl']['tmp_name'], $file); header('Location: index.php?anketa=' . $this->anketa . '&a=theme-editor&t=css&profile=' . $_GET['profile']); } } else { echo ' '; } } } /** * ankete najprej ne zbrisemo zares, ampak samo oznacimo, da je bila izbrisana * * uporablja se tudi v API * * @param mixed $anketa */ function anketa_delete($anketa) { global $site_path, $global_user_id; if (!$anketa) return; // zbrisemo zakesiran query v seji if (session_id() == '') { session_start(); } unset($_SESSION['query']); unset($_SESSION['result']); // pošiljanje obvestil ob izbrisu ankete SurveyAlert::getInstance()->Init($anketa, $global_user_id); SurveyAlert::getInstance()->sendMailDelete(); $s = sisplet_query("UPDATE srv_anketa SET active='-1', edit_time=NOW() WHERE id = '$anketa'"); Common::RemoveNiceUrl($anketa); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } /** brisanje anket * * @param $anketa * @return unknown_type * */ public static function anketa_delete_from_db($anketa){ if (!$anketa || $anketa < 1) return; // zbrisemo zakesiran query v seji if (session_id() == '') { session_start(); } unset($_SESSION['query']); unset($_SESSION['result']); $sql = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id = '$anketa'"); while ($row = mysqli_fetch_array($sql)) { $sql1 = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id='$row[id]'"); while ($row1 = mysqli_fetch_array($sql1)) { $sql2 = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id = '$row1[id]'"); } $sql2 = sisplet_query("DELETE FROM srv_spremenljivka WHERE gru_id = '$row[id]'"); # tabela srv_user_grupa_archive1 $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive1 WHERE gru_id = '$row[id]'"); # tabela srv_user_grupa_archive2 $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive2 WHERE gru_id = '$row[id]'"); # tabela srv_user_grupa_archive3 $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive3 WHERE gru_id = '$row[id]'"); # tabela srv_user_grupa_active $sql2 = sisplet_query("DELETE FROM srv_user_grupa_active WHERE gru_id = '$row[id]'"); } $sql2 = sisplet_query("DELETE FROM srv_grupa WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_alert WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_dostop WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_user WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_anketa WHERE backup = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_anketa WHERE id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_tracking_active WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_tracking_archive1 WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_tracking_archive2 WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_tracking_archive3 WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_library_anketa WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_survey_misc WHERE sid = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_variable_profiles WHERE sid = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_glasovanje WHERE ank_id = '$anketa'"); $sql2 = sisplet_query("DELETE FROM srv_survey_misc WHERE sid = '$anketa'"); # Pobrisemo srv_condition_vre $sql2 = sisplet_query("DELETE FROM srv_condition_vre WHERE cond_id IN (SELECT id FROM srv_condition WHERE if_id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0))"); #Pobrisemo srv_condition_grid $sql2 = sisplet_query("DELETE FROM srv_condition_grid WHERE cond_id IN (SELECT id FROM srv_condition WHERE if_id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0));"); #Pobrisemo srv_calculation $sql2 = sisplet_query("DELETE FROM srv_calculation WHERE cnd_id IN (SELECT id FROM srv_condition WHERE if_id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0));"); #pobrisemo srv_condition $sql2 = sisplet_query("DELETE FROM srv_condition WHERE if_id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0);"); #pobrisemo srv_if $sql2 = sisplet_query("DELETE FROM srv_if WHERE id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0);"); # sedaj lahko pobrisemo tudi branching $sql2 = sisplet_query("DELETE FROM srv_branching WHERE ank_id = '$anketa'"); Common::RemoveNiceUrl($anketa); } /** * @desc popravimo cas in userja popravka * ta funkcija je skopirana v common. tole pustimo, da ne bojo kaksne napake... */ function updateEditStamp() { Common::updateEditStamp(); } /** * @desc ustvari novo anketo */ function nova_anketa($naslov = null, $intro_opomba = '', $akronim = null, $survey_type = 2, $skin = '1kaBlue') { global $lang; global $site_url; global $global_user_id; // zbrisemo zakesiran query v seji if (session_id() == '') { session_start(); } unset($_SESSION['query']); unset($_SESSION['result']); $sql = sisplet_query("SELECT lang FROM users WHERE id = '$global_user_id'"); $row = mysqli_fetch_array($sql); $lang_admin = $row['lang']; $res = sisplet_query("SELECT value FROM misc WHERE what='SurveyCookie'"); [$SurveyCookie] = mysqli_fetch_row($res); $text = ''; $url = $site_url; #če naslov ni podan ali če je uporabnik pusti nespremenjen input box za ime ankete (==> Ime ankete) zgeneriramo novo ime if ($naslov == null || $naslov == $lang['srv_novaanketa_polnoime']) { $naslov = 'Test ' . rand(100, 999); } if ($akronim == null || $akronim == $lang['srv_novaanketa_ime_respondenti']) { $akronim = $naslov; } $naslov = strip_tags($naslov); $akronim = strip_tags($akronim); $starts = isset($_POST['starts']) ? "'" . $_POST['starts'] . "'" : "NOW()"; $expire = isset($_POST['expire']) ? "'" . $_POST['expire'] . "'" : "NOW() + INTERVAL 3 MONTH "; // Nastavimo jezik - admin in response jezik je vedno enak nastavitvi, ki jo ima uporabnik a default $lang_admin = ((int)$lang_admin > 0) ? $lang_admin : 1; $lang_resp = $lang_admin; # ali ima uporabnik nastavljeno da je anketa privzeto aktivna: $autoActiveSurvey = (int)UserSetting::getInstance()->getUserSetting('autoActiveSurvey'); # ali ima uporabnik nastavljeno da so komentarji privzeto aktivirani $activeComments = (int)UserSetting::getInstance()->getUserSetting('activeComments'); # ali ima uporabnik nastavljeno da je uvod privzeto skrit $showIntro = (int)UserSetting::getInstance()->getUserSetting('showIntro'); # ali ima uporabnik nastavljeno da je zakljucek privzeto skrit $showConcl = (int)UserSetting::getInstance()->getUserSetting('showConcl'); # ali ima uporabnik nastavljeno da je naslov ankete privzeto skrit $showSurveyTitle = (int)UserSetting::getInstance()->getUserSetting('showSurveyTitle'); // Nastavimo se mobilni skin glede na osnovnega $mobile_skin = 'MobileBlue'; if(in_array($skin, array('1kaBlue', '1kaRed', '1kaOrange', '1kaGreen', '1kaPurple', '1kaBlack'))){ $mobile_skin = str_replace('1ka', 'Mobile', $skin); } elseif(in_array($skin, array('Uni', 'Fdv', 'Cdi'))){ $mobile_skin = 'Mobile'.$skin; } // Nastavimo se hash $hash = Common::generateSurveyHash(); $sql = sisplet_query("INSERT INTO srv_anketa (id, hash, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, show_intro, show_concl, survey_type, lang_admin, lang_resp, active, skin, mobile_skin) " . "VALUES ('', '".$hash."', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '$text', '$url', '$intro_opomba', '$showIntro', '$showConcl', '$survey_type', '$lang_admin', '$lang_resp', '$autoActiveSurvey', '$skin', '$mobile_skin')"); if (!$sql) { $error = mysqli_error($GLOBALS['connect_db']); } $anketa = mysqli_insert_id($GLOBALS['connect_db']); // Dodan pogoj ce pride do problema pri ustvarjanju (ker ank_id==0 zacikla zadevo) if($anketa != 0){ // Updatamo srv_activity, ce je anketa aktivna - drugace se ne zabelezi ok ko se deaktivira if ($autoActiveSurvey == 1) { $sql_insert = sisplet_query("INSERT INTO srv_activity (sid, starts, expire) VALUES ('".$anketa."', $starts, $expire)"); } // vnesemo tudi 1. grupo aka page $sql = sisplet_query("INSERT INTO srv_grupa (ank_id, naslov, vrstni_red) VALUES ('$anketa', '$lang[srv_stran] 1', '1')"); $grupa = mysqli_insert_id($GLOBALS['connect_db']); //ce se nimamo vprasanja v glasovanju ga ustvarimo if ($survey_type == 0) { $b = new Branching($anketa); $spr_id = $b->nova_spremenljivka($grupa, 1, 1); //napolnimo bazo srv_glasovanje $sqlG = sisplet_query("INSERT INTO srv_glasovanje (ank_id, spr_id) VALUES ('$anketa', '$spr_id')"); //napolnimo vrednosti Vprasanje::change_tip($spr_id, 1); //napolnimo vrednosti vprasanja $values = ""; for ($i = 1; $i <= $row['size']; $i++) { if ($values != "") $values .= ","; $values .= " ('$spremenljivka', '$i', '$i') "; } $sql1 = sisplet_query("INSERT INTO srv_vrednost (spr_id, variable, vrstni_red) VALUES $values"); //popravljanje default nastavitev - stat=0, show_intro=0 $sqlSpr = sisplet_query("UPDATE srv_spremenljivka SET stat = '0', skala='0' WHERE id = '$spr_id'"); $sqlAnk = sisplet_query("UPDATE srv_anketa SET show_intro = '0', show_concl = '0', progressbar = '0', countType = '0' WHERE id = '$anketa'"); // vsilimo refresh podatkov SurveyInfo::getInstance()->resetSurveyData(); } //popravljanje default nastavitev pri formi - show_intro=0, show_concl=0, trajanje->neomejeno if ($survey_type == 1) { $sqlAnk = sisplet_query("UPDATE srv_anketa SET show_intro = '0', show_concl = '0', expire = '" . PERMANENT_DATE . "' WHERE id = '$anketa'"); } // Popravimo default prikazovanje naslova ankete za respondente if ($showSurveyTitle == 0) { SurveySetting::getInstance()->Init($anketa); SurveySetting::getInstance()->setSurveyMiscSetting('survey_hide_title', 1); } // Updatamo nastavitev za komentarje (ce so po defaultu vklopljeni) if ($activeComments == 1) { SurveySetting::getInstance()->Init($anketa); SurveySetting::getInstance()->setSurveyMiscSetting('survey_comment', 3); SurveySetting::getInstance()->setSurveyMiscSetting('survey_comment_viewadminonly', 3); SurveySetting::getInstance()->setSurveyMiscSetting('question_note_view', 3); SurveySetting::getInstance()->setSurveyMiscSetting('question_note_write', 0); SurveySetting::getInstance()->setSurveyMiscSetting('question_comment', 3); SurveySetting::getInstance()->setSurveyMiscSetting('question_comment_viewadminonly', 3); SurveySetting::getInstance()->setSurveyMiscSetting('question_resp_comment', 1); SurveySetting::getInstance()->setSurveyMiscSetting('question_resp_comment_viewadminonly', 3); SurveySetting::getInstance()->setSurveyMiscSetting('survey_comment_resp', 4); SurveySetting::getInstance()->setSurveyMiscSetting('survey_comment_viewadminonly_resp', 4); } // dodamo se uporabnika v dostop $uid = $this->uid(); $sql = sisplet_query("INSERT INTO srv_dostop (ank_id, uid) VALUES ('$anketa', '$uid')"); // Nastavimo obvescanje pri aktivaciji (default ob kreiranju ankete) SurveyAlert::getInstance()->Init($anketa, $global_user_id); SurveyAlert::setDefaultAlertActivation(); // Nastavimo obvescanje pri poteku ankete (default ob kreiranju ankete) SurveyAlert::setDefaultAlertBeforeExpire(); return $anketa; } else{ echo 'Napaka pri ustvarjanju ankete!'; die(); } } /** * @desc vpise novo spremenljivko v bazo (lahko je skopirana) */ function nova_spremenljivka($grupa, $grupa_vrstni_red, $vrstni_red, $kuki = 0){ // ce se slucajno se kje klice $b = new Branching($this->anketa); return $b->nova_spremenljivka($grupa, $grupa_vrstni_red, $vrstni_red, $kuki); } /** * preveri, ce v branchingu lahko zbrisemo spremenljivko (da ni v kaksnem pogoju) * * @param mixed $spremenljivka */ function check_spremenljivka_delete($spremenljivka) { $sql = sisplet_query("SELECT * FROM srv_condition WHERE spr_id='$spremenljivka'"); if (mysqli_num_rows($sql) > 0) return false; return true; } /** * zbrise spremenljivko * * @param mixed $spremenljivka */ function brisi_spremenljivko($spremenljivka) { if ($spremenljivka > 0) { $rowg = Cache::srv_spremenljivka($spremenljivka); // Preden vprasanje zbrisemo po novem ustvarimo kopijo vprasanja med zbrisanimi (knjiznica zbrisanih vprasanj) $vd = new VprasanjeDeleted($this->anketa); $vd->createDeletedVprasanje($spremenljivka); // pri brisanju multiple grid vprasanja, moramo pobrisate tudi vse child spremenljivke (ker kljuci niso nastavljeni) if ($rowg['tip'] == 24) { $sqld = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka'"); while ($rowd = mysqli_fetch_array($sqld)) { sisplet_query("DELETE FROM srv_spremenljivka WHERE id='$rowd[spr_id]'"); } } // Poiscemo ce imamo kaksen pogoj na posamezni vrednosti in ga pobrisemo (drugace ostane vezava na pogoj) $sqlC = sisplet_query("SELECT if_id FROM srv_vrednost WHERE spr_id='$spremenljivka' AND if_id>'0'"); while ($rowC = mysqli_fetch_array($sqlC)) { $if = $rowC['if_id']; $sqlCV = sisplet_query("SELECT id FROM srv_condition WHERE if_id = '$if'"); while ($rowCV = mysqli_fetch_array($sqlCV)) sisplet_query("DELETE FROM srv_condition_vre WHERE cond_id='$rowCV[id]'"); sisplet_query("DELETE FROM srv_condition WHERE if_id = '$if'"); sisplet_query("DELETE FROM srv_if WHERE id = '$if'"); } $sql = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$spremenljivka'"); $sql = sisplet_query("DELETE FROM srv_grid WHERE spr_id='$spremenljivka'"); $sql = sisplet_query("DELETE FROM srv_spremenljivka WHERE id='$spremenljivka'"); // Prej je bilo tako in je bila težava pri brisanju iz api-ja, ker gru_id ni bil definiran $grupa = $rowg['gru_id']; $this->repareSpremenljivka($grupa); $sql = sisplet_query("SELECT parent FROM srv_branching WHERE element_spr = '$spremenljivka'"); $row = mysqli_fetch_array($sql); sisplet_query("DELETE FROM srv_branching WHERE element_spr = '$spremenljivka'"); $b = new Branching($this->anketa); if(isset($row['parent'])) $b->repare_branching($row['parent']); $b->repare_vrstni_red(); $b->trim_grupe(); } } /** * @desc preveri, ce ze obstaja variabla s takim imenom - ob rocnem spremninjanju imena */ function check_spremenljivka_variable($spremenljivka, $variable) { global $lang; if ($this->anketa > 0) { $sql_check = sisplet_query("SELECT id FROM srv_spremenljivka s, srv_grupa g WHERE s.id!='$spremenljivka' AND s.variable='$variable' AND g.ank_id='$this->anketa' AND g.id=s.gru_id"); if (!$sql_check) echo mysqli_error($GLOBALS['connect_db']); if (mysqli_num_rows($sql_check) > 0) { echo $lang['srv_variable_error']; } } } /** * @desc prikaze nas clipboard */ function clipboard_display($spremenljivka = 0, $if = 0) { global $lang; return; // tega ne rabimo vec $cut = $_POST['cut']; if ($cut == 1) setcookie('srv_cut_' . $this->anketa, '1'); else setcookie('srv_cut_' . $this->anketa, '', time() - 3600); if ($spremenljivka > 0) setcookie('srv_clipboard_' . $this->anketa, $spremenljivka); elseif ($if > 0) setcookie('srv_clipboard_' . $this->anketa, 'if_' . $if); elseif ($_COOKIE['srv_clipboard_' . $this->anketa] > 0 && $spremenljivka != -1) $spremenljivka = $_COOKIE['srv_clipboard_' . $this->anketa]; elseif (substr($_COOKIE['srv_clipboard_' . $this->anketa], 3) > 0 && $spremenljivka != -1) $if = substr($_COOKIE['srv_clipboard_' . $this->anketa], 3); // prikazemo spremenljivko if ($spremenljivka > 0) { $row = Cache::srv_spremenljivka($spremenljivka); echo '

' . $lang['srv_copied_spr'] . ':

'; echo '

' . strip_tags($row['naslov']) . ' (' . $row['variable'] . ')

'; } // prikazemo if if ($if > 0) { $sql = sisplet_query("SELECT tip, label FROM srv_if WHERE id = '$if'"); $row = mysqli_fetch_array($sql); $b = new Branching($this->anketa); if ($row['tip'] == 0) { echo '

' . $lang['srv_copied_if'] . ':

'; echo '

' . $b->conditions_display($if) . '

'; } else { echo '

' . $lang['srv_copied_block'] . ':

'; echo '

' . $row['label'] . '

'; } } if ($spremenljivka > 0 || $if > 0) { echo '

' . $lang['srv_copy_remove'] . '

'; echo ''; } // zbrisemo iz clipboarda (kukija) if ($spremenljivka == -1) { setcookie('srv_clipboard_' . $this->anketa, '', time() - 3600); setcookie('srv_cut_' . $this->anketa, '', time() - 3600); echo ''; } } /** * @desc prestevilci variable vseh vprasanj v anketi */ function prestevilci($spremenljivka = 0, $all = false) { Common::getInstance()->Init($this->anketa); Common::getInstance()->prestevilci($spremenljivka, $all); } /** * @desc prestevilci ife */ function prestevilci_if($parent = 0, & $number = 1) { Common::getInstance()->Init($this->anketa); Common::getInstance()->prestevilci_if($parent, $number); } /** * @desc popravi celotno anketo */ function repareAnketa($anketa = 0) { if ($anketa == 0) $anketa = $this->anketa; Common::repareAnketa($anketa); } /** * @desc popravi vrstni red v tabeli srv_grupa */ function repareGrupa($anketa) { Common::repareGrupa($anketa); } /** * @desc popravi vrstni red v tabeli srv_spremenljivka */ function repareSpremenljivka($grupa) { Common::repareSpremenljivka($grupa); } /** * @desc popravi vrstni red v tabeli srv_vrednost */ function repareVrednost($spremenljivka) { Common::repareVrednost($spremenljivka); } /** * @desc preveri pravice trenutnega userja za urejanje ankete */ function checkDostop($anketa = 0) { $d = new Dostop(); return $d->checkDostop($anketa); } /** * preveri nivo dostopa za uporabnika (ce je aktiven ali pasiven) */ function checkDostopAktiven($anketa = 0) { $d = new Dostop(); return $d->checkDostopAktiven($anketa); } /** * @desc Vrne ID trenutnega uporabnika (ce ni prijavljen vrne 0) */ function uid() { global $global_user_id; return $global_user_id; } /** * @desc Vrne vse uporabnike iz baze */ static function db_select_users() { return sisplet_query("SELECT name, surname, id, email FROM users ORDER BY name ASC"); } /** * @desc Vrne podatke o uporabniku */ static function db_select_user($uid) { return sisplet_query("SELECT * FROM users WHERE id='$uid'"); } /** * TODO ??? * * @param mixed $spremenljivka */ function addMissingGrids($spremenljivka) { $row = Cache::srv_spremenljivka($spremenljivka); $maxGrids = $row['grids']; // najprej pobrišemo polja 99,98,97 (na koncu jih spet dodamo) $deleteString = "DELETE FROM srv_grid WHERE spr_id='" . $spremenljivka . "' AND (id IN (99,98,97))"; $sqlD = sisplet_query($deleteString); $sqlGrids = sisplet_query("SELECT id, vrstni_red FROM srv_grid WHERE spr_id='$spremenljivka' ORDER BY id"); $countGrids = mysqli_num_rows($sqlGrids); // če imamo v gridu več spremenljivk kot jih rabimo jih pobrišemo if ($countGrids > $maxGrids) { $deleteString = "DELETE FROM srv_grid WHERE spr_id='" . $spremenljivka . "' AND id > $maxGrids"; $deleteQuery = sisplet_query($deleteString); } // dodamo manjkajoče spremenljivke if ($countGrids < $maxGrids) { for ($i = $countGrids + 1; $i <= $maxGrids; $i++) { $rowG = mysqli_fetch_array($sqlGrids); if ($rowG['vrstni_red'] != $i) { //nastavimo id na najvecji v vprasanju $sqlID = sisplet_query("SELECT MAX(id) FROM srv_grid WHERE spr_id='$spremenljivka' "); $rowID = mysqli_fetch_array($sqlID); $newId = $rowID['MAX(id)'] + 1; $insertString = "INSERT INTO srv_grid (id, spr_id, vrstni_red, variable) VALUES ('$newId', '$spremenljivka', '$i', '$i')"; $sqlInsert = sisplet_query($insertString); } } } $this->repareVrednost($spremenljivka); // nato samo še dodamo sistemske če je potrebno $_otherStatus = array(99 => "-99", 98 => "-98", 97 => "-97"); $_otherStatusFields = array( 99 => 'undecided', 98 => 'rejected', 97 => 'inappropriate' ); $_otherStatusDefaults = array( 99 => 'Ne vem', 98 => 'Zavrnil', 97 => 'Neustrezno' ); $_updateState = ""; foreach ($_otherStatus as $status => $statusVariable) { // dodamo samo če je čekirano polje v spremenljivki if ($row[$_otherStatusFields[$status]] == 1) { $sqlUD = sisplet_query("SELECT id FROM srv_grid WHERE spr_id='$spremenljivka' AND vrstni_red='" . $status . "'"); $rowUD = mysqli_fetch_array($sqlUD); if ($rowUD == FALSE) { $sqlUD2 = sisplet_query("SELECT MAX(vrstni_red) FROM srv_grid WHERE spr_id='$spremenljivka' "); $rowUD2 = mysqli_fetch_array($sqlUD2); //nastavimo id na najvecji v vprasanju $id = $rowUD2['MAX(vrstni_red)'] + 1; //vnesemo polje (ne vem, zavrnil, neustrezno) v bazo (default vrednosti: NE VEM, vrstni_red 99, variable 99 $sqlUD3String = "INSERT INTO srv_grid (id, spr_id, naslov, vrstni_red, variable) " . "VALUES ('$status', '$spremenljivka', '" . $_otherStatusDefaults[$status] . "', '" . $status . "', '" . $statusVariable . "')"; $sqlUD3 = sisplet_query($sqlUD3String); } } } } /** * TODO ??? * * @param mixed $spremenljivka */ function getSpremenljivkaZaporedna($spremenljivka) { $rowSpr = Cache::srv_spremenljivka($spremenljivka); // Preštejemo koliko vprašanj je bilo do sedaj na prejšnih straneh $sqlg = sisplet_query("SELECT vrstni_red FROM srv_grupa WHERE id='" . $rowSpr['gru_id'] . "'"); $rowg = mysqli_fetch_assoc($sqlg); $vrstni_red = $rowg['vrstni_red']; $sqlCountPast = sisplet_query("SELECT count(*) as cnt FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='$this->anketa' AND s.gru_id=g.id AND g.vrstni_red < '$vrstni_red' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC"); $rowCount = mysqli_fetch_assoc($sqlCountPast); $offset = $rowCount['cnt']; // preštejemo katera premenljivka je trenutna $stringCountPast = "SELECT count(*) as cnt FROM srv_spremenljivka WHERE gru_id = '" . $rowSpr['gru_id'] . "' AND vrstni_red <= '" . $rowSpr['vrstni_red'] . "' ORDER BY vrstni_red ASC"; $sqlCountPast = sisplet_query($stringCountPast); $rowCountPast = mysqli_fetch_assoc($sqlCountPast); return $offset + $rowCountPast['cnt']; } /** * porihtana funkcija, da poklice SurveyRespondents::checkSystemVariables(), ki je zadolzena za dodajanje sistemskih spremenljivk * * @param mixed $phone * @param mixed $email */ function createUserbaseSystemVariable($phone, $email, $language = 0) { $user_base = 0; $cookie = -1; $rowb = SurveyInfo::getInstance()->getSurveyRow(); $phone = (int)(SurveyInfo::getInstance()->checkSurveyModule('phone') || (int)$phone == 1); $email = (int)(SurveyInfo::getInstance()->checkSurveyModule('email') || (int)$email == 1); $variables = array(); if ($phone == 1) { array_push($variables, "telefon"); $user_base = 1; } if ($email == 1) { array_push($variables, "email"); $user_base = 1; } if ($language == 1) { array_push($variables, "language"); } SurveyRespondents:: getInstance()->Init($this->anketa); SurveyRespondents:: checkSystemVariables($variables); if ($rowb['user_base'] != $user_base || (int)SurveyInfo::getInstance()->checkSurveyModule('phone') != $phone || (int)SurveyInfo::getInstance()->checkSurveyModule('email') != $email) {// nastavimo še userbase // v userbase vedno prikazujemo uvod if ($user_base == 1) $intro = " '1' "; else $intro = " show_intro "; $sql = sisplet_query("UPDATE srv_anketa SET user_base='$user_base', phone='$phone', email='$email', show_intro=$intro WHERE id='" . $this->anketa . "'"); // vsilimo refresh podatkov SurveyInfo:: getInstance()->resetSurveyData(); } return SurveyInfo::getInstance()->getSurveyRow(); } /** * TODO *** * * @param mixed $curent_id * @param mixed $errorMsg */ function show_email_invitation_templates($curent_id = 1, $errorMsg = null) { global $lang; echo '
'; echo 'Predloge:'; echo '
'; echo '
'; $sql_email_invitations_profiles = sisplet_query("SELECT id, name FROM srv_userbase_invitations"); while ($row_email_invitations_profiles = mysqli_fetch_assoc($sql_email_invitations_profiles)) { echo '
' . $row_email_invitations_profiles['name'] . '
'; } echo '
'; echo '
'; echo '
'; $this->show_email_invitation_values($curent_id, $errorMsg); echo '
'; echo '
'; echo '
'; echo ''; } /** * TODO ???? * * @param mixed $curent_id * @param mixed $errorMsg */ function show_email_invitation_values($curent_id = 1, $errorMsg = null) { global $lang; $sql_email_invitations_profiles = sisplet_query("SELECT name, subject, text FROM srv_userbase_invitations WHERE id = '" . $curent_id . "'"); $row_email_invitations_profiles = mysqli_fetch_assoc($sql_email_invitations_profiles); $temp_name = $row_email_invitations_profiles['name']; $temp_subject = $row_email_invitations_profiles['subject']; $temp_text = $row_email_invitations_profiles['text']; if ($errorMsg != null) { echo '
' . $errorMsg . '
'; } echo '
'; echo '

Ime:'; echo '

'; echo '

Zadeva:'; echo '

'; echo '

' . $lang['text'] . ':'; echo '

' . $temp_text . '

'; echo '
'; echo '
'; echo '
uporabi predlogo
'; if ($curent_id > 1) { $confirmDelete = "Ali ste prepričani da želite izbristai predlogo: " . $temp_name . "?"; echo '
uredi predlogo
'; echo '
izbriši predlogo
'; } echo '
'; } /** * TODO ??? * * @param mixed $curent_id * @param mixed $errorMsg */ function show_userbase_respondents_lists($curent_id = null, $errorMsg = null) { echo '
Liste respondentov' . ''; $sql_lists = sisplet_query("SELECT id FROM srv_userbase_respondents_lists"); $numRows = mysqli_num_rows($sql_lists); // print_r(SurveyRespondents :: getInstance() ->getSurveyId()); // print_r(SurveyRespondents :: getInstance() ->getGlobalUserId()); // print_r(SurveyRespondents :: getInstance() ->getCurentProfileId()); // print_r(SurveyRespondents :: getInstance() ->getProfiles()); if ($numRows == 0) { echo '
' . ($errorMsg != null ? $errorMsg . '
' : '') . 'Ni shranjenih list respondentov!
'; } else { echo '
'; echo '
'; $sql_email_invitations_profiles = sisplet_query("SELECT id, name FROM srv_userbase_respondents_lists"); while ($row_email_invitations_profiles = mysqli_fetch_assoc($sql_email_invitations_profiles)) { echo '
' . $row_email_invitations_profiles['name'] . '
'; } echo '
'; echo '
'; echo '
'; $this->show_userbase_list_respondents($curent_id, $errorMsg); echo '
'; echo '
'; echo '
'; echo ''; } echo ''; } /** * TODO ??? * * @param mixed $id * @param mixed $errorMsg */ function show_userbase_list_respondents($id = null, $errorMsg = null) { global $lang; if ($errorMsg != null) { echo '
' . $errorMsg . '
'; } // preberemo ime liste in sistemske spremenljivke $sqlLista = sisplet_query("SELECT name, variables FROM srv_userbase_respondents_lists WHERE id = '" . $id . "'"); $rowLista = mysqli_fetch_assoc($sqlLista); // preberemo respondente $_respondenti = array(); $sqlRespondenti = sisplet_query("SELECT line FROM srv_userbase_respondents WHERE list_id = '" . $id . "'"); while ($row_respondenti = mysqli_fetch_assoc($sqlRespondenti)) { $_respondenti[] = $row_respondenti['line']; } if ($_respondenti) $respondenti = implode("
", $_respondenti); echo '
'; echo '

' . $lang['srv_userbase_list_name'] . ':'; echo '

'; echo '

' . $lang['srv_userbase_variables'] . ':'; echo '

'; echo '

' . $lang['srv_userbase_respondents'] . ':'; echo '

' . $respondenti . '

'; echo '
'; echo '
'; if ($id > 0) { echo '
' . $lang['srv_userbase_add_list'] . '
'; $confirmDelete = $lang['srv_userbase_confirm_delete_list'] . $rowLista['name'] . "?"; echo '
' . $lang['srv_userbase_edit_list'] . '
'; echo '
' . $lang['srv_userbase_delete_list'] . '
'; echo '
'; } } /** * TODO ??? * * @param mixed $mailto_radio * @param mixed $mailto_status */ function show_mailto_users($mailto_radio, $mailto_status = null) { global $lang; $arrayMailtoSqlString = $this->getMailtoSqlString($mailto_radio, $mailto_status); $errorMsg = $arrayMailtoSqlString['errorMsg']; $sqlString = $arrayMailtoSqlString['sqlString']; echo '
' . $lang['srv_mail_to_user_list'] . ':'; if ($errorMsg == null) { $sqlUsers = sisplet_query($sqlString); if (mysqli_num_rows($sqlUsers) > 0) { while ($rowUsers = mysqli_fetch_array($sqlUsers)) { $sqlUser = sisplet_query("SELECT d.text FROM srv_data_text".$this->db_table." d, srv_spremenljivka s , srv_grupa g " . " WHERE d.spr_id=s.id AND d.usr_id='" . $rowUsers['id'] . "' AND " . " s.variable = 'email' AND g.ank_id='" . $this->anketa . "' AND s.gru_id=g.id "); if (!$sqlUser) echo mysqli_error($GLOBALS['connect_db']); $rowUser = mysqli_fetch_array($sqlUser); if ($rowUser['text'] != "" && $rowUser['text'] != NULL) { echo '

' . $rowUser['text'] . ' (status: ' . $rowUsers['status'] . ' - ' . $lang['srv_userstatus_' . $rowUsers['status']] . ')

'; } else { echo '

' . $lang['srv_respondent_email_missing'] . ' (status: ' . $rowUsers['status'] . ' - ' . $lang['srv_userstatus_' . $rowUsers['status']] . ')

'; } } } else { $errorMsg = $lang['srv_mail_to_user_no_data']; } } if ($errorMsg != null) { echo '
' . $errorMsg . '
'; } echo '
'; } /** Odpre okno za predogled poslanega e-maila obveščanja z pripadajočim seznamom uporabnikov * * @param mixed $mailto_radio * @param mixed $mailto_status */ function preview_mailto_email($mailto_radio, $mailto_status) { global $site_url, $lang; // preberemo vsebino sporočila $sql_userbase = sisplet_query("SELECT * FROM srv_userbase_setting WHERE ank_id = '$this->anketa'"); if (mysqli_num_rows($sql_userbase) > 0) { // anketa že ima nastavljen text $row_userbase = mysqli_fetch_assoc($sql_userbase); } else { // anketa še nima nastavljenega teksta, preberemo privzetega (id=1) iz tabele srv_userbase_invitations $sql_userbase_invitations = sisplet_query("SELECT * FROM srv_userbase_invitations WHERE id = 1"); $row_userbase = mysqli_fetch_assoc($sql_userbase_invitations); } // poiščemo sistemske spremenljivke iz vsebine preg_match_all("/#(.*?)#/s", $row_userbase['text'], $sisVars); $sisVars = $sisVars[1]; // Poiščemo še sistemske spremenljivke iz ankete $sqlSistemske = sisplet_query("SELECT s.id, s.naslov, s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='" . $this->anketa . "' ORDER BY g.vrstni_red, s.vrstni_red"); if (mysqli_num_rows($sqlSistemske) > 0) { while ($rowSistemske = mysqli_fetch_assoc($sqlSistemske)) { if (!isset($sisVars[strtoupper($rowSistemske['variable'])])) $sisVars[] = strtoupper($rowSistemske['variable']); } } // preberemo prejemnike $arrayMailtoSqlString = $this->getMailtoSqlString($mailto_radio, $mailto_status); $errorMsg = $arrayMailtoSqlString['errorMsg']; $sqlString = $arrayMailtoSqlString['sqlString']; $usrArray = array(); if ($errorMsg == null) { $sqlUsers = sisplet_query($sqlString); if (mysqli_num_rows($sqlUsers) > 0) { //while ($rowUsers = mysqli_fetch_array($sqlUsers)) { // naredimo samo za prvega userja while ($rowUsers = mysqli_fetch_array($sqlUsers)) { # ali imamo ustrezne sistemske spremenljivke (predvsem e-mail) $valid_user = false; $tmpUser = array(); $tmpUser['cookie'] = $rowUsers['cookie']; $tmpUser['pass'] = $rowUsers['pass']; $tmpUser ['status'] = $rowUsers['status']; $tmpUser ['label'] = $lang['srv_userstatus_' . $rowUsers['status']]; // dodamo sistemske spremenljivke in poiščemo njihove vrednosti foreach ($sisVars as $sysVar) { $sqlUser = sisplet_query("SELECT d.text FROM srv_data_text".$this->db_table." d, srv_spremenljivka s , srv_grupa g WHERE d.spr_id=s.id AND d.usr_id='" . $rowUsers['id'] . "' AND s.variable = '" . strtolower($sysVar) . "' AND g.ank_id='" . $this->anketa . "' AND s.sistem = 1 AND s.gru_id=g.id "); if (!$sqlUser) echo mysqli_error($GLOBALS['connect_db']); $rowUser = mysqli_fetch_assoc($sqlUser); if ($rowUser['text'] != null && $rowUser['text'] != '') { $tmpUser[strtolower($sysVar)] = $rowUser['text']; } # če mamo email in je vnešen je uporabnik veljaven if (strtolower($sysVar) == 'email' && $rowUser['text'] != null && $rowUser['text'] != '') { $valid_user = true; } } if ($valid_user) { $usrArray[$rowUsers['id']] = $tmpUser; } } } else { $errorMsg = "Ni uporabnikov ki ustrezajo izbranim pogojem!"; } } $frstUser = current($usrArray); // cookie, email poberemo od prvega uporabnika $url = SurveyInfo::getSurveyLink() . '?code=' . $frstUser['pass'] . ''; $unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this->anketa . '&code=' . $frstUser['pass'] . ''; // zamenjamo sistemske vrednosti $content = $row_userbase['text']; // za staro verzijo $content = str_replace('[URL]', '#URL#', $content); $content = str_replace('[CODE]', '#CODE#', $content); $content = str_replace(array( '#URL#', '#CODE#' ), array( '' . $url . '', $frstUser['pass'] ), $content); $content = str_replace('#UNSUBSCRIBE#', '' . $lang['user_bye_hl'] . '', $content); // poiščemo prestale variable katere je potrebno zamenjati preg_match_all("/#(.*?)#/s", $content, $toReplace); foreach ($toReplace[0] as $key => $seed) { $content = str_replace($toReplace[0][$key], $frstUser[strtolower($toReplace[1][$key])], $content); } $subject = $row_userbase['subject']; // izpišemo vsebino echo '
'; echo '
'; echo 'Prejemniki:'; echo '
'; $brdr_top = ""; foreach ($usrArray as $user) { echo '
' . $user['email'] . '
'; } echo '
'; echo '
'; echo '
'; echo 'Naslov:'; echo '
'; echo '
'; echo $subject; echo '
'; echo '
'; echo 'Vsebina:'; echo '
'; echo '
'; echo $content; echo '
'; //text samo pri previewju v formi (hitro posiljanje mailov) if ($_GET['a'] == 'form_send_email') { echo '
'; echo 'S potrditvijo boste zgornje vabilo poslali. Če bi želeli spreminjati nagovor, pojdite v napredne opcije.'; echo '
'; } echo '
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; echo '
'; } /** * TODO ??? * * @param mixed $mailto_radio * @param mixed $mailto_status * @return mixed */ function getMailtoSqlString($mailto_radio, $mailto_status = null) { $sqlString = null; $errorMsg = null; //v odvisnosti od statusa polovimo emaile in jih zlistamo na levi strani if ($mailto_radio == 'all') { $sqlString = "SELECT id, last_status as status, cookie, pass FROM srv_user WHERE ank_id = '" . $this->anketa . "' AND unsubscribed='0'"; } elseif ($mailto_radio == 'norsp') { $sqlString = "SELECT st.status, usr_tbl.* FROM srv_userstatus AS st LEFT JOIN ( SELECT max(s.datetime) as statusdatetime, u.* FROM srv_user as u" . " LEFT JOIN srv_userstatus AS s ON u.id = s.usr_id AND u.unsubscribed='0' WHERE u.ank_id = '" . $this->anketa . "' AND recnum = '0' GROUP BY s.usr_id) AS usr_tbl ON st.usr_id = usr_tbl.id " . " WHERE usr_tbl.statusdatetime = st.datetime ORDER BY st.status"; } elseif ($mailto_radio == 'rsp') { $sqlString = "SELECT st.status, usr_tbl.* FROM srv_userstatus AS st LEFT JOIN ( SELECT max(s.datetime) as statusdatetime, u.* FROM srv_user as u" . " LEFT JOIN srv_userstatus AS s ON u.id = s.usr_id AND u.unsubscribed='0' WHERE u.ank_id = '" . $this->anketa . "' AND recnum > '0' GROUP BY s.usr_id) AS usr_tbl ON st.usr_id = usr_tbl.id " . " WHERE usr_tbl.statusdatetime = st.datetime ORDER BY st.status"; } elseif ($mailto_radio == 'status') { if (!isset ($mailto_status) || $mailto_status == null || $mailto_status == "") { $errorMsg = "Status ni izbran!"; } else { // nardimo string statusov $sqlString = "SELECT id, last_status as status, cookie, pass FROM srv_user WHERE ank_id = '" . $this->anketa . "' AND unsubscribed='0' AND last_status IN (" . $mailto_status . ") ORDER BY last_status"; } } else { $errorMsg = "Napaka!"; } return array( 'sqlString' => $sqlString, 'errorMsg' => $errorMsg ); } /** Preveri ali uporabnik ustreza minimalni zahtevi statusa * * @param $minimum_role_request minimalna zahteva (lahko podamo kot array posamezno) * @return true/false */ function user_role_cehck($minimum_role_request = U_ROLE_ADMIN) { global $admin_type; if (is_array($minimum_role_request) && count($minimum_role_request) > 0) { // ce podamo kot array preverimo za vsak zapis posebej foreach ($minimum_role_request as $role) { if ($admin_type == $role) return true; } } else { if ($admin_type <= $minimum_role_request) return true; } return false; } var $getSurvey_type = null; function getSurvey_type($sid) { if ($this->getSurvey_type != null) return $this->getSurvey_type; // polovimo tip ankete SurveyInfo::getInstance()->SurveyInit($sid); $this->getSurvey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type"); return $this->getSurvey_type; } /** * prikaze infobox * */ function displayInfoBox() { // klicemo iz SurveyInfo SurveyInfo::getInstance()->SurveyInit($this->anketa); SurveyInfo::getInstance()->DisplayInfoBox(); } /** * TODO ???? * * @param mixed $grupa * @param mixed $editmode */ function showEditPageDiv($grupa, $editmode = false){ global $lang; if (!$editmode && SurveyInfo::getInstance()->checkSurveyModule('uporabnost')) { SurveySetting::getInstance()->Init($this->anketa); $link = SurveySetting::getInstance()->getSurveyMiscSetting('uporabnost_link_' . $grupa); if (strlen($link) > 7) echo ', Link: ' . $link; } echo ''; if ($editmode) { //polovimo ime grupe $sql = sisplet_query("SELECT id, naslov FROM srv_grupa WHERE id = '$grupa'"); $row = mysqli_fetch_array($sql); echo ' '; if (SurveyInfo::getInstance()->checkSurveyModule('uporabnost')) { SurveySetting::getInstance()->Init($this->anketa); $link = SurveySetting::getInstance()->getSurveyMiscSetting('uporabnost_link_' . $grupa); if ($link == '') $link = 'http://'; echo ' Link: '; } } echo '' . $lang['srv_editirajgrupo'] . ''; echo '' . $lang['srv_brisigrupo'] . ''; echo ''; } /** * TODO ??? * * @param mixed $anketa */ private static $checkAnketaExist = array(); function checkAnketaExist($anketa = 0) { if ($anketa == 0) $anketa = $this->anketa; if (isset(self::$checkAnketaExist[$anketa])) return self::$checkAnketaExist[$anketa]; $sqlString = "SELECT count(*) FROM srv_anketa WHERE active >= '0' AND id = '" . $anketa . "'"; $sqlQuery = sisplet_query($sqlString); $sqlRow = mysqli_fetch_array($sqlQuery); self::$checkAnketaExist[$anketa] = ($sqlRow[0] > 0) ? true : false; return self::$checkAnketaExist[$anketa]; } /** * TODO ??? * * @param mixed $needed */ function alert_add_necessary_sysvar($needed = array(), $updateUserBase = false) { global $lang; if (is_array($needed) && count($needed) > 0) { $needed = $needed; } else { $needed = array('email', 'ime'); } SurveyRespondents::Init($this->anketa); SurveyRespondents::checkSystemVariables($needed, $updateUserBase); return $needed; } /** * TODO ??? * */ function alert_change_user_from_cms() { global $lang; // nastavimo respondent iz cms echo $lang['srv_alert_respondent_cms']; $mysqlUpdate = sisplet_query("UPDATE srv_anketa SET user_from_cms = '1' WHERE id='" . $this->anketa . "'"); // vsilimo refresh podatkov SurveyInfo:: getInstance()->resetSurveyData(); if (!$mysqlUpdate) { echo mysqli_error($GLOBALS['connect_db']); } else { echo $lang['srv_alert_respondent_cms_note_ok']; echo ''; } } /** * TODO ??? * */ function anketa_aktivacija_note() { global $lang; $row = SurveyInfo::getInstance()->getSurveyRow(); if ($row['active'] == 0) { echo $lang['srv_url_survey_not_active']; echo ' '; echo ' '; echo ' '; echo ' ' . $lang['srv_anketa_setActive'] . ''; echo ' '; echo ' '; } else { echo $lang['srv_url_intro_active']; echo ' '; echo ' '; echo ' '; echo ' ' . $lang['srv_anketa_setNoActive'] . ''; echo ' '; echo ' '; } } /** pravilno redirekta admin url ankete * če je anketa aktivna gre na dashboard * če anketa ni aktivna gre na: * - v primeru da še ni bila kativirana gre na urejanje * - v primeru da je bila aktivirana (je pretekla) gre na dashboard */ function redirectLink() { global $site_url; # ugotovimo ali je uporabnik telefonski anketar if ($this->isAnketar) { #če je anketar lahko samo kliče header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_TELEPHONE . '&m=start_call'); exit(); } // v kolikor je aktivna hierarhija preusmerimo uporabnika na status od hierarhije if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) { $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); // v kolikor je uporabnik admin, ga preusmerimo na dostop za administratorje if($hierarhija_type < 5){ header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_HIERARHIJA_SUPERADMIN . '&m='.M_HIERARHIJA_STATUS); exit(); } // vse ostale uporabnike preusmerimo na običajni pogled hierarhije header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_HIERARHIJA. '&m='.M_HIERARHIJA_STATUS); exit(); } # če nima dostopa do statusa ali urejanja je potreben redirekt kam drugam $d = new Dostop(); if (!$d->checkDostopSub('edit') || !$d->checkDostopSub('dashboard')) { // Po prioriteti vrstni red strani kamor preusmerimo ce ima uporabnik dostop if ($d->checkDostopSub('edit')) { header('Location: index.php?anketa=' . $this->anketa); die(); } elseif ($d->checkDostopSub('dashboard')) { header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI); die(); } elseif ($d->checkDostopSub('test')) { header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_TESTIRANJE); die(); } elseif ($d->checkDostopSub('publish')) { header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_VABILA); die(); } elseif ($d->checkDostopSub('data')) { header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA); die(); } elseif ($d->checkDostopSub('analyse')) { header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_ANALYSIS); die(); } else { header('location: ' . $site_url . 'admin/survey/'); die(); } } # ugotovimo status ankete SurveyInfo::getInstance()->SurveyInit($this->anketa); if (SurveyInfo::getSurveyColumn('active') == 1) { # anketa je aktivna, gremo na dashboard header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI); exit(); } else { # preverimo ali je bila anketa že aktivirana $activity = SurveyInfo:: getSurveyActivity(); $_last_active = end($activity); if (isset($_last_active) && $_last_active != null) { # anketa je že bila aktivirana in je potekla gremo na dashboard header('Location: index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI); exit(); } else { # anketa še ni bila aktivirana gremo na urejanje header('Location: index.php?anketa=' . $this->anketa); exit(); } } die(); } function displayAktivnost(){ global $lang, $site_url, $admin_type, $global_user_id; $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); SurveyInfo::getInstance()->SurveyInit($this->anketa); $row = SurveyInfo::getInstance()->getSurveyRow(); SurveySetting::getInstance()->Init($this->anketa); // preverimo če je čas aktivacije potekel potem anketo deaktiviramo oz, ce bi se morala sama aktivirati $row['active'] = SurveyInfo::getInstance()->checkSurveyActive(); $link = SurveyInfo::getSurveyLink(); $activity = SurveyInfo:: getSurveyActivity(); $_last_active = end($activity); $preview_disableif = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disableif'); $preview_disablealert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disablealert'); $preview_displayifs = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayifs'); $preview_displayvariables = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayvariables'); $preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment'); $preview_options = '' . ($preview_disableif == 1 ? '&disableif=1' : '') . ($preview_disablealert == 1 ? '&disablealert=1' : '') . ($preview_displayifs == 1 ? '&displayifs=1' : '') . ($preview_displayvariables == 1 ? '&displayvariables=1' : '') . ($preview_hidecomment == 1 ? '&hidecomment=1' : '') . ''; // URL ankete echo '
'; if ($row['active'] == 1 && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) { echo ''.$link.''; } elseif (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) { echo ''.$site_url.'sa'; } else { echo ''.$link.''; } echo '
'; $this->tooltip_survey_activity(); echo '
'; echo '
'; // Aktivacija ankete $d = new Dostop(); if ($d->checkDostopAktiven()) { echo '
'; if (SurveyInfo::getSurveyColumn('active') == 1) { # anketa je aktivna # V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ if ($hierarhija_type == 1) { echo ''; } else{ echo ''; } } else { echo ''; } echo '
'; echo '
'; } // Preklop domene na oneclicksurvey.com - ne pustimo aktivacije elseif(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){ echo ''; echo '
'; echo '
'; } else { $anketa_active = "anketa_active('" . $this->anketa . "','" . $row['active'] . "'); "; //Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ if ($hierarhija_type == 1) { echo ''; } else{ echo ''; } } else { echo ''; } echo '
'; echo '
'; } echo '
'; $this->tooltip_survey_activity(); echo '
'; echo '
'; // Ikona kljucavnice echo '
'; // Ce ima uporabnik prepreceno moznost odklepanja ankete, anketo ima vedno zaklenjeno če je vklopljena hierarhija $prevent_unlock = 0; if(SurveyInfo::getSurveyModules('hierarhija') == 2 || (!$d->checkDostopSub('lock') && $row['locked'] == 1 && $admin_type != 0 && $admin_type != 1)) $prevent_unlock = 1; if ($prevent_unlock == 1) { echo ''; echo ''; echo ''; echo ''; } else { # zaklepanje if ($hierarhija_type == 10) { echo ''; } else { echo ''; } echo ''; echo ''; } echo '
'; $this->tooltip_survey_locked(); echo '
'; echo '
'; } // Testiranje (ikona monitor s "T") - v formi in glasovanju nimamo testnih vnosov if ($this->survey_type != 0 && $this->survey_type != 1) { echo '
'; echo ' '; echo '
'; $this->tooltip_test_data(); echo '
'; echo '
'; } // Predogled in testiranje (ikona monitor) echo '
'; echo ' '.$lang['srv_poglejanketo2'].' '; echo '
'; $this->tooltip_preview_data(); echo '
'; echo '
'; } function surveyAutoActivate() { global $global_user_id; # preverimo ali je anketa že bila aktivirana $str = "SELECT * FROM srv_activity WHERE sid =" . $this->anketa; $qry = sisplet_query($str); if (mysqli_num_rows($qry) == 0) { # če anketa še ni bila kativirana jo aktiviramo za tri mesece $row = SurveyInfo::getInstance()->getSurveyRow(); #(3) čim klikne na OBJAVA naj se zadeva tudi ze kar aktivira (kot bi kliknil na AKTIVIRAJ (vendar brez popupa in dajte daafulut trajanje na 3 miesece. if ($row['active'] != 1) { $uString = "UPDATE srv_anketa SET active = '1', starts=NOW(), expire = date_add(NOW(), INTERVAL 3 MONTH) WHERE id='" . $this->anketa . "'"; $s = sisplet_query($uString); if (!$s) echo mysqli_error($GLOBALS['connect_db']); #updejtamo še stv_activity $uString = "INSERT INTO srv_activity (sid, starts, expire) VALUES ('" . $this->anketa . "', NOW(), date_add(NOW(), INTERVAL 3 MONTH))"; $s = sisplet_query($uString); if (!$s) echo mysqli_error($GLOBALS['connect_db']); SurveyInfo:: getInstance()->SurveyInit($this->anketa); # vsilimo refresh podatkov SurveyInfo:: getInstance()->resetSurveyData(); } } } } ?>