2020-08-14 13:36:36 +02:00
< ? php
/**
* Ta class se vedno kliče iz SurveyAdmin
*
* Vsebuje naj vse nastavitve v anketi in take zadeve , ki se ne uporabljajo pogosto ( in se ne kličejo preko ajaxa ) da ne smetijo v SurveyAdmin
*
* Zaenkrat je še celotna kopija SurveyAdmin , treba je še pobrisat odvečne funkcije
*
* @ var mixed
*/
global $site_path ;
if ( session_id () == '' ) {
session_start ();
}
class SurveyAdminSettings {
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
/**
* @ 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 ;
if (( isset ( $_REQUEST [ 'anketa' ]) && $_REQUEST [ 'anketa' ] > 0 ) || ( isset ( $anketa ) && $anketa > 0 )) {
2021-10-04 12:54:54 +02:00
$this -> anketa = ( isset ( $anketa ) && $anketa > 0 ) ? $anketa : $_REQUEST [ 'anketa' ];
2021-10-04 11:49:21 +02:00
}
else {
2020-08-14 13:36:36 +02:00
// nekje se uporablja tudi brez IDja ankete!!!
//die("SAS: SID missing!");
}
SurveyInfo :: getInstance () -> SurveyInit ( $this -> anketa );
SurveyInfo :: getInstance () -> resetSurveyData ();
2021-07-23 12:25:40 +02:00
$this -> db_table = SurveyInfo :: getInstance () -> getSurveyArchiveDBString ();
2020-08-14 13:36:36 +02:00
$this -> survey_type = $this -> getSurvey_type ( $this -> anketa );
$this -> stran = $_GET [ 'a' ];
}
/* Globalne nastavitve
* Osnovni podatki
* Respondenti
* Design
* Obveščanje
* Piškotek
* Trajanje
* Komentarji
* Dostop
*/
function anketa_nastavitve_global () { //OSTANE
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
/* Globalne nastavitve ankete: veljajo za celoto anketo ne glede na uporabnika*/
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
2021-11-29 11:20:25 +01:00
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
echo '<form name="settingsanketa_' . $row [ 'id' ] . '" action="ajax.php?a=editanketasettings" method="post" autocomplete="off">' . " \n \r " ;
echo ' <input type="hidden" name="anketa" value="' . $this -> anketa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="grupa" value="' . $this -> grupa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
/*Osnovni podatki*/
if ( $_GET [ 'a' ] == 'osn_pod' || $_GET [ 'a' ] == 'nastavitve' ) {
/* OSNOVNI PODATKI */
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_osnovniPodatki' ] . '</legend>' ;
2021-11-23 00:22:00 +01:00
echo '<div class="setting_holder">' ;
echo '<label for="anketa_polnoIme">' . $lang [ 'srv_novaanketa_polnoime' ] . ':</label>' ;
2022-05-02 09:15:04 +02:00
echo ' <input type="text" class="large" id="anketa_polnoIme" name="naslov" value="' . $row [ 'naslov' ] . '" />' ;
echo ' <span class="charalimit" id="anketa_polnoIme_chars">' . strlen ( $row [ 'naslov' ]) . '/' . ANKETA_NASLOV_MAXLENGTH . '</span>' ;
2021-11-23 00:22:00 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2022-05-02 09:15:04 +02:00
echo ' <label for="anketa_akronim">' . $lang [ 'srv_novaanketa_kratkoime' ] . ':</label>' ;
echo ' <input type="text" class="large" id="anketa_akronim" name="akronim" value="' . $row [ 'akronim' ] . '" />' ;
echo ' <span class="charalimit" id="anketa_akronim_chars">' . strlen ( $row [ 'akronim' ]) . '/' . ANKETA_AKRONIM_MAXLENGTH . '</span>' ;
2021-11-23 00:22:00 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2022-05-02 09:15:04 +02:00
echo ' <label for="anketa_note">' . $lang [ 'srv_note' ] . ':</label>' ;
echo ' <textarea id="anketa_note" name="intro_opomba" maxlength="' . ANKETA_NOTE_MAXLENGTH . '">' . $row [ 'intro_opomba' ] . '</textarea>' ;
echo ' <span class="charalimit" id="anketa_note_chars";">' . strlen ( $row [ 'intro_opomba' ]) . '/' . ANKETA_NOTE_MAXLENGTH . '</span>' ;
2021-11-23 00:22:00 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
UserSetting :: getInstance () -> Init ( $global_user_id );
$show_folders = UserSetting :: getInstance () -> getUserSetting ( 'survey_list_folders' );
$selected_folder = 0 ;
$sqlFA = sisplet_query ( " SELECT folder FROM srv_mysurvey_anketa WHERE usr_id=' " . $global_user_id . " ' AND ank_id=' " . $this -> anketa . " ' " );
if ( mysqli_num_rows ( $sqlFA ) > 0 ){
$rowFA = mysqli_fetch_array ( $sqlFA );
$selected_folder = $rowFA [ 'folder' ];
}
$sqlF = sisplet_query ( " SELECT id, naslov FROM srv_mysurvey_folder WHERE usr_id=' " . $global_user_id . " ' ORDER BY naslov ASC " );
if ( $show_folders == 1 && mysqli_num_rows ( $sqlF ) > 0 ){
2021-11-23 00:22:00 +01:00
echo '<div class="setting_holder">' ;
2022-04-14 18:06:01 +02:00
echo '<label for="anketa_folder">' . $lang [ 'srv_newSurvey_survey_new_folder' ] . Help :: display ( 'srv_nova_shrani' ) . ':</label>' ;
2021-11-23 00:22:00 +01:00
echo '<select class="dropdown large" name="anketa_folder" id="anketa_folder">' ;
2020-08-14 13:36:36 +02:00
echo '<option value="0" ' . ( $selected_folder == 0 ? ' selected="selected"' : '' ) . '>' . $lang [ 'srv_newSurvey_survey_new_folder_def' ] . '</option>' ;
while ( $rowF = mysqli_fetch_array ( $sqlF )){
echo '<option value="' . $rowF [ 'id' ] . '" ' . ( $rowF [ 'id' ] == $selected_folder ? ' selected="selected"' : '' ) . '>' . $rowF [ 'naslov' ] . '</option>' ;
}
echo '</select>' ;
2021-11-23 00:22:00 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2021-11-23 00:22:00 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
/* JEZIK */
echo '<fieldset>' ;
2022-04-14 18:06:01 +02:00
echo '<legend>' . $lang [ 'lang' ] . Help :: display ( 'srv_nastavitve_jezik' ) . '</legend>' ;
2020-08-14 13:36:36 +02:00
$lang_admin = $row [ 'lang_admin' ];
$lang_resp = $row [ 'lang_resp' ];
$lang_array = array ();
// Preberemo razpoložljive jezikovne datoteke
if ( $dir = opendir ( '../../lang' )) {
while (( $file = readdir ( $dir )) !== false ) {
if ( $file != '.' AND $file != '..' ) {
if ( is_numeric ( substr ( $file , 0 , strpos ( $file , '.' )))) {
$i = substr ( $file , 0 , strpos ( $file , '.' ));
if ( $i > 0 ) {
$file = '../../lang/' . $i . '.php' ;
@ include ( $file );
$lang_array [ $i ] = $lang [ 'language' ];
}
}
}
}
}
// nastavimo jezik nazaj
if ( $lang_admin > 0 ) {
$file = '../../lang/' . $lang_admin . '.php' ;
@ include ( $file );
}
2021-11-23 00:22:00 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_language_admin_survey' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
ksort ( $lang_array );
foreach ( $lang_array AS $key => $val ) {
2021-11-23 00:22:00 +01:00
if ( $key == 1 || $key == 2 ) {
echo '<div class="setting_item">' ;
echo '<input type="radio" value="' . $key . '" id="lll_' . $key . '" ' . ( $key == $lang_admin ? ' checked' : '' ) . ' name="lang_admin">' ;
echo '<label for="lll_' . $key . '">' . $val . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
2021-11-23 00:22:00 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<label for="lang_resp">' . $lang [ 'srv_language_respons_1' ] . ':</label>' ;
2020-08-14 13:36:36 +02:00
asort ( $lang_array );
2021-11-23 00:22:00 +01:00
echo '<select class="dropdown large" id="lang_resp" name="lang_resp">' ;
2020-08-14 13:36:36 +02:00
foreach ( $lang_array AS $key => $val ) {
echo '<option value="' . $key . '" ' . ( $key == $lang_resp ? ' selected' : '' ) . '>' . $val . '</option>' ;
}
2021-11-23 00:22:00 +01:00
echo '</select>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 00:22:00 +01:00
// Ta del se v 2. fazi zamenja z gumbom "Večjezične ankete"
2021-12-01 00:15:39 +01:00
echo '<div class="setting_holder">' ;
2022-02-03 23:22:04 +01:00
echo '<p class="bottom8">' . $lang [ 'srv_language_link2' ] . ':' ;
2021-11-23 00:22:00 +01:00
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
2020-08-14 13:36:36 +02:00
$userAccess = UserAccess :: getInstance ( $global_user_id );
if ( $userAccess -> checkUserAccess ( $what = 'prevajanje' )){
2021-11-23 13:36:49 +01:00
echo ' <a href="index.php?anketa=' . $this -> anketa . '&a=prevajanje" title="' . $lang [ 'srv_language_link' ] . '"><span class="bold">' . $lang [ 'srv_language_link' ] . '</span></a></p>' ;
2020-08-14 13:36:36 +02:00
}
else {
2021-11-23 13:36:49 +01:00
echo ' <a href="#" onClick=popupUserAccess(\'prevajanje\'); return false;" title="' . $lang [ 'srv_language_link' ] . '" class="user_access_locked"><span class="bold">' . $lang [ 'srv_language_link' ] . '</span></a></p>' ;
2021-11-23 00:22:00 +01:00
}
2022-02-03 23:22:04 +01:00
echo '<p>' . $lang [ 'srv_language_mySurveys' ] . '.</p>' ;
2021-11-23 13:36:49 +01:00
2021-12-01 00:15:39 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 00:22:00 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
// Gumb shrani - vmes
2021-11-29 11:20:25 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
2021-11-23 13:36:49 +01:00
echo '<button class="medium blue" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
/* INTERAKTIVNI ELEMENTI */
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_interaktivni_elementi' ] . '</legend>' ;
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$survey_privacy = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_privacy' );
$survey_hint = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_hint' ); if ( $survey_hint == '' ) $survey_hint = 1 ;
$survey_hide_title = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_hide_title' );
$survey_track_reminders = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_track_reminders' ); if ( $survey_track_reminders == '' ) $survey_track_reminders = 0 ;
$display_backlink = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'display_backlink' );
$multiple_pages = false ;
$sqlg = sisplet_query ( " SELECT id FROM srv_grupa WHERE ank_id = ' $this->anketa ' " );
if ( mysqli_num_rows ( $sqlg ) > 1 )
$multiple_pages = true ;
2021-11-23 13:36:49 +01:00
// Indikator napredka
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_te_progressbar' ] . ' ' . Help :: display ( 'srv_show_progressbar' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="progressbar1" name="progressbar" value="1" ' . ( $row [ 'progressbar' ] == 1 && $multiple_pages ? ' checked="checked"' : '' ) . ' ' . ( ! $multiple_pages ? 'disabled' : '' ) . '>' ;
echo '<label for="progressbar1" ' . ( ! $multiple_pages ? 'disabled' : '' ) . '>' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="progressbar0" name="progressbar" value="0" ' . ( $row [ 'progressbar' ] == 0 || ! $multiple_pages ? ' checked="checked"' : '' ) . ' ' . ( ! $multiple_pages ? 'disabled' : '' ) . '>' ;
echo '<label for="progressbar0" ' . ( ! $multiple_pages ? 'disabled' : '' ) . '>' . $lang [ 'no1' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Naslov ankete za uporabnike
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_show_title' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="survey_hide_title1" name="survey_hide_title" value="0" ' . ( $survey_hide_title == 0 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="survey_hide_title1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="survey_hide_title0" name="survey_hide_title" value="1" ' . ( $survey_hide_title == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="survey_hide_title0">' . $lang [ 'no1' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Politika zasebnosti
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_privacy' ] . ' ' . Help :: display ( 'srv_privacy_setting' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="privacy0" name="privacy" value="0"' . ( $survey_privacy == 0 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="privacy0">' . $lang [ 'srv_privacy_0' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="privacy1" name="privacy" value="1"' . ( $survey_privacy == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="privacy1">' . $lang [ 'srv_privacy_1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="privacy2" name="privacy" value="2"' . ( $survey_privacy == 2 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="privacy2">' . $lang [ 'srv_privacy_2' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Nadaljuj kasneje
if ( $this -> survey_type > 1 ){
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_show_continue_later' ] . ' ' . Help :: display ( 'srv_continue_later_setting' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="continue_later" value="1" id="continue_later_1"' . ( $row [ 'continue_later' ] == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="continue_later_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="continue_later" value="0" id="continue_later_0"' . ( $row [ 'continue_later' ] == 0 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="continue_later_0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// Gumb nazaj
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_slideshow_sett_back_button_lbl' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="display_backlink" id="display_backlink_1" ' . ( $display_backlink !== '0' ? ' checked' : '' ) . ' value="">' ;
echo '<label for="display_backlink_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="display_backlink" id="display_backlink_0" ' . ( $display_backlink === '0' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="display_backlink_0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Namig
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_hint' ] . ' ' . Help :: display ( 'srv_namig_setting' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="namig1" name="survey_hint" value="1"' . ( $survey_hint == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="namig1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input id="namig0" type="radio" name="survey_hint" value="0"' . ( $survey_hint == 0 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="namig0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 13:36:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 13:36:49 +01:00
// Oozorilo na vprašanja
echo '<div class="setting_holder">' ;
2022-04-14 18:06:01 +02:00
echo '<span class="seting_title">' . $lang [ 'srv_opozorilo_vprasanja' ] . Help :: display ( 'srv_splosnenas_opozorilo' ) . ':</span>' ;
2021-11-23 13:36:49 +01:00
echo '<div class="setting_item">' ;
2021-11-29 11:53:02 +01:00
echo '<a class="noline" href="#" onClick="popupAlertAll(\'no\')"><span class="faicon minus_circle link-right"></span>' . $lang [ 'srv_no_reminder_all' ] . '</a>' ;
2021-11-23 13:36:49 +01:00
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-11-29 13:31:49 +01:00
echo '<a class="noline" href="#" onClick="popupAlertAll(\'soft\')"><span class="faicon link-right fa-stack"><span class="faicon circle empty fa-stack-1x"></span> <span class="faicon plus small fa-stack-1x"></span></span>' . $lang [ 'srv_soft_reminder_all' ] . '</a>' ;
2021-11-23 13:36:49 +01:00
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-11-29 11:53:02 +01:00
echo '<a class="noline" href="#" onClick="popupAlertAll(\'hard\')"><span class="faicon plus_circle link-right"></span>' . $lang [ 'srv_hard_reminder_all' ] . '</a>' ;
2021-11-23 13:36:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 13:36:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Napredni parapodatki
if (( $admin_type == 0 || $admin_type == 1 ) && $this -> survey_type > 0 ) {
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="seting_title">' . $lang [ 'srv_parapodatki' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="parapodatki1" name="parapodatki" value="1"' . ( $row [ 'parapodatki' ] == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="parapodatki1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="parapodatki0" name="parapodatki" value="0"' . ( $row [ 'parapodatki' ] == 0 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="parapodatki0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 13:36:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '(Download: ' ;
// Download tracking podatke
echo '<a href="parapodatki.php?anketa=' . $this -> anketa . '&a=tracking" target="_blank">Editor data</a>, ' ;
// Download parapodatke
echo '<a href="parapodatki.php?anketa=' . $this -> anketa . '&a=parapodatki" target="_blank">Respondent data</a>, ' ;
// Download vprasanja v anketi (srv_spremenljivka)
echo '<a href="parapodatki.php?anketa=' . $this -> anketa . '&a=vprasanja" target="_blank">Survey questions</a>, ' ;
// Download variable v vprasanjih (srv_vrednost)
echo '<a href="parapodatki.php?anketa=' . $this -> anketa . '&a=items" target="_blank">Question items</a>' ;
2021-11-23 13:36:49 +01:00
echo ') ' . Help :: display ( 'srv_parapodatki' );
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// Arhiviranje vprasanj - samo admini in managerji
if ( $admin_type == 0 || $admin_type == 1 ) {
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_vprasanje_tracking' ] . ' ' . Help :: display ( 'srv_vprasanje_tracking_setting' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_1" ' . ( $row [ 'vprasanje_tracking' ] == 1 ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="vprasanje_tracking_1">' . $lang [ 'srv_avtomatsko' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_2" ' . ( $row [ 'vprasanje_tracking' ] == 2 ? ' checked' : '' ) . ' value="2">' ;
echo '<label for="vprasanje_tracking_2">' . $lang [ 'srv_rocno' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_0" ' . ( $row [ 'vprasanje_tracking' ] == 0 ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="vprasanje_tracking_0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
echo '</fieldset>' ;
/* ZAKLJUCEK (samo pri formi) */
if ( $row [ 'survey_type' ] == 1 ){
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_end_label' ] . '</legend>' ;
if ( $row [ 'url' ] != '' )
$url = $row [ 'url' ];
else
$url = $site_url ;
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title"><label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'srv_concl_link' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="concl_link0" name="concl_link" value="0" ' . ( $row [ 'concl_link' ] == 0 ? ' checked' : '' ) . ' onclick="$(\'#srv_concl_link_go\').hide()">' ;
echo '<label for="concl_link0">' . $lang [ 'srv_concl_link_close' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="concl_link1" name="concl_link" value="1" ' . ( $row [ 'concl_link' ] == 1 ? ' checked' : '' ) . ' onclick="$(\'#srv_concl_link_go\').show()">' ;
echo '<label for="concl_link1">' . $lang [ 'srv_concl_link_go' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item" id="srv_concl_link_go" ' . ( $row [ 'concl_link' ] == 0 ? ' style="display:none"' : '' ) . '>' ;
echo '<span class="setting_title"></span>' ;
echo '<label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'srv_url' ] . ':</label>' ;
echo '<form>' ;
echo '<input type="text" class="large" name="url" id="url_concl_sett" value="' . $url . '">' ;
echo '</form>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Prikaz zakljucka
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="seting_title" ><label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'srv_show_concl' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="show_concl0" name="show_concl" value="0" ' . (( $row [ 'show_concl' ] == 0 ) ? ' checked="checked" ' : '' ) . ' onclick="$(\'#srv_concl_settings\').hide()" />' ;
echo '<label for="show_concl0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="show_concl1" name="show_concl" value="1" ' . (( $row [ 'show_concl' ] == 1 ) ? ' checked="checked" ' : '' ) . ' onclick="$(\'#srv_concl_settings\').show()" />' ;
echo '<label for="show_concl1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_holder" id="srv_concl_settings" ' . ( $row [ 'show_concl' ] == 0 ? ' style="display:none"' : '' ) . '>' ;
2020-08-14 13:36:36 +02:00
// Besedilo zakljucka
$text = ( $row [ 'conclusion' ] == '' ) ? $lang [ 'srv_end' ] : $row [ 'conclusion' ];
2021-11-23 13:36:49 +01:00
echo '<label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'text' ] . ':</label>' ;
echo '<form>' ;
echo '<textarea id="conclusion" name="conclusion">' . $text . '</textarea>' ;
echo '</form>' ;
2020-08-14 13:36:36 +02:00
// Gumb konec
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" ><label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'srv_concl_end_button_show' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="concl_end_button0" name="concl_end_button" value="0" ' . (( $row [ 'concl_end_button' ] == 0 ) ? ' checked="checked" ' : '' ) . ' />' ;
echo '<label for="concl_end_button0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="concl_end_button1" name="concl_end_button" value="1" ' . (( $row [ 'concl_end_button' ] == 1 ) ? ' checked="checked" ' : '' ) . ' />' ;
echo '<label for="concl_end_button1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-23 13:36:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Gumb nazaj
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title"><label for="anketa' . $row [ 'id' ] . '" >' . $lang [ 'srv_concl_back_button_show' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="concl_back_button0" name="concl_back_button" value="0" ' . (( $row [ 'concl_back_button' ] == 0 ) ? ' checked="checked" ' : '' ) . ' />' ;
echo '<label for="concl_back_button0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input id="concl_back_button1" type="radio" name="concl_back_button" value="1" ' . (( $row [ 'concl_back_button' ] == 1 ) ? ' checked="checked" ' : '' ) . ' />' ;
echo '<label for="concl_back_button1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
echo '</fieldset>' ;
}
/* KNJIZNICA */
$sqlk = sisplet_query ( " SELECT * FROM srv_library_anketa WHERE ank_id=' $this->anketa ' AND uid=' $global_user_id ' " );
$moje = mysqli_num_rows ( $sqlk );
$sqlk = sisplet_query ( " SELECT * FROM srv_library_anketa WHERE ank_id=' $this->anketa ' AND uid='0' " );
$javne = mysqli_num_rows ( $sqlk );
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_library' ] . '</legend>' ;
if ( $admin_type == 0 || $admin_type == 1 ) {
2021-11-23 13:36:49 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_javne_ankete' ] . ':' ;
echo '<div class="setting_holder">' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="javne_ankete0" name="javne_ankete" value="0"' . ( $javne == 0 ? ' checked' : '' ) . ' onchange="javascript:check_library();">' ;
echo '<label for="javne_ankete0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="javne_ankete1" name="javne_ankete" value="1"' . ( $javne == 1 ? ' checked' : '' ) . ' onchange="javascript:check_library();">' ;
echo '<label for="javne_ankete1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder" id="moje_ankete">' ;
echo '<span class="setting_title">' . $lang [ 'srv_moje_ankete' ] . ' ' . Help :: display ( 'srv_moje_ankete_setting' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="moje_ankete0" name="moje_ankete" value="0"' . ( $moje == 0 ? ' checked' : '' ) . '>' ;
echo '<label for="moje_ankete0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="moje_ankete1" name="moje_ankete" value="1"' . ( $moje == 1 ? ' checked' : '' ) . '>' ;
echo '<label for="moje_ankete1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
// zamakni
2022-05-02 08:56:58 +02:00
/* echo '<div class="setting_holder">' ;
2021-12-01 00:15:39 +01:00
echo '<span class="setting_title">' . $lang [ 'a_show' ] . '</span>' ;
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
if ( $row [ 'flat' ] == 0 )
2021-12-01 00:15:39 +01:00
echo '<span title="' . $lang [ 'srv_flat_0' ] . '"><a href="index.php?anketa=' . $this -> anketa . '&a=branching&change_mode=1&what=flat&value=1">' . $lang [ 'srv_flat_0_short' ] . '</a></span> ' ;
2020-08-14 13:36:36 +02:00
else
2021-12-01 00:15:39 +01:00
echo '<span title="' . $lang [ 'srv_flat_1' ] . '"><a href="index.php?anketa=' . $this -> anketa . '&a=branching&change_mode=1&what=flat&value=0">' . $lang [ 'srv_flat_0_short' ] . '</a></span> ' ;
2020-08-14 13:36:36 +02:00
echo Help :: display ( 'srv_branching_flat' );
2021-12-01 00:15:39 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-01 00:15:39 +01:00
// odpri
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
if ( $row [ 'popup' ] == 1 )
2021-12-01 00:15:39 +01:00
echo '<span class="spaceLeft" title="' . $lang [ 'srv_popup_1' ] . '"><a href="index.php?anketa=' . $this -> anketa . '&a=branching&change_mode=1&what=popup&value=0">' . $lang [ 'srv_popup_1_short' ] . '</a></span> ' ;
2020-08-14 13:36:36 +02:00
else
2021-12-01 00:15:39 +01:00
echo '<span class="spaceLeft" title="' . $lang [ 'srv_popup_0' ] . '"><a href="index.php?anketa=' . $this -> anketa . '&a=branching&change_mode=1&what=popup&value=1">' . $lang [ 'srv_popup_1_short' ] . '</a></span> ' ;
2020-08-14 13:36:36 +02:00
echo Help :: display ( 'srv_branching_popup' );
2021-12-01 00:15:39 +01:00
echo '</div>' ;
2022-05-02 08:56:58 +02:00
echo '</div>' ; */
2021-12-01 00:15:39 +01:00
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
?>
< script >
check_library ();
</ script >
< ?
/* STEVILCENJE */
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_nastavitveStevilcenje' ] . '</legend>' ;
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title"><label for="anketa_countType">' . $lang [ 'srv_nastavitveStevilcenjeType' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="countType" value="0" id="countType_0" checked="checked" onclick="saveGlobalSetting(\'countType\')"/>' ;
echo '<label for="countType_0">' . $lang [ 'srv_nastavitveStevilcenjeType0' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="countType" value="1" id="countType_1" ' . ( $row [ 'countType' ] == 1 ? ' checked="checked"' : '' ) . ' onclick="saveGlobalSetting(\'countType\')"/>' ;
echo '<label for="countType_1">' . $lang [ 'srv_nastavitveStevilcenjeType1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="countType" value="2" id="countType_2" ' . ( $row [ 'countType' ] == 2 ? ' checked="checked"' : '' ) . ' onclick="saveGlobalSetting(\'countType\')"/>' ;
echo '<label for="countType_2">' . $lang [ 'srv_nastavitveStevilcenjeType2' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="countType" value="3" id="countType_3" ' . ( $row [ 'countType' ] == 3 ? ' checked="checked"' : '' ) . ' onclick="saveGlobalSetting(\'countType\')"/>' ;
echo '<label for="countType_3">' . $lang [ 'srv_nastavitveStevilcenjeType3' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Izklop prestevilcevanja
$enumerate = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'enumerate' ); if ( $enumerate == '' ) $enumerate = 1 ;
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title"><label for="anketa_enumerate">' . $lang [ 'srv_nastavitvePrestevilcevanje' ] . ':</label></span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="enumerate" id="enumerate_1" ' . ( $enumerate == 1 ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="enumerate_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="enumerate" id="enumerate_0" ' . ( $enumerate == 0 ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="enumerate_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
/* JS TRACKING */
if ( $admin_type == 0 || $admin_type == 1 ) {
echo '<fieldset><legend>' . $lang [ 'srv_js_tracking' ] . '</legend>' ;
2021-11-23 13:36:49 +01:00
echo '<div class="setting_holder">' ;
echo '<textarea name="js_tracking">' . $row [ 'js_tracking' ] . '</textarea>' ;
echo '<p>' . $lang [ 'js_tracking_note' ] . '</p>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
}
/* PISKOTEK */
if ( $_GET [ 'a' ] == A_PRIKAZ ) {
2021-03-24 08:26:23 +01:00
2020-08-14 13:36:36 +02:00
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_data_valid_units_settings' ] . '</legend>' ;
2021-03-24 08:26:23 +01:00
2021-11-25 13:05:41 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_prikaz_default_valid' ] . '</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="defValidProfile2" name="defValidProfile" ' . ( $row [ 'defValidProfile' ] == 2 ? ' checked' : '' ) . ' value="2">' ;
echo '<label for="defValidProfile2">' . '(5,6) ' . $lang [ 'srv_data_valid_units' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="defValidProfile3" name="defValidProfile" ' . ( $row [ 'defValidProfile' ] == 3 ? ' checked' : '' ) . ' value="3">' ;
echo '<label for="defValidProfile3">' . '(6) ' . $lang [ 'srv_data_finished_units' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-03-24 08:26:23 +01:00
// Pri volitvah ne moremo prikazati datuma respondenta
if ( ! SurveyInfo :: getInstance () -> checkSurveyModule ( 'voting' )){
2021-11-25 13:05:41 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_prikaz_showItime' ] . '</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="showItime0" name="showItime" ' . (( int ) $row [ 'showItime' ] == 0 ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="showItime0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="showItime1" name="showItime" ' . (( int ) $row [ 'showItime' ] == 1 ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="showItime1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-03-24 08:26:23 +01:00
}
2021-11-25 13:05:41 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_prikaz_showLineNumber' ] . '</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="showLineNumber0" name="showLineNumber" ' . (( int ) $row [ 'showLineNumber' ] == 0 ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="showLineNumber0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="showLineNumber1" name="showLineNumber" ' . (( int ) $row [ 'showLineNumber' ] == 1 ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="showLineNumber1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-03-24 08:26:23 +01:00
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2021-11-29 11:17:40 +01:00
echo '<form>' ;
2020-08-14 13:36:36 +02:00
}
/*Piskotek*/
if ( $_GET [ 'a' ] == 'piskot' ) {
2021-04-09 08:43:03 +02:00
// Pri volitvah ne moremo popravljati nastavitev piskotka
if ( SurveyInfo :: getInstance () -> checkSurveyModule ( 'voting' )){
2021-12-01 14:41:19 +01:00
echo '<fieldset>' ;
2021-04-09 08:43:03 +02:00
echo '<legend>' . $lang [ 'srv_cookie' ] . '</legend>' ;
2021-12-01 14:41:19 +01:00
echo '<span class="red">' . $lang [ 'srv_voting_no_cookie' ] . '</span>' ;
2021-04-09 08:43:03 +02:00
echo '</fieldset>' ;
echo '</form>' ;
return ;
}
2021-12-01 14:41:19 +01:00
echo '<fieldset>' ;
2021-04-09 08:43:03 +02:00
2022-01-03 11:34:02 +01:00
echo '<div class="divPopUp_info warning_popup" id="cookie_alert">' ;
echo '<h2>' . $lang [ 'srv_cookie_alert_title' ] . '</h2>' ;
echo '<p>' . $lang [ 'srv_cookie_alert_1' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_cookie_alert_2' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_cookie_alert' ] . '</p>' ;
2021-04-09 08:43:03 +02:00
echo '</div>' ;
echo '<legend>' . $lang [ 'srv_cookie' ] . '</legend>' ;
// Shrani piskotek za X casa
2021-12-01 14:41:19 +01:00
2021-12-16 11:23:23 +01:00
echo '<div id="cookie_osnovno" class="setting_holder bottom8">' ;
2021-12-01 14:41:19 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_cookie' ] . Help :: display ( 'srv_cookie' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie" value="-1" id="cookie_-1"' . ( $row [ 'cookie' ] == - 1 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_-1">' . $lang [ 'srv_cookie_-1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie" value="0" id="cookie_0"' . ( $row [ 'cookie' ] == 0 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_0">' . $lang [ 'srv_cookie_0' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie" value="1" id="cookie_1"' . ( $row [ 'cookie' ] == 1 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_1">' . $lang [ 'srv_cookie_1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie" value="2" id="cookie_2"' . ( $row [ 'cookie' ] == 2 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_2">' . $lang [ 'srv_cookie_2' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-12-15 23:56:32 +01:00
2021-04-09 08:43:03 +02:00
2021-12-15 23:56:32 +01:00
echo '<div id="cookie_settings_wrap">' ;
2021-04-09 08:43:03 +02:00
// Ko se uporabnik vrne (zacne od zacetka/nadaljuje kjer je ostal)
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder indent">' ;
echo '<span class="setting_title">' . $lang [ 'srv_cookie_return' ] . Help :: display ( 'srv_cookie_return' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie_return" value="0" id="cookie_return_0"' . ( $row [ 'cookie_return' ] == 0 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_return_0">' . $lang [ 'srv_cookie_return_start' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item no-cookie">' ;
echo '<input type="radio" name="cookie_return" value="1" id="cookie_return_1"' . ( $row [ 'cookie_return' ] == 1 ? ' checked="checked"' : '' ) . ' onclick="checkcookie();" />' ;
echo '<label for="cookie_return_1">' . $lang [ 'srv_cookie_return_middle' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-04-09 08:43:03 +02:00
// Ce je zakljucil lahko naknadno ureja svoje odgovore
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder indent no-cookie no-cookie-return">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_return_finished' ] . Help :: display ( 'srv_return_finished' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="return_finished" value="1" id="return_finished_1"' . ( $row [ 'return_finished' ] == 1 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="return_finished_1">' . $lang [ 'srv_return_finished_yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="return_finished" value="0" id="return_finished_0"' . ( $row [ 'return_finished' ] == 0 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="return_finished_0">' . $lang [ 'srv_return_finished_no' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-12-15 23:56:32 +01:00
// Ce ni sprejel piskotka lahko/ne more nadaljevati
echo '<div class="setting_holder bottom16 indent no-cookie">' ;
echo '<span class="setting title">' . $lang [ 'srv_cookie_continue' ] . Help :: display ( 'srv_cookie_continue' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie_continue" value="1" id="cookie_continue_1"' . ( $row [ 'cookie_continue' ] == 1 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="cookie_continue_1">' . $lang [ 'srv_cookie_continue_yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="cookie_continue" value="0" id="cookie_continue_0"' . ( $row [ 'cookie_continue' ] == 0 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="cookie_continue_0">' . $lang [ 'srv_cookie_continue_no' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
2021-12-01 14:41:19 +01:00
// Nikoli ne more popravljati svojih odgovorov (tudi ce se npr. vrne na prejsnjo stran)
2021-12-15 23:56:32 +01:00
echo '<div class="setting_holder">' ;
2021-12-01 14:41:19 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_subsequent_answers' ] . Help :: display ( 'srv_subsequent_answers' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="subsequent_answers" value="1" id="subsequent_answers_1"' . ( $row [ 'subsequent_answers' ] == 1 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="subsequent_answers_1">' . $lang [ 'srv_subsequent_answers_yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="subsequent_answers" value="0" id="subsequent_answers_0"' . ( $row [ 'subsequent_answers' ] == 0 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="subsequent_answers_0">' . $lang [ 'srv_subsequent_answers_no' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-04-09 08:43:03 +02:00
// Prepoznaj respondenta
2021-12-15 23:56:32 +01:00
echo '<div class="setting_holder" id="prepoznaj_respondenta">' ;
2021-12-01 14:41:19 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_user' ] . Help :: display ( 'srv_user_from_cms' ) . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="user_from_cms" value="1" id="user_1"' . ( $row [ 'user_from_cms' ] == 1 ? ' checked="checked"' : '' ) . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />' ;
echo '<label for="user_1">' . $lang [ 'srv_respondent' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="user_from_cms" value="2" id="user_2"' . ( $row [ 'user_from_cms' ] == 2 ? ' checked="checked"' : '' ) . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />' ;
echo '<label for="user_2">' . $lang [ 'srv_vnasalec' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="user_from_cms" value="0" id="user_0"' . ( $row [ 'user_from_cms' ] == 0 ? ' checked="checked"' : '' ) . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').attr(\'disabled\', true); _user_from_cms(); " />' ;
echo '<label for="user_0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-04-09 08:43:03 +02:00
// Ob izpolnjevanju prikazi email
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder" id="cms_email">' ;
2021-12-15 23:56:32 +01:00
echo '<span class="setting title">' . $lang [ 'srv_user_cms_show' ] . ':</span>' ;
2021-12-01 14:41:19 +01:00
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="user_from_cms_email" value="1" id="user_1_email"' . ( $row [ 'user_from_cms_email' ] == 1 ? ' checked="checked"' : '' ) . ' ' . ( $row [ 'user_from_cms' ] > 0 ? '' : ' disabled="true" ' ) . '/>' ;
echo '<label for="user_1_email">' . $lang [ 'srv_user_cms_email' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// Masovno vnasanje - modul Vnos
2021-12-01 14:41:19 +01:00
echo '<fieldset id="vnos_modul"><legend>' . $lang [ 'srv_vrsta_survey_type_5' ] . '</legend>' ;
2020-08-14 13:36:36 +02:00
2021-12-15 23:56:32 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vnos_navodila' ] . '</p>' ;
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder">' ;
2021-12-15 23:56:32 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_mass_input' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
2021-12-01 14:41:19 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="mass_insert" value="1" id="mass_insert_1"' . ( $row [ 'mass_insert' ] == 1 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="mass_insert_1">' . $lang [ 'srv_mass_input_1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="mass_insert" value="0" id="mass_insert_0"' . ( $row [ 'mass_insert' ] == 0 ? ' checked="checked"' : '' ) . ' />' ;
echo '<label for="mass_insert_0">' . $lang [ 'srv_mass_input_0' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// For modul maza, show all cookie settings
$isMaza = ( SurveyInfo :: checkSurveyModule ( 'maza' )) ? 1 : 0 ;
2021-04-09 08:43:03 +02:00
?> <script>
2020-08-14 13:36:36 +02:00
2021-04-09 08:43:03 +02:00
function checkcookie () {
2020-08-14 13:36:36 +02:00
2021-12-23 14:37:41 +01:00
if ( $ ( 'input[name=cookie]:checked' ) . val () == '-1' && $ ( 'input[name=user_from_cms]:checked' ) . val () == '0' && < ? echo $row [ 'user_base' ]; ?> != 1 && <?echo $isMaza;?> != 1) {
2021-12-15 23:56:32 +01:00
$ ( '#cookie_settings_wrap' ) . addClass ( 'displayNone' );
2021-12-16 11:23:23 +01:00
$ ( '#cookie_osnovno' ) . removeClass ( 'bottom8' );
2021-12-15 23:56:32 +01:00
}
else {
$ ( '#cookie_settings_wrap' ) . removeClass ( 'displayNone' );
2021-12-16 11:23:23 +01:00
$ ( '#cookie_osnovno' ) . addClass ( 'bottom8' );
2021-04-09 08:43:03 +02:00
}
if ( $ ( 'input[name=cookie_return]:checked' ) . val () == 1 ) {
2021-12-15 23:56:32 +01:00
$ ( '.no-cookie-return' ) . addClass ( 'displayNone' );
2021-04-09 08:43:03 +02:00
}
2020-08-14 13:36:36 +02:00
else {
2021-12-15 23:56:32 +01:00
$ ( '.no-cookie-return' ) . removeClass ( 'displayNone' );
2021-04-09 08:43:03 +02:00
}
if ( $ ( 'input[name=user_from_cms]:checked' ) . val () == 0 ) {
2021-12-15 23:56:32 +01:00
$ ( '#cms_email' ) . addClass ( 'displayNone' );
$ ( '#prepoznaj_respondenta' ) . addClass ( 'bottom0' );
2021-04-09 08:43:03 +02:00
}
2020-08-14 13:36:36 +02:00
else {
2021-12-15 23:56:32 +01:00
$ ( '#cms_email' ) . removeClass ( 'displayNone' );
$ ( '#prepoznaj_respondenta' ) . removeClass ( 'bottom0' );
2020-08-14 13:36:36 +02:00
}
if ( $ ( 'input[name=user_from_cms]:checked' ) . val () == 2 ) {
2021-12-15 23:56:32 +01:00
$ ( '#vnos_modul' ) . removeClass ( 'displayNone' );
2021-04-09 08:43:03 +02:00
}
2020-08-14 13:36:36 +02:00
else {
2021-12-15 23:56:32 +01:00
$ ( '#vnos_modul' ) . addClass ( 'displayNone' );
2021-04-09 08:43:03 +02:00
}
}
2020-08-14 13:36:36 +02:00
2021-04-09 08:43:03 +02:00
checkcookie ();
cookie_alert ();
2020-08-14 13:36:36 +02:00
</ script > < ?
2021-04-09 08:43:03 +02:00
$stringDostopAvtor = " SELECT count(*) as isAvtor FROM srv_dostop WHERE ank_id = ' " . $this -> anketa . " ' AND (uid=' " . $global_user_id . " ' OR uid IN (SELECT user FROM srv_dostop_manage WHERE manager=' $global_user_id ' )) " ;
$sqlDostopAvtor = sisplet_query ( $stringDostopAvtor );
$rowDostopAvtor = mysqli_fetch_assoc ( $sqlDostopAvtor );
$avtorRow = SurveyInfo :: getInstance () -> getSurveyRow ();
2020-08-14 13:36:36 +02:00
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'access' ] . '</legend>' ;
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" ><label for="odgovarja">' . $lang [ 'srv_izpolnjujejo' ] . Help :: display ( 'srv_izpolnjujejo' ) . ': </label></span>' ;
echo '<select name="odgovarja" id="odgovarja" onchange="javascript:_odgovarja();" class="dropdown large">' ;
echo '<option value="4"' . ( $row [ 'odgovarja' ] == 4 ? ' selected="selected"' : '' ) . '>' . $lang [ 'forum_hour_all' ] . '</option>' ;
echo '<option value="3"' . ( $row [ 'odgovarja' ] == 3 ? ' selected="selected"' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2"' . ( $row [ 'odgovarja' ] == 2 ? ' selected="selected"' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1"' . ( $row [ 'odgovarja' ] == 1 ? ' selected="selected"' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0"' . ( $row [ 'odgovarja' ] == 0 ? ' selected="selected"' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '<script language="javascript">' . " \n " ;
echo ' function _user_from_cms() {' . " \n " ;
echo ' document.settingsanketa_' . $row [ 'id' ] . '.odgovarja.value = \'4\'' . " \n " ;
echo ' }' . " \n " ;
echo ' function _odgovarja() {' . " \n " ;
echo ' if (document.settingsanketa_' . $row [ 'id' ] . '.odgovarja.value != \'4\' && document.settingsanketa_' . $row [ 'id' ] . '.user_from_cms[2].checked == true) {' . " \n " ;
echo ' document.settingsanketa_' . $row [ 'id' ] . '.user_from_cms[0].checked = true;' . " \n " ;
echo ' }' . " \n " ;
echo '}' . " \n " ;
echo '</script>' . " \n " ;
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_block_ip' ] . Help :: display ( 'srv_block_ip' ) . ':</span>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="0" id="block_ip_0"' . ( $row [ 'block_ip' ] == 0 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').addClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="10" id="block_ip_10"' . ( $row [ 'block_ip' ] == 10 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_10">10 min</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="20" id="block_ip_20"' . ( $row [ 'block_ip' ] == 20 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_20">20 min</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="60" id="block_ip_60"' . ( $row [ 'block_ip' ] == 60 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_60">60 min</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="720" id="block_ip_720"' . ( $row [ 'block_ip' ] == 720 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_720">12 ' . $lang [ 'hour_hours2' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-15 23:56:32 +01:00
echo '<input type="radio" name="block_ip" value="1440" id="block_ip_1440"' . ( $row [ 'block_ip' ] == 1440 ? ' checked="checked"' : '' ) . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />' ;
2021-12-01 14:41:19 +01:00
echo '<label for="block_ip_1440">24 ' . $lang [ 'hour_hours2' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-15 23:56:32 +01:00
echo '<p id="block_ip_warning" class="top16 red ' . ( $row [ 'block_ip' ] == 0 ? ' displayNone' : '' ) . '">' . $lang [ 'srv_block_ip_warning' ] . '</p>' ;
2021-12-01 14:41:19 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
global $global_user_id ;
$userAccess = UserAccess :: getInstance ( $global_user_id );
2021-04-09 08:43:03 +02:00
// dodajanje gesel za anketo
echo '<fieldset><legend>' . $lang [ 'srv_password' ] . ' ' . Help :: display ( 'srv_dostop_password' ) . '</legend>' ;
2020-08-14 13:36:36 +02:00
if ( ! $userAccess -> checkUserAccess ( $what = 'password' )){
$userAccess -> displayNoAccess ( $what = 'password' );
}
else {
2021-12-01 14:41:19 +01:00
echo '<div class="setting_holder" id="password">' ;
2020-08-14 13:36:36 +02:00
$ss = new SurveySkupine ( $this -> anketa );
$spr_id = $ss -> hasSkupine ( 2 );
echo '<input type="hidden" id="skupine_spr_id" value="' . $spr_id . '"></input>' ;
// Preprecimo submit na enter
echo '<script>' ;
?>
$ ( 'form[name=settingsanketa_' +< ? echo $this -> anketa ; ?> +']').on('keyup keypress', function(e) {
var keyCode = e . keyCode || e . which ;
if ( keyCode === 13 ) {
e . preventDefault ();
return false ;
}
});
< ?
echo '</script>' ;
// dodajanje gesel za anketo
2021-12-01 14:41:19 +01:00
2021-12-16 11:23:23 +01:00
echo '<div class="setting_holder bottom0">' ;
echo '<div class="button_holder inline bottom16">' ;
2021-12-01 14:41:19 +01:00
echo '<input type="text" class="large" name="skupina" autocomplete="off" onKeyUp="add_skupina_enter(\'2\', event);" />' ;
2021-12-21 10:55:25 +01:00
echo '<button type="button" class="medium blue" onclick="add_skupina(\'2\');">' . $lang [ 'add' ] . '</button>' ;
2021-12-15 23:56:32 +01:00
echo '</div>' ;
2021-12-01 14:41:19 +01:00
echo '</div>' ;
2021-12-17 11:55:40 +01:00
echo '<div>' ;
2021-12-15 23:56:32 +01:00
echo '<table id="passwords_table" ' . (( $spr_id == 0 ) ? 'class="displayNone"' : '' ) . '>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'password' ] . '</th>' ;
2021-12-22 17:10:30 +01:00
echo '<th></th>' ;
2021-12-15 23:56:32 +01:00
echo '</tr>' ;
if ( $spr_id > 0 ){
$vrednosti = $ss -> getVrednosti ( $spr_id );
if ( $vrednosti != 0 ){
foreach ( $vrednosti as $vrednost ){
echo '<tr>' ;
echo '<td>' . $vrednost [ 'naslov' ] . '</td>' ;
2021-12-24 00:51:42 +01:00
echo '<td class="right"><button class="table-inline blue caps" type="button" onclick="delete_skupina(\'2\', \'' . $vrednost [ 'id' ] . '\');">' . $lang [ 'srv_password_remove' ] . '</button></td>' ;
2021-12-15 23:56:32 +01:00
echo '</tr>' ;
}
}
}
2021-12-01 14:41:19 +01:00
2021-12-15 23:56:32 +01:00
echo '</table>' ;
2021-12-17 11:55:40 +01:00
echo '</div>' ;
2021-12-15 23:56:32 +01:00
echo '<div class="setting_holder">' ;
echo '<a class="noline" href="#" onClick="display_add_passwords_mass();"><span class="faicon clipboard empty link-right"></span>' . $lang [ 'srv_password_add_mass' ] . '</a>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
echo '</fieldset>' ;
}
/*Trajanje*/
if ( $_GET [ 'a' ] == 'trajanje' ) {
echo '<div >' ;
echo '<input type="hidden" value="' . $this -> anketa . '" name="anketa" >' ;
$this -> DisplayNastavitveTrajanje ();
$this -> DisplayNastavitveMaxGlasov ();
echo '</form>' ;
echo '<br/>' ;
if ( isset ( $_GET [ 'f' ])) {
switch ( $_GET [ 'f' ]) {
case 'vabila_settings' :
$url = $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=vabila&m=settings' ;
break ;
}
if ( isset ( $url )) {
echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_gray" href="' . $url . '"><span>' . $lang [ 'back' ] . '</span></a></span>' ;
}
}
2021-11-30 01:27:23 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="submitSurveyDuration();return false;" href="#">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
/*Respondenti*/
if ( $_GET [ 'a' ] == 'resp' ) {
$this -> respondenti_iz_baze ( $row );
}
/*Komentarji*/
if ( $_GET [ 'a' ] == 'urejanje' ) {
// tukaj bom dodal še kontrolo na Avtorja ankete, tako da avtor lahko vedno spreminja urejanje (gorazd,1.9.2009)
$stringDostopAvtor = " SELECT count(*) as isAvtor FROM srv_dostop WHERE ank_id = ' " . $this -> anketa . " ' AND uid=' " . $global_user_id . " ' " ;
$sqlDostopAvtor = sisplet_query ( $stringDostopAvtor );
$rowDostopAvtor = mysqli_fetch_assoc ( $sqlDostopAvtor );
if ( $admin_type == 0 || $rowDostopAvtor [ 'isAvtor' ]) {
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$survey_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment' );
$survey_comment_showalways = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_showalways' );
$question_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment' );
$survey_comment_viewadminonly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_viewadminonly' );
$survey_comment_viewauthor = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_viewauthor' );
$question_comment_viewadminonly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment_viewadminonly' );
$question_comment_viewauthor = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment_viewauthor' );
$question_resp_comment_viewadminonly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment_viewadminonly' );
$question_resp_comment_inicialke = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment_inicialke' );
$question_resp_comment_inicialke_alert = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment_inicialke_alert' );
$question_resp_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment' );
$srv_qct = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment_text' );
$question_note_view = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_note_view' );
$question_note_write = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_note_write' );
$question_resp_comment_show_open = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment_show_open' );
$survey_comment_resp = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_resp' );
$survey_comment_showalways_resp = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_showalways_resp' );
$survey_comment_viewadminonly_resp = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_viewadminonly_resp' );
$survey_comment_viewauthor_resp = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_viewauthor_resp' );
$sortpostorder = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'sortpostorder' );
$addfieldposition = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'addfieldposition' );
$commentmarks = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'commentmarks' );
$commentmarks_who = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'commentmarks_who' );
$comment_history = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'comment_history' );
$srvlang_srv_question_respondent_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'srvlang_' . 'srv_question_respondent_comment' . '' );
if ( $srvlang_srv_question_respondent_comment == '' ) $srvlang_srv_question_respondent_comment = $lang [ 'srv_question_respondent_comment' ];
$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_hide_survey_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'preview_hide_survey_comment' );
$preview_survey_comment_showalways = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'preview_survey_comment_showalways' );
$preview_disable_test_insert = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'preview_disable_test_insert' );
if ( isset ( $_GET [ 'show' ]) && $_GET [ 'show' ] == 'on_alert' ) {
echo '<div class="comments_on_alert google_yellow">' . $lang [ 'srv_comments_on_alert' ] . ' <a href="ajax.php?anketa=' . $this -> anketa . '&a=comments_onoff&do=off">' . $lang [ 'srv_off' ] . '.</a> ' . $lang [ 'srv_comments_on_alert2' ] . ' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/testiranje/komentarji/?from1ka=1" target="_blank">' . $lang [ 'srv_anl_more' ] . '</a></div>' ;
}
$css_width = '' ;
if ( $survey_comment != " " ) {
$css_width = 'min-height:250px;width:45% !important;' ;
$css_width2 = 'width:45% !important;' ;
}
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments"><legend>' . $lang [ 'comments' ] . '</legend>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '<p class="semi-bold caps bottom16">' . $lang [ 'srv_admin_s_comments_editor' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="comments_default" id="comments_admin1" onclick="comments_admin_toggle(\'1\')" admin_on="false" /><label class="semi-bold" for="comments_admin1"> ' . $lang [ 'srv_comments_admin_on1' ] . '</label>' ;
echo '<p class="indent">(' . $lang [ 'srv_comments_admin_note1' ] . ')</p>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="comments_default" id="comments_admin2" onclick="comments_admin_toggle(\'2\')" admin_on="false" /><label class="semi-bold" for="comments_admin2"> ' . $lang [ 'srv_comments_admin_on2' ] . '</label>' ;
echo '<p class="indent">(' . $lang [ 'srv_comments_admin_note2' ] . ')</p>' ;
echo '</div>' ;
echo '<p class="semi-bold caps bottom16">' . $lang [ 'srv_admin_s_comments_resp' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="comments_resp2" id="comments_resp2" onclick="comments_resp_toggle(\'2\')" resp_on="false" /><label class="semi-bold" for="comments_resp2"> ' . $lang [ 'srv_comments_resp_on2' ] . '</label>' ;
echo '<p class="indent">(' . $lang [ 'srv_comments_resp_note2' ] . ')</p>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="comments_default" id="comments_resp" onclick="comments_resp_toggle(\'1\')" resp_on="false" /><label class="semi-bold" for="comments_resp"> ' . $lang [ 'srv_comments_resp_on' ] . '</label>' ;
echo '<p class="indent">(' . $lang [ 'srv_comments_resp_note' ] . ')</p>' ;
echo '</div>' ;
echo '<p class="semi-bold caps top16 bottom16">' . $lang [ 'srv_admin_s_comments_links' ] . '</p>' ;
echo '<div class="links">' ;
2020-08-14 13:36:36 +02:00
$d = new Dostop ();
2022-03-31 00:26:08 +02:00
echo '<div class="button" title="' . $lang [ 'srv_view_comment' ] . '" onClick="window.location.href=\'index.php?anketa=' . $this -> anketa . '&a=komentarji\';">' ;
echo '<span class="faicon comments_num blue"></span>' ;
echo $lang [ 'srv_admin_s_comments_view' ];
echo '</div>' ;
2021-05-25 09:37:42 +02:00
2022-05-03 09:22:14 +02:00
echo '<div class="button" id="more_comments" onclick="$(\'#komentarji_napredno\').fadeToggle(); $(\'#komentarji_napredno_arrow\').toggleClass(\'plus minus\'); $(this).toggleClass(\'border_blue\'); return false;">' ;
echo '<span id="komentarji_napredno_arrow" class="faicon blue ' . ( $_GET [ 'advanced_expanded' ] == 1 ? 'minus' : 'plus' ) . '"></span>' ;
2022-03-31 00:26:08 +02:00
echo $lang [ 'srv_admin_s_comments_set' ];
echo '</div>' ;
2021-05-25 09:37:42 +02:00
2022-03-31 00:26:08 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
?>
< script >
$ ( function () {
if ( check_comments_admin ( 1 ) ) {
$ ( '#comments_admin1' ) . attr ( 'admin_on' , 'true' );
$ ( '#comments_admin1' ) . attr ( 'checked' , true );
} else {
$ ( '#comments_admin1' ) . attr ( 'admin_on' , 'false' );
$ ( '#comments_admin1' ) . attr ( 'checked' , false );
}
if ( check_comments_admin ( 2 ) ) {
$ ( '#comments_admin2' ) . attr ( 'admin_on' , 'true' );
$ ( '#comments_admin2' ) . attr ( 'checked' , true );
} else {
$ ( '#comments_admin2' ) . attr ( 'admin_on' , 'false' );
$ ( '#comments_admin2' ) . attr ( 'checked' , false );
}
if ( check_comments_resp ( 1 ) ) {
$ ( '#comments_resp' ) . attr ( 'resp_on' , 'true' );
$ ( '#comments_resp' ) . attr ( 'checked' , true );
} else {
$ ( '#comments_resp' ) . attr ( 'resp_on' , 'false' );
$ ( '#comments_resp' ) . attr ( 'checked' , false );
}
if ( check_comments_resp ( 2 ) ) {
$ ( '#comments_resp2' ) . attr ( 'resp_on' , 'true' );
$ ( '#comments_resp2' ) . attr ( 'checked' , true );
} else {
$ ( '#comments_resp2' ) . attr ( 'resp_on' , 'false' );
$ ( '#comments_resp2' ) . attr ( 'checked' , false );
}
if ( ( ! check_comments_admin () && ! check_comments_admin_off () ) || ( ! check_comments_resp () && ! check_comments_resp_off () ) ) {
$ ( '#komentarji_napredno' ) . show ();
2022-05-03 09:22:14 +02:00
$ ( '#komentarji_napredno_arrow' ) . addClass ( 'minus' );
$ ( '#komentarji_napredno_arrow' ) . removeClass ( 'plus' );
$ ( '#more_comments' ) . removeClass ( 'border_blue' );
2020-08-14 13:36:36 +02:00
}
});
</ script >
< ?
if ( $survey_comment != " " ) {
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments" ><legend>' . $lang [ 'srv_admin_s_comments' ] . '</legend>' ;
echo '<textarea name="comment_send"></textarea>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="srv_c_alert" name="srv_c_alert" checked value="1" />' ;
echo '<label for="srv_c_alert"> ' . $lang [ 'srv_c_alert' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="srv_c_to_mail" name="srv_c_to_mail" value="1" onchange="$(\'#prejemniki\').toggle();" />' ;
echo '<label for="srv_c_to_mail"> ' . $lang [ 'srv_c_to_mail' ] . '</label>' ;
echo '<div id="prejemniki" style="display:none">' ;
2020-08-14 13:36:36 +02:00
$sqlp = sisplet_query ( " SELECT u.name, u.surname, u.email FROM srv_dostop d, users u WHERE d.uid=u.id AND ank_id=' $this->anketa ' " );
while ( $rowp = mysqli_fetch_array ( $sqlp )) {
2022-03-31 00:26:08 +02:00
echo '<div class="setting_item indent">' ;
echo '<input type="checkbox" name="mails[]" value="' . $rowp [ 'email' ] . '" checked="checked" id="' . $rowp [ 'email' ] . '" />' ;
echo '<label for="' . $rowp [ 'email' ] . '"> ' . $rowp [ 'name' ] . ' ' . $rowp [ 'surname' ] . ' (' . $rowp [ 'email' ] . ')</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
2022-03-31 00:26:08 +02:00
//Komentarji - napredne nastavitve
echo '<div id="komentarji_napredno" ' . ( $_GET [ 'advanced_expanded' ] == 1 ? '' : 'style="display:none"' ) . '>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments"><legend>' . $lang [ 'srv_preview_defaults' ] . '</legend>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_disableif" value=""><input type="checkbox" value="1" ' . ( $preview_disableif == 1 ? ' checked' : '' ) . ' name="preview_disableif" id="disableif">' ;
echo '<label for="disableif">' . $lang [ 'srv_disableif' ] . '</label>' ;
echo '</div>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_disablealert" value=""><input type="checkbox" value="1" ' . ( $preview_disablealert == 1 ? ' checked' : '' ) . ' name="preview_disablealert" id="disablealert">' ;
echo '<label for="disablealert">' . $lang [ 'srv_disablealert' ] . '</label>' ;
echo '</div>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_displayifs" value=""><input type="checkbox" value="1" ' . ( $preview_displayifs == 1 ? ' checked' : '' ) . ' name="preview_displayifs" id="displayifs">' ;
echo '<label for="displayifs">' . $lang [ 'srv_displayifs' ] . '</label>' ;
echo '</div>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_displayvariables" value=""><input type="checkbox" value="1" ' . ( $preview_displayvariables == 1 ? ' checked' : '' ) . ' name="preview_displayvariables" id="displayvariables">' ;
echo '<label for="displayvariables">' . $lang [ 'srv_displayvariables' ] . '</label>' ;
echo '</div>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_hidecomment" value=""><input type="checkbox" value="1" ' . ( $preview_hidecomment == 1 ? ' checked' : '' ) . ' name="preview_hidecomment" id="hidecomment">' ;
echo '<label for="hidecomment">' . $lang [ 'srv_preview_comments2' ] . '</label>' ;
echo '</div>' ;
2022-03-31 21:37:13 +02:00
echo '<div class="setting_holder">' ;
2022-03-31 00:26:08 +02:00
echo '<input type="hidden" name="preview_hide_survey_comment" value=""><input type="checkbox" value="1" ' . ( $preview_hide_survey_comment == 1 ? ' checked' : '' ) . ' name="preview_hide_survey_comment" id="hidesurveycomment">' ;
echo '<label for="hidesurveycomment">' . $lang [ 'srv_preview_hide_survey_comment' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_preview_survey_comment_showalways' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="preview_survey_comment_showalways" value="0" id="preview_survey_comment_showalways_0" ' . ( $preview_survey_comment_showalways == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="preview_survey_comment_showalways_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="preview_survey_comment_showalways" value="1" id="preview_survey_comment_showalways_1" ' . ( $preview_survey_comment_showalways == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="preview_survey_comment_showalways_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_preview_disable_test_insert' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="preview_disable_test_insert" value="1" id="preview_disable_test_insert_1" ' . ( $preview_disable_test_insert == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="preview_disable_test_insert_1">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="preview_disable_test_insert" value="0" id="preview_disable_test_insert_0" ' . ( $preview_disable_test_insert == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="preview_disable_test_insert_0">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments"><legend>' . $lang [ 'srv_admin_s_comments' ] . '<span>' . $lang [ 'srv_admin_s_comments_txt' ] . '</span></legend>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_write' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="survey_comment">' ;
2020-08-14 13:36:36 +02:00
echo '<option value=""' . ( $survey_comment == '' ? ' selected' : '' ) . '>' . $lang [ 'srv_nihce' ] . '</option>' ;
//echo '<option value="4"'.($survey_comment==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" ' . ( $survey_comment == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $survey_comment == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $survey_comment == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $survey_comment == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_view' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="survey_comment_viewadminonly">' ;
2020-08-14 13:36:36 +02:00
//echo '<option value="4"'.($survey_comment_viewadminonly==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" ' . ( $survey_comment_viewadminonly == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $survey_comment_viewadminonly == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $survey_comment_viewadminonly == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $survey_comment_viewadminonly == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select> ' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="hidden" name="survey_comment_viewauthor" value=""><input type="checkbox" id="survey_comment_viewauthor" name="survey_comment_viewauthor" value="1" ' . ( $survey_comment_viewauthor == 1 ? ' checked' : '' ) . ' />' ;
echo '<label for="survey_comment_viewauthor">' . $lang [ 'srv_comments_viewauthor' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_survey_comment_show' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_comment_showalways" value="0" id="survey_comment_showalways_0" ' . ( $survey_comment_showalways == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="survey_comment_showalways_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_comment_showalways" value="1" id="survey_comment_showalways_1" ' . ( $survey_comment_showalways == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="survey_comment_showalways_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments">' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_admin_q_notes' ] . '<span>' . $lang [ 'srv_admin_q_notes_txt' ] . '</span></legend>' ;
2022-03-31 00:26:08 +02:00
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_q_note_view' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="question_note_view">' ;
2020-08-14 13:36:36 +02:00
echo '<option value=""' . ( $question_note_view == '' ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $question_note_view == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $question_note_view == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $question_note_view == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $question_note_view == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_q_note_write' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="question_note_write">' ;
2020-08-14 13:36:36 +02:00
echo '<option value=""' . ( $question_note_write == '' ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $question_note_write == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $question_note_write == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $question_note_write == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $question_note_write == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
2022-03-31 00:26:08 +02:00
echo '</select>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments">' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_admin_q_comments' ] . '<span>' . $lang [ 'srv_admin_q_comments_txt' ] . '</span></legend>' ;
2022-03-31 00:26:08 +02:00
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_write' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="question_comment">' ;
2020-08-14 13:36:36 +02:00
echo '<option value=""' . ( $question_comment == '' ? ' selected' : '' ) . '>' . $lang [ 'srv_nihce' ] . '</option>' ;
echo '<option value="4"' . ( $question_comment == 4 ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $question_comment == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $question_comment == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $question_comment == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $question_comment == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_view' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="question_comment_viewadminonly">' ;
2020-08-14 13:36:36 +02:00
echo '<option value="4"' . ( $question_comment_viewadminonly == 4 || $question_comment_viewadminonly == '' ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $question_comment_viewadminonly == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $question_comment_viewadminonly == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $question_comment_viewadminonly == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $question_comment_viewadminonly == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
2022-03-31 00:26:08 +02:00
echo '</select>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2022-05-03 09:22:14 +02:00
echo '<input type="hidden" name="question_comment_viewauthor" value=""><input type="checkbox" id="question_comment_viewauthor" name="question_comment_viewauthor" value="1" ' . ( $question_comment_viewauthor == 1 ? ' checked' : '' ) . ' />' ;
2022-03-31 00:26:08 +02:00
echo '<label for="question_comment_viewauthor">' . $lang [ 'srv_comments_viewauthor' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments">' ;
echo '<legend>' . $lang [ 'srv_comments_respondents' ] . '</legend>' ;
echo '<p class="bottom16">' . $lang [ 'srv_comments_respondents_txt' ] . '</p>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_q_comment' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment" value="0" id="question_resp_comment_0" ' . ( $question_resp_comment == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment" value="1" id="question_resp_comment_1" ' . ( $question_resp_comment == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_view' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="question_resp_comment_viewadminonly">' ;
2020-08-14 13:36:36 +02:00
//echo '<option value=""'.($question_resp_comment_viewadminonly==''?' selected':'').'>'.$lang['srv_nihce'].'</option>';
echo '<option value="4"' . ( $question_resp_comment_viewadminonly == 4 || $question_resp_comment_viewadminonly == '' ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $question_resp_comment_viewadminonly == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $question_resp_comment_viewadminonly == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $question_resp_comment_viewadminonly == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $question_resp_comment_viewadminonly == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_show_open' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_show_open" value="" id="question_resp_comment_show_open_0" ' . ( $question_resp_comment_show_open == '' ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_show_open_0">' . $lang [ 'forma_settings_open' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_show_open" value="1" id="question_resp_comment_show_open_1" ' . ( $question_resp_comment_show_open == '1' ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_show_open_1">' . $lang [ 'forma_settings_closed' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'text' ] . ' "' . $lang [ 'srv_question_respondent_comment' ] . '":</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="text" class="text small" name="srvlang_srv_question_respondent_comment" value="' . $srvlang_srv_question_respondent_comment . '" style="width:300px">' ;
echo '<input type="hidden" name="extra_translations" value="1">' ; echo '</div>' ;
echo '</div>' ;
echo '<p class="bottom16">' . $lang [ 'srv_resp_s_comments_txt' ] . '</p>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_write' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="survey_comment_resp">' ;
2020-08-14 13:36:36 +02:00
echo '<option value=""' . ( $survey_comment_resp == '' ? ' selected' : '' ) . '>' . $lang [ 'srv_nihce' ] . '</option>' ;
echo '<option value="4"' . ( $survey_comment_resp == 4 ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $survey_comment_resp == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $survey_comment_resp == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $survey_comment_resp == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $survey_comment_resp == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_view' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" nname="survey_comment_viewadminonly_resp">' ;
2020-08-14 13:36:36 +02:00
echo '<option value="4"' . ( $survey_comment_viewadminonly_resp == 4 ? ' selected' : '' ) . '>' . $lang [ 'move_all' ] . '</option>' ;
echo '<option value="3" ' . ( $survey_comment_viewadminonly_resp == 3 ? ' selected' : '' ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '<option value="2" ' . ( $survey_comment_viewadminonly_resp == 2 ? ' selected' : '' ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo '<option value="1" ' . ( $survey_comment_viewadminonly_resp == 1 ? ' selected' : '' ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo '<option value="0" ' . ( $survey_comment_viewadminonly_resp == '0' ? ' selected' : '' ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo '</select> ' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="hidden" name="survey_comment_viewauthor_resp" value=""><input type="checkbox" id="survey_comment_viewauthor_resp" name="survey_comment_viewauthor_resp" value="1" ' . ( $survey_comment_viewauthor_resp == 1 ? ' checked' : '' ) . ' />' ;
echo '<label for="survey_comment_viewauthor_resp">' . $lang [ 'srv_comments_viewauthor' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<p class="semi-bold bottom16">' . $lang [ 'srv_extra_settings' ] . '</p>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_q_inicialke' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_inicialke" value="0" id="question_resp_comment_inicialke_0" ' . ( $question_resp_comment_inicialke == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_inicialke_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_inicialke" value="1" id="question_resp_comment_inicialke_1" ' . ( $question_resp_comment_inicialke == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_inicialke_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_q_inicialke_alert' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="0" id="question_resp_comment_inicialke_alert_0" ' . ( $question_resp_comment_inicialke_alert == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_inicialke_alert_0">' . $lang [ 'srv_reminder_off2' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="1" id="question_resp_comment_inicialke_alert_1" ' . ( $question_resp_comment_inicialke_alert == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_inicialke_alert_1">' . $lang [ 'srv_reminder_soft2' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="2" id="question_resp_comment_inicialke_alert_2" ' . ( $question_resp_comment_inicialke_alert == 2 ? ' checked' : '' ) . '/>' ;
echo '<label for="question_resp_comment_inicialke_alert_2">' . $lang [ 'srv_reminder_hard2' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-31 00:26:08 +02:00
echo '<fieldset class="comments">' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_settings_komentarji' ] . '</legend>' ;
2022-03-31 00:26:08 +02:00
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'orderby' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="sortpostorder" value="0" id="sortpostorder_0" ' . ( $sortpostorder == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="sortpostorder_0">' . $lang [ 'forum_asc' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="sortpostorder" value="1" id="sortpostorder_1" ' . ( $sortpostorder == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="sortpostorder_1">' . $lang [ 'forum_desc' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_add_comment' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="addfieldposition" value="0" id="addfieldposition_0" ' . ( $addfieldposition == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="addfieldposition_0">' . $lang [ 'srv_polozaj_bottom' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="addfieldposition" value="1" id="addfieldposition_1" ' . ( $addfieldposition == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="addfieldposition_1">' . $lang [ 'srv_polozaj_top' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_marks' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="commentmarks" value="0" id="commentmarks_0" ' . ( $commentmarks == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="commentmarks_0">' . $lang [ 'srv_comments_marks_0' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="commentmarks" value="1" id="commentmarks_1" ' . ( $commentmarks == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="commentmarks_1">' . $lang [ 'srv_comments_marks_1' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comments_marks_who' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="commentmarks_who" value="0" id="commentmarks_who_0" ' . ( $commentmarks_who == 0 ? ' checked' : '' ) . '/>' ;
echo '<label for="commentmarks_who_0">' . $lang [ 'srv_comments_marks_who_1' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="commentmarks_who" value="1" id="commentmarks_who_1" ' . ( $commentmarks_who == 1 ? ' checked' : '' ) . '/>' ;
echo '<label for="commentmarks_who_1">' . $lang [ 'srv_comments_marks_who_0' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder horizontal">' ;
echo '<span class="setting_title">' . $lang [ 'srv_comment_history' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<select class="dropdown small" name="comment_history">' ;
2020-08-14 13:36:36 +02:00
echo '<option value="0" ' . ( $comment_history == '0' || $comment_history == '' ? ' selected' : '' ) . '>' . $lang [ 'srv_comment_history_1' ] . '</option>' ;
echo '<option value="1" ' . ( $comment_history == 1 ? ' selected' : '' ) . '>' . $lang [ 'srv_comment_history_0' ] . '</option>' ;
echo '<option value="2" ' . ( $comment_history == 2 ? ' selected' : '' ) . '>' . $lang [ 'srv_comment_history_2' ] . '</option>' ;
echo '</select>' ;
2022-03-31 00:26:08 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-31 14:03:24 +02:00
echo '<p class="delete_comments"><a class="noline" href="#" onClick="delete_test_data();"><span class="faicon trash empty link-right"></span>' . $lang [ 'srv_delete_comments3' ] . '</a> (' . $lang [ 'srv_delete_comments_txt2' ] . ')</p>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
}
/*Dostop*/
if ( $_GET [ 'a' ] == 'dostop' ) {
2021-12-16 15:53:34 +01:00
2020-08-14 13:36:36 +02:00
// tukaj bom dodal še kontrolo na Avtorja ankete, tako da avtor lahko vedno spreminja dostop (gorazd,1.9.2009)
$stringDostopAvtor = " SELECT count(*) as isAvtor FROM srv_dostop WHERE ank_id = ' " . $this -> anketa . " ' AND (uid=' " . $global_user_id . " ' OR uid IN (SELECT user FROM srv_dostop_manage WHERE manager=' $global_user_id ' )) " ;
$sqlDostopAvtor = sisplet_query ( $stringDostopAvtor );
$rowDostopAvtor = mysqli_fetch_assoc ( $sqlDostopAvtor );
if ( $admin_type <= $row [ 'dostop' ] || $rowDostopAvtor [ 'isAvtor' ] > 0 ) {
2021-12-16 15:53:34 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_dostop_users' ] . '' . Help :: display ( 'srv_dostop_users' ) . '</legend>' ;
2020-08-14 13:36:36 +02:00
2021-12-20 15:12:13 +01:00
//Dodajanje dostopa - prikaži vse za admine - potrebuje prenovo
/** if ( $admin_type == 0 || $admin_type == 1 ){
2021-12-17 11:55:40 +01:00
echo '<div class="setting_holder">' ;
2021-07-14 12:24:05 +02:00
echo '<span id="dostop_active_show_1"><a href="#" onClick="dostopActiveShowAll(\'true\'); return false;">' . $lang [ 'srv_dostop_show_all' ] . '</a></span>' ;
echo '<span id="dostop_active_show_2" class="displayNone"><a href="#" onClick="dostopActiveShowAll(\'false\'); return false;">' . $lang [ 'srv_dostop_hide_all' ] . '</a></span>' ;
2021-12-17 11:55:40 +01:00
echo '</div>' ;
} **/
2021-07-14 12:24:05 +02:00
2020-08-14 13:36:36 +02:00
echo '<div id="dostop_users_list">' ;
$this -> display_dostop_users ( 0 );
echo '</div>' ;
2021-12-16 15:53:34 +01:00
2021-12-20 15:27:15 +01:00
echo '<div class="button_holder below">' ;
2021-12-16 15:53:34 +01:00
echo '<button class="medium blue" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
2021-12-20 15:27:15 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// Dodajanje uproabnikov preko e-maila
echo '<fieldset><legend>' . $lang [ 'srv_dostop_addusers' ] . '</legend>' ;
echo '<div id="addmail">' ;
2021-07-14 12:24:05 +02:00
$this -> display_add_survey_dostop ();
2020-08-14 13:36:36 +02:00
echo '</div>' ;
echo '</fieldset>' ;
}
}
/*Jezik*/
if ( $_GET [ 'a' ] == 'jezik' ) {
global $admin_lang ;
$lang_admin = $row [ 'lang_admin' ];
$lang_resp = $row [ 'lang_resp' ];
$admin_lang = $lang ;
// ce ni default jezik, damo za osnovnega, default jezik
global $resp_lang ;
$file = '../../lang/' . $row [ 'lang_resp' ] . '.php' ;
include ( $file );
$resp_lang = $lang ;
//$lang_admin = $lang_resp;
// nazaj na administrativnega
$file = '../../lang/' . $lang_admin . '.php' ;
include ( $file );
2022-02-03 13:57:24 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_extra_translations' ] . ' ' ;
2020-08-14 13:36:36 +02:00
if ( $row [ 'multilang' ] == 1 ) {
2022-02-03 13:57:24 +01:00
echo ' <select class="dropdown medium w130 inline" name="lang_id" onchange="window.location.href=\'index.php?anketa=' . $this -> anketa . '&a=jezik&lang_id=\'+this.value;">' ;
2020-08-14 13:36:36 +02:00
$lang_id = ( int ) $_GET [ 'lang_id' ];
if ( $lang_id > 0 )
$lang_resp = $lang_id ;
$p = new Prevajanje ( $this -> anketa );
$p -> dostop ();
$langs = $p -> get_all_translation_langs ();
echo '<option value="" ' . ( $lang_id == '' ? ' selected' : '' ) . '>' . $resp_lang [ 'language' ] . '</option>' ;
foreach ( $langs AS $k => $l ) {
echo '<option value="' . $k . '" ' . ( $lang_id == $k ? ' selected' : '' ) . '>' . $l . '</option>' ;
}
echo '</select>' ;
}
echo '</legend>' ;
if ( $row [ 'multilang' ] == 1 && $lang_id > 0 ) {
//echo '<p><span style="font-size:10px"> <a href="'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].'"><img src="img_0/preview_red.png" /></a> <a href="'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'" target="_blank">'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'</a></p>';
}
echo '<div class="standardne_besede">' ;
echo '<input type="hidden" name="extra_translations" value="1" />' ; // da vemo, da nastavljamo ta besedila
2022-01-13 08:42:09 +01:00
// Tabela standardnih besed
echo '<table id="standard_words_table">' ;
echo '<tr>' ;
2020-08-14 13:36:36 +02:00
2022-01-13 08:42:09 +01:00
echo '<th>' . ( $lang_id > 0 ? $lang [ 'srv_language_respons_1' ] . ': ' . $resp_lang [ 'language' ] : $lang [ 'srv_language_admin' ] . ': ' . $lang [ 'language' ]) . '</th>' ;
2020-08-14 13:36:36 +02:00
2022-01-13 08:42:09 +01:00
echo '<th>' . $lang [ 'srv_std_second' ] . ': ' ;
2020-08-14 13:36:36 +02:00
$file = '../../lang/' . $lang_resp . '.php' ;
include ( $file );
2022-01-13 08:42:09 +01:00
echo $lang [ 'language' ] . '</th>' ;
// nazaj na administrativni jezik
2020-08-14 13:36:36 +02:00
$file = '../../lang/' . $lang_admin . '.php' ;
include ( $file );
2022-02-03 23:22:04 +01:00
echo '<th><div class="standardna-beseda-th">' . $lang [ 'srv_std_translation' ] . '<div class="icon_holder"><a href="' . SurveyInfo :: getSurveyLink () . '&preview=on&language=' . $lang_resp . '" target="_blank"><span class="faicon preview"></span></a></div></div></th>' ;
2022-01-13 08:42:09 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
// jezik nastavimo na nastavitev za respondente, ker ta text dejansko nastavljamo
$file = '../../lang/' . $lang_resp . '.php' ;
include ( $file );
// Pri gumbih ne prikazujemo editorja
$this -> extra_translation ( 'srv_nextpage' );
$this -> extra_translation ( 'srv_nextpage_uvod' );
$this -> extra_translation ( 'srv_prevpage' );
$this -> extra_translation ( 'srv_lastpage' );
$this -> extra_translation ( 'srv_forma_send' );
$this -> extra_translation ( 'srv_potrdi' );
$this -> extra_translation ( 'srv_konec' );
$this -> extra_translation ( 'srv_remind_sum_hard' , 1 );
$this -> extra_translation ( 'srv_remind_sum_soft' , 1 );
$this -> extra_translation ( 'srv_remind_num_hard' , 1 );
$this -> extra_translation ( 'srv_remind_num_soft' , 1 );
$this -> extra_translation ( 'srv_remind_hard' , 1 );
$this -> extra_translation ( 'srv_remind_soft' , 1 );
$this -> extra_translation ( 'srv_remind_hard_-99' , 1 );
$this -> extra_translation ( 'srv_remind_soft_-99' , 1 );
$this -> extra_translation ( 'srv_remind_hard_-98' , 1 );
$this -> extra_translation ( 'srv_remind_soft_-98' , 1 );
$this -> extra_translation ( 'srv_remind_hard_-97' , 1 );
$this -> extra_translation ( 'srv_remind_soft_-97' , 1 );
$this -> extra_translation ( 'srv_remind_hard_multi' , 1 );
$this -> extra_translation ( 'srv_remind_soft_multi' , 1 );
$this -> extra_translation ( 'srv_remind_captcha_hard' , 1 );
$this -> extra_translation ( 'srv_remind_captcha_soft' , 1 );
$this -> extra_translation ( 'srv_remind_email_hard' , 1 );
$this -> extra_translation ( 'srv_remind_email_soft' , 1 );
$this -> extra_translation ( 'srv_alert_number_exists' , 1 );
$this -> extra_translation ( 'srv_alert_number_toobig' , 1 );
$this -> extra_translation ( 'srv_ranking_avaliable_categories' , 1 );
$this -> extra_translation ( 'srv_ranking_ranked_categories' , 1 );
$this -> extra_translation ( 'srv_question_respondent_comment' , 1 );
$this -> extra_translation ( 'srv_continue_later' , 1 );
$this -> extra_translation ( 'srv_continue_later_txt' , 1 );
$this -> extra_translation ( 'srv_continue_later_email' , 1 );
$this -> extra_translation ( 'srv_dropdown_select' , 1 );
$this -> extra_translation ( 'srv_wrongcode' , 1 );
$this -> extra_translation ( 'user_bye_textA' , 1 );
$this -> extra_translation ( 'srv_survey_non_active' , 1 );
$this -> extra_translation ( 'srv_survey_deleted' , 1 );
$this -> extra_translation ( 'srv_survey_non_active_notActivated' , 1 );
$this -> extra_translation ( 'srv_survey_non_active_notStarted' , 1 );
$this -> extra_translation ( 'srv_survey_non_active_expired' , 1 );
$this -> extra_translation ( 'srv_survey_non_active_voteLimit' , 1 );
2022-01-13 08:42:09 +01:00
2020-08-14 13:36:36 +02:00
// nastavimo jezik nazaj
$file = '../../lang/' . $lang_admin . '.php' ;
include ( $file );
2022-01-13 08:42:09 +01:00
echo '</table>' ;
2020-08-14 13:36:36 +02:00
echo '<div>' ;
2022-02-03 14:02:39 +01:00
// Gumb za ponastavitev prevoda v bazi pobriše že nastavljene prevode za izbran jezik
echo '<div class="button_holder top16 bottom16">' ;
2022-02-03 14:03:23 +01:00
echo '<button class="medium white-black" type="button" onclick="ponastavi_prevod(\'' . $lang_id . '\')">' . $lang [ 'reset_translation' ] . '</button>' ;
2022-02-03 14:02:39 +01:00
echo '</div>' ;
2022-01-13 08:42:09 +01:00
2022-02-03 23:22:04 +01:00
// Ta del se v 2. fazi zamenja z gumbom "Večjezične ankete"
echo '<div class="setting_holder">' ;
echo '<p class="bottom8">' . $lang [ 'srv_language_link2' ] . ':' ;
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess :: getInstance ( $global_user_id );
if ( $userAccess -> checkUserAccess ( $what = 'prevajanje' )){
echo ' <a href="index.php?anketa=' . $this -> anketa . '&a=prevajanje" title="' . $lang [ 'srv_language_link' ] . '"><span class="bold">' . $lang [ 'srv_language_link' ] . '</span></a></p>' ;
}
else {
echo ' <a href="#" onClick=popupUserAccess(\'prevajanje\'); return false;" title="' . $lang [ 'srv_language_link' ] . '" class="user_access_locked"><span class="bold">' . $lang [ 'srv_language_link' ] . '</span></a></p>' ;
}
echo '<p>' . $lang [ 'srv_language_mySurveys' ] . '.</p>' ;
echo '</div>' ;
2022-01-13 08:42:09 +01:00
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-02-03 13:57:24 +01:00
echo '<div class="button_holder">' ;
2022-02-03 14:02:39 +01:00
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . '; return false;">' . $lang [ 'edit1338' ] . '</button>' ;
2022-02-03 13:57:24 +01:00
echo '<button class="medium blue" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
2022-02-03 14:02:39 +01:00
echo '</div>' ;
2022-02-03 13:57:24 +01:00
2020-08-14 13:36:36 +02:00
}
/*Forma*/
if ( $_GET [ 'a' ] == 'forma' ) {
}
/*Nastavitve prikaza za mobilnike*/
if ( $_GET [ 'a' ] == 'mobile_settings' ) {
2021-11-22 01:24:06 +01:00
SurveySetting :: getInstance () -> Init ( $this -> anketa );
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
2022-04-14 18:06:01 +02:00
echo '<legend>' . $lang [ 'srv_mobile_settings_title' ] . Help :: display ( 'srv_mobilne_tabele' ) . '</legend>' ;
2020-08-14 13:36:36 +02:00
// Prikaz slik pri mobilnikih (default da)
$mobile_friendly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'mobile_friendly' );
2021-12-16 11:39:26 +01:00
echo '<div class="setting_holder ' . ( $mobile_friendly !== '1' ? 'bottom0' : '' ) . '" id="mobile_osnovno">' ;
2021-11-22 01:24:06 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_settings_mobile_friendly' ] . ':</span>' ;
echo '<div class="setting_item">' ;
2021-12-16 11:39:26 +01:00
echo '<input type="radio" name="mobile_friendly" id="mobile_friendly_1" ' . ( $mobile_friendly === '1' ? ' checked' : '' ) . ' value="1" onClick="$(\'#mobile_settings_other\').removeClass(\'displayNone\');$(\'#mobile_osnovno\').removeClass(\'bottom0\');">' ;
2021-11-22 01:24:06 +01:00
echo '<label for="mobile_friendly_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-16 11:39:26 +01:00
echo '<input type="radio" name="mobile_friendly" id="mobile_friendly_0" ' . ( $mobile_friendly !== '1' ? ' checked' : '' ) . ' value="0" onClick="$(\'#mobile_settings_other\').addClass(\'displayNone\');$(\'#mobile_osnovno\').addClass(\'bottom0\');">' ;
2021-11-22 01:24:06 +01:00
echo '<label for="mobile_friendly_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:24:06 +01:00
$display = ( $mobile_friendly == 1 ) ? '' : 'displayNone' ;
2021-11-22 14:26:03 +01:00
echo '<div class="' . $display . '" id="mobile_settings_other">' ;
2020-08-14 13:36:36 +02:00
// Prikaz slik pri mobilnikih (default da)
$hide_mobile_img = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'hide_mobile_img' );
2021-11-22 01:24:06 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_settings_mobile_img' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="hide_mobile_img" id="hide_mobile_img_0" ' . ( $hide_mobile_img !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="hide_mobile_img_0">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="hide_mobile_img" id="hide_mobile_img_1" ' . ( $hide_mobile_img === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="hide_mobile_img_1">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Prilagoditev tabel pri mobilnikih
$mobile_tables = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'mobile_tables' );
2021-11-22 01:24:06 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_settings_mobile_tables' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="mobile_tables" id="mobile_tables_1" ' . ( $mobile_tables === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="mobile_tables_1">' . $lang [ 'yes' ] . '</label> ' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2021-11-22 01:24:06 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="mobile_tables" id="mobile_tables_2" ' . ( $mobile_tables === '2' ? ' checked' : '' ) . ' value="2">' ;
echo '<label for="mobile_tables_2">' . $lang [ 'srv_settings_mobile_tables_slide' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="mobile_tables" id="mobile_tables_0" ' . ( $mobile_tables === '0' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="mobile_tables_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2021-11-22 14:26:03 +01:00
2021-11-22 01:24:06 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
/*Metapodatki (Parapodatki)*/
if ( $_GET [ 'a' ] == 'metadata' ) {
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$ip = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_ip' );
$ip_show = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_show_ip' );
$browser = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_browser' );
$referal = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_referal' );
$date = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_date' );
2021-03-16 10:11:08 +01:00
2021-03-24 08:24:06 +01:00
2021-11-22 11:21:57 +01:00
echo '<fieldset>' ;
2021-03-24 08:24:06 +01:00
echo '<legend>' . $lang [ 'srv_sledenje' ] . '</legend>' ;
2021-03-16 10:11:08 +01:00
// Preverimo ce je vklopljen modul za volitve - potem ne pustimo nobenih preklopov
$voting_disabled = '' ;
if ( SurveyInfo :: getInstance () -> checkSurveyModule ( 'voting' )){
$voting_disabled = ' disabled' ;
2020-08-14 13:36:36 +02:00
2021-12-10 05:55:27 +01:00
echo '<p class="red">' . $lang [ 'srv_voting_warning_paradata' ] . '</p><br>' ;
2021-03-24 08:24:06 +01:00
}
2021-11-30 23:24:12 +01:00
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'srv_metadata_desc' ] . '</p>' ;
echo '</div>' ;
2021-03-24 08:24:06 +01:00
2021-11-30 23:24:12 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_sledenje_browser' ] . ':</span>' ;
2021-03-24 08:24:06 +01:00
2021-11-30 23:24:12 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_browser" id="survey_browser_1" value="1"' . ( $browser == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_browser_1">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_browser" id="survey_browser_0" value="0"' . ( $browser == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_browser_0">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_sledenje_referal' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_referal" id="survey_referal_1" value="1"' . ( $referal == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_referal_1">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_referal" id="survey_referal_0" value="0"' . ( $referal == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_referal_0" >' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_sledenje_date' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_date" id="survey_date_1" value="1"' . ( $date == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_date_1">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_date" id="survey_date_0" value="0"' . ( $date == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . '>' ;
echo '<label for="survey_date_0">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<fieldset>' ;
2021-03-24 08:24:06 +01:00
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_sledenje_ip_title' ] . '</legend>' ;
2021-11-30 23:24:12 +01:00
2021-12-10 05:55:27 +01:00
//Shranjuj IP naslov respondenta
2021-12-15 13:48:45 +01:00
echo '<div class="setting_holder ' . (( $ip == 0 ) ? '' : ' bottom0' ) . '" id="save_IP">' ;
2021-11-30 23:24:12 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_sledenje_ip' ] . ':</span>' ;
echo '<div class="setting_item">' ;
2021-12-10 05:55:27 +01:00
echo '<input type="radio" name="survey_ip" id="survey_ip_1" value="1"' . ( $ip == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
2021-11-30 23:24:12 +01:00
echo '<label for="survey_ip_1">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-10 05:55:27 +01:00
echo '<input type="radio" name="survey_ip" id="survey_ip_0" value="0"' . ( $ip == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
2021-11-30 23:24:12 +01:00
echo '<label for="survey_ip_0">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2021-12-10 05:55:27 +01:00
echo '<div class=" ' . (( $ip == 1 && $ip_show == 0 ) ? 'displayNone' : '' ) . '" id="save_IP_warning">' ;
echo '<p class="red">' . $lang [ 'srv_sledenje_ip_alert' ] . '</p><br>' ;
echo '</div>' ;
2021-11-30 23:24:12 +01:00
2021-12-10 05:55:27 +01:00
//Poveži IP v bazi s podatki
2021-12-10 06:03:58 +01:00
if ( $admin_type == 0 || $admin_type == 1 ){
2021-12-10 05:55:27 +01:00
echo '<div class="' . (( $ip == 0 ) ? '' : ' displayNone' ) . '" id="connect_IP">' ;
2021-11-30 23:24:12 +01:00
2021-12-10 05:55:27 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_show_ip' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_show_ip" id="survey_show_ip_0" value="0"' . ( $ip_show == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
echo '<label for="survey_show_ip_0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="survey_show_ip" id="survey_show_ip_1" value="1"' . ( $ip_show == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
echo '<label for="survey_show_ip_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class=" ' . (( $ip_show == 1 ) ? '' : ' displayNone' ) . '" id="connect_IP_warning">' ;
echo '<p class="red">' . $lang [ 'srv_show_ip_alert' ] . '</p>' ;
echo '</div>' ;
echo '</div>' ;
2021-12-10 06:03:58 +01:00
}
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// Povezovanje identifikatorjev s podatki - samo za admine in ce so vklopljena email vabila
if ( $admin_type == 0 && SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' )) {
2021-11-30 23:24:12 +01:00
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_sledenje_identifikatorji_title' ] . ' ' . Help :: display ( 'srv_email_with_data' ) . '</legend>' ;
2021-11-30 23:24:12 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_sledenje_identifikatorji' ] . ':</span>' ;
echo '<div class="setting_item">' ;
2021-12-10 05:55:27 +01:00
echo '<input type="radio" name="show_email" id="show_email_0" value="0"' . ( $row [ 'show_email' ] == 0 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
2021-11-30 23:24:12 +01:00
echo '<label for="show_email_0">' . $lang [ 'no' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-10 05:55:27 +01:00
echo '<input type="radio" name="show_email" id="show_email_1" value="1"' . ( $row [ 'show_email' ] == 1 ? ' checked' : '' ) . ' ' . $voting_disabled . ' onClick="toggleParapodatki();">' ;
2021-11-30 23:24:12 +01:00
echo '<label for="show_email_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-30 23:24:12 +01:00
echo '</div>' ;
2021-03-24 08:24:06 +01:00
2021-12-10 05:55:27 +01:00
echo '<div class="setting_holder ' . (( $row [ 'show_email' ] == 1 ) ? '' : ' displayNone' ) . '" id="connect_identifier_warning">' ;
echo '<p class="red">' . $lang [ 'srv_show_mail_with_data3' ] . '.</p>' ;
2021-11-30 23:24:12 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
}
/* Nastavitve pdf/rtf izvozov */
if ( $_GET [ 'a' ] == 'export_settings' ) {
SurveySetting :: getInstance () -> Init ( $this -> anketa );
// Nastavitve za izpis vprasalnika
2021-11-19 08:54:09 +01:00
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_export_survey_settings' ] . '</legend>' ;
// Številčenje vprašanj (default da)
$export_numbering = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_numbering' );
2021-11-19 08:54:09 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_nastavitveStevilcenje' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
2021-11-19 08:54:09 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_numbering" id="export_numbering_1" ' . ( $export_numbering === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_numbering_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_numbering" id="export_numbering_0" ' . ( $export_numbering !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_numbering_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Prikaz pogojev (default da)
$export_show_if = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_show_if' );
2021-11-19 08:54:09 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_export_if' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_show_if" id="export_show_if_1" ' . ( $export_show_if === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_show_if_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_show_if" id="export_show_if_0" ' . ( $export_show_if !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_show_if_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-19 08:54:09 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Prikazi uvoda (default ne)
$export_show_intro = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_show_intro' );
2021-11-19 08:54:09 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title" >' . $lang [ 'srv_export_intro' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
2021-11-19 08:54:09 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_show_intro" id="export_show_intro_1" ' . ( $export_show_intro === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_show_intro_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_show_intro" id="export_show_intro_0" ' . ( $export_show_intro !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_show_intro_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-19 08:54:09 +01:00
echo '</div>' ;
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
// Nastavitve za izpis odgovorov respondentov
2021-11-22 01:26:12 +01:00
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_export_results_settings' ] . '</legend>' ;
2021-11-22 01:26:12 +01:00
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Tip izvoza (1->dolg oz. razsirjen, 2->kratek oz. skrcen)
$export_data_type = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_type' );
2021-11-22 15:17:04 +01:00
echo '<label for="export_data_type">' . $lang [ 'srv_displaydata_type' ];
2021-11-22 01:26:12 +01:00
echo Help :: display ( 'displaydata_pdftype' );
2021-11-22 15:17:04 +01:00
echo ':</label>' ;
2021-11-22 01:26:12 +01:00
echo '<select name="export_data_type" id="export_data_type" class="dropdown large">' ;
2020-08-14 13:36:36 +02:00
echo ' <option value="2"' . (( int ) $export_data_type == 2 ? ' selected="selected"' : '' ) . '>' . $lang [ 'srv_displaydata_type2' ] . '</option>' ;
echo ' <option value="1"' . (( int ) $export_data_type == 1 ? ' selected="selected"' : '' ) . '>' . $lang [ 'srv_displaydata_type1' ] . '</option>' ;
echo '</select>' ;
2021-11-22 01:26:12 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Številčenje vprašanj (default da)
$export_data_numbering = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_numbering' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_nastavitveStevilcenje' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_numbering" id="export_data_numbering_1" ' . ( $export_data_numbering === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_numbering_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_numbering" id="export_data_numbering_0" ' . ( $export_data_numbering !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_numbering_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Prikaz recnuma (default da)
$export_data_show_recnum = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_show_recnum' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_export_show_recnum' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_show_recnum" id="export_data_show_recnum_1" ' . ( $export_data_show_recnum === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_show_recnum_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_show_recnum" id="export_data_show_recnum_0" ' . ( $export_data_show_recnum !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_show_recnum_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Prikaz pogojev (default da)
$export_data_show_if = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_show_if' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_export_if' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_show_if" id="export_data_show_if_1" ' . ( $export_data_show_if === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_show_if_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_show_if" id="export_data_show_if_0" ' . ( $export_data_show_if !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_show_if_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Page break med posameznimi respondenti (default ne)
$export_data_PB = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_PB' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_export_pagebreak' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_PB" id="export_data_PB_1" ' . ( $export_data_PB === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_PB_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_PB" id="export_data_PB_0" ' . ( $export_data_PB !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_PB_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Izpusti vprasanja brez odgovora (default ne)
$export_data_skip_empty = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_skip_empty' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_export_skip_empty' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_skip_empty" id="export_data_skip_empty_1" ' . ( $export_data_skip_empty === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_skip_empty_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_skip_empty" id="export_data_skip_empty_0" ' . ( $export_data_skip_empty !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_skip_empty_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
// Izpusti podvprasanja brez odgovora (default ne)
$export_data_skip_empty_sub = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'export_data_skip_empty_sub' );
2021-11-22 01:26:12 +01:00
echo '<span class="setting_title" >' . $lang [ 'srv_export_skip_empty_sub' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_skip_empty_sub" id="export_data_skip_empty_sub_1" ' . ( $export_data_skip_empty_sub === '1' ? ' checked' : '' ) . ' value="1">' ;
echo '<label for="export_data_skip_empty_sub_1">' . $lang [ 'yes' ] . '</label> ' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_data_skip_empty_sub" id="export_data_skip_empty_sub_0" ' . ( $export_data_skip_empty_sub !== '1' ? ' checked' : '' ) . ' value="0">' ;
echo '<label for="export_data_skip_empty_sub_0">' . $lang [ 'no' ] . '</label> ' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-22 01:26:12 +01:00
echo '</div>' ;
2021-07-14 12:24:05 +02:00
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
/* Nastavitve GDPR */
if ( $_GET [ 'a' ] == A_GDPR ) {
$gdpr = new GDPR ();
$gdpr -> displayGDPRSurvey ( $this -> anketa );
}
2021-07-14 12:24:05 +02:00
if ( $_GET [ 'a' ] != 'jezik' && $_GET [ 'a' ] != 'trajanje' && $_GET [ 'a' ] != A_GDPR && $_GET [ 'a' ] != 'dostop' ) {
2021-11-22 02:10:28 +01:00
2021-11-29 11:20:25 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
2021-11-22 02:10:28 +01:00
echo '<button class="medium blue" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo '</form>' ;
}
function anketa_nastavitve_mail () {
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
/* Globalne nastavitve ankete: veljajo za celoto anketo ne glede na uporabnika*/
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$http_referer = parse_url ( $_SERVER [ 'HTTP_REFERER' ]); //If yes, parse referrer
$referer_url = $http_referer [ 'query' ];
$show_back_button = false ;
if ( preg_match ( '/anketa=' . $this -> anketa . '&a=' . A_INVITATIONS . '/' , $referer_url ) || $_GET [ 'show_back' ] == 'true' )
$show_back_button = true ;
echo '<fieldset><legend>' . $lang [ 'srv_email_setting_title' ] . '</legend>' ;
echo '<form name="settingsanketa_' . $row [ 'id' ] . '" action="ajax.php?a=editanketasettings&m=' . A_MAILING . ( $show_back_button ? '&show_back=true' : '' ) . '" method="post" autocomplete="off">' . " \n \r " ;
echo ' <input type="hidden" name="anketa" value="' . $this -> anketa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
$MA = new MailAdapter ( $this -> anketa );
echo '<span class="bold">' . $lang [ 'srv_email_setting_select_server' ] . '</span> ' ;
echo '<label><input type="radio" name="SMTPMailMode" value="0" ' . ( $MA -> is1KA () ? 'checked ="checked" ' : '' ) . ' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">' ;
echo $lang [ 'srv_email_setting_adapter0' ] . ' </label>' ;
// Google smtp je viden samo starim, kjer je ze vklopljen
if ( $MA -> isGoogle ()){
echo '<label><input type="radio" name="SMTPMailMode" value="1" ' . ( $MA -> isGoogle () ? 'checked ="checked" ' : '' ) . ' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">' ;
echo $lang [ 'srv_email_setting_adapter1' ] . ' </label>' ;
}
echo '<label><input type="radio" name="SMTPMailMode" value="2" ' . ( $MA -> isSMTP () ? 'checked ="checked" ' : '' ) . ' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">' ;
echo $lang [ 'srv_email_setting_adapter2' ] . ' </label>' ;
echo Help :: display ( 'srv_mail_mode' );
#1ka mail system
$enkaSettings = $MA -> get1KASettings ();
echo '<br>' ;
echo '<br>' ;
echo '<span class="bold">' . $lang [ 'srv_email_setting_settings' ] . '</span><br>' ;
echo '<div id="send_mail_mode0" ' . ( ! $MA -> is1KA () ? ' class="displayNone"' : '' ) . '>' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<span>' . $enkaSettings [ 'SMTPFrom' ] . '</span><input type="hidden" name="SMTPFrom0" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo0" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
echo '</div>' ;
#GMAIL - Google
$enkaSettings = $MA -> getGoogleSettings ();
echo '<div id="send_mail_mode1" ' . ( ! $MA -> isGoogle () ? ' class="displayNone"' : '' ) . '>' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<input type="text" name="SMTPFrom1" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo1" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
#Password
echo '<p><label>' . $lang [ 'srv_email_setting_password' ] . '<input type="password" name="SMTPPassword1" placeholder="' . $lang [ 'srv_email_setting_password_placeholder' ] . '"></label>' ;
echo '</p>' ;
echo '</div>' ;
#SMTP
$enkaSettings = $MA -> getSMTPSettings ();
echo '<div id="send_mail_mode2" ' . ( ! $MA -> isSMTP () ? ' class="displayNone"' : '' ) . '>' ;
# from - NICE
echo '<p><label>' . $lang [ 'srv_email_setting_from_nice' ] . '<input type="text" name="SMTPFromNice2" value="' . $enkaSettings [ 'SMTPFromNice' ] . '"></label>' ;
echo '</p>' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<input type="text" name="SMTPFrom2" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo2" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
#Username
echo '<p><label>' . $lang [ 'srv_email_setting_username' ] . '<input type="text" name="SMTPUsername2" value="' . $enkaSettings [ 'SMTPUsername' ] . '" ></label>' ;
echo '</p>' ;
#Password
echo '<p><label>' . $lang [ 'srv_email_setting_password' ] . '<input type="password" name="SMTPPassword2" placeholder="' . $lang [ 'srv_email_setting_password_placeholder' ] . '"></label>' ;
echo '</p>' ;
#autentikacija
echo '<p>' ;
echo $lang [ 'srv_email_setting_autentication' ];
echo '<label><input type="radio" name="SMTPAuth2" value="0" ' . (( int ) $enkaSettings [ 'SMTPAuth' ] != 1 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_no' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPAuth2" value="1" ' . (( int ) $enkaSettings [ 'SMTPAuth' ] == 1 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_yes' ] . '</label>' ;
echo '</p>' ;
#Varnost SMTPSecure
echo '<p>' ;
echo $lang [ 'srv_email_setting_encryption' ];
echo '<input type="radio" name="SMTPSecure2" value="0" ' . (( int ) $enkaSettings [ 'SMTPSecure' ] == 0 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_none' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPSecure2" value="ssl" ' . ( $enkaSettings [ 'SMTPSecure' ] == 'ssl' ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_ssl' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPSecure2" value="tls" ' . ( $enkaSettings [ 'SMTPSecure' ] == 'tls' ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_tls' ] . '</label>' ;
echo '</p>' ;
#port
echo '<p><label>' . $lang [ 'srv_email_setting_port' ] . '<input type="number" min="0" max="65535" name="SMTPPort2" value="' . ( int ) $enkaSettings [ 'SMTPPort' ] . '" ></label>' ;
echo $lang [ 'srv_email_setting_port_note' ];
echo '</p>' ;
#host
echo '<p><label>' . $lang [ 'srv_email_setting_host' ] . '<input type="text" name="SMTPHost2" value="' . $enkaSettings [ 'SMTPHost' ] . '" ></label>' ;
echo '</p>' ;
echo '</div>' ;
echo '</form>' ;
echo '</fieldset>' ;
echo '<span id="send_mail_mode_test" class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;"><span>' ;
echo $lang [ 'srv_email_setting_btn_test' ] . '</span></a></div></span>' ;
echo '<span class="floatLeft spaceRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;"><span>' ;
echo $lang [ 'srv_email_setting_btn_save' ] . '</span></a></div></span>' ;
if ( preg_match ( '/anketa=' . $this -> anketa . '&a=' . A_INVITATIONS . '/' , $referer_url ) || $show_back_button ) {
//echo '<div class="floatLeft spaceRight buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="'.$_SERVER['HTTP_REFERER'].'"><span>';
echo '<div class="floatLeft spaceRight buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=invitations"><span>' ;
echo $lang [ 'srv_back_to_email' ] . '</span></a></div>' ;
echo '</div>' ;
}
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
}
/**
* funkcija , ki prikaze polja za nastavitev ekstra prevodov
*
*/
function extra_translation ( $text , $editor = 0 ) {
global $lang ;
global $admin_lang ;
global $resp_lang ;
$lang_id = ( int ) $_GET [ 'lang_id' ];
if ( $lang_id > 0 )
$lang_id = '_' . $lang_id ;
else
$lang_id = '' ;
$value = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'srvlang_' . $text . $lang_id );
if ( $value == '' ) $value = $lang [ $text ];
$onclick = 'onclick="inline_jezik_edit(\'srvlang_' . $text . $lang_id . '\');"' ;
// Popravimo text za naslednjo stran na uvodu
$next_uvod = '' ;
if ( $text == 'srv_nextpage_uvod' )
$next_uvod = $lang_id == '' ? $admin_lang [ 'srv_nextpage_uvod_desc' ] : $resp_lang [ 'srv_nextpage_uvod_desc' ];
2022-02-03 13:57:24 +01:00
echo '<tr>' ;
2022-01-13 10:17:19 +01:00
echo '<td>' . ( $lang_id == '' ? $admin_lang [ $text ] : $resp_lang [ $text ]) . ' ' . ( $text == 'srv_nextpage_uvod' ? ' (' . $next_uvod . ')' : '' ) . '</td> ' ;
2022-01-13 08:42:09 +01:00
echo '<td>' . $lang [ $text ] . '</td>' ;
2022-02-03 23:22:04 +01:00
echo '<td><div class="standardna-beseda"><div contentEditable="true" class="standardna-beseda-urejanje" name="srvlang_' . $text . $lang_id . '" id="srvlang_' . $text . $lang_id . '">' . $value . '</div>' ;
2022-01-13 08:42:09 +01:00
2020-08-14 13:36:36 +02:00
if ( $editor == 1 )
2022-02-15 15:45:40 +01:00
echo '<span class="faicon edit-vprasanje sb-edit blue"' . $onclick . ' style="display:none;"></span>' ;
2022-01-13 10:17:19 +01:00
2020-08-14 13:36:36 +02:00
echo '<textarea name="srvlang_' . $text . $lang_id . '" id="polje_srvlang_' . $text . $lang_id . '" style="display:none;">' . $value . '</textarea>' ;
2022-02-03 23:22:04 +01:00
echo '</div></td>' ;
2020-08-14 13:36:36 +02:00
2022-01-13 08:42:09 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
function anketa_nice_links () {
2022-02-24 13:42:50 +01:00
global $lang ;
2020-08-14 13:36:36 +02:00
echo '<div id="anketa_edit">' ;
2022-02-24 13:42:50 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_nice_url' ] . '</legend>' ;
2020-08-14 13:36:36 +02:00
$sql = sisplet_query ( " SELECT l.link, a.id, a.naslov FROM srv_nice_links l, srv_anketa a WHERE a.id=l.ank_id ORDER BY l.link ASC " );
2022-02-24 13:42:50 +01:00
$table_exists = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
if ( $table_exists == 0 ) {
echo '<p class="bottom16">' . $lang [ 'srv_nice_url_note' ] . '</p>' ;
echo '<table>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_nice_url_extension' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_nice_url_surveyname' ] . '</th>' ;
echo '</tr>' ;
$table_exists = 1 ;
}
echo '<tr>' ;
echo '<td>' . $row [ 'link' ] . '</td>' ;
echo '<td><a href="index.php?anketa=' . $row [ 'id' ] . '&a=vabila&m=url">' . $row [ 'naslov' ] . '</a></td>' ;
echo '</tr>' ;
}
if ( $table_exists == 1 )
echo '</table>' ;
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
/**
* prikaze ankete z administrativnim dostopom za pomoč
*
*/
function anketa_admin () {
global $lang ;
echo '<div id="anketa_edit">' ;
$sql = sisplet_query ( " SELECT srv_anketa.id, srv_anketa.naslov, users.email FROM srv_anketa, users WHERE users.id=srv_anketa.insert_uid AND dostop_admin >= DATE(NOW()) ORDER BY edit_time DESC " );
if ( ! $sql ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
while ( $row = mysqli_fetch_array ( $sql )) {
echo '<p><strong style="display:inline-block; width:300px;"><a href="index.php?anketa=' . $row [ 'id' ] . '">' . $row [ 'naslov' ] . '</a></strong> <span style="display:inline-block; width:300px;">(' . $row [ 'email' ] . ')</span></p>' ;
}
echo '</div>' ;
}
/**
* prikaze izbrisanje ankete
*
*/
function anketa_deleted () {
global $lang ;
echo '<div id="anketa_edit">' ;
2022-02-24 02:01:51 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_anketa_deleted' ] . '</legend>' ;
2020-08-14 13:36:36 +02:00
$sql = sisplet_query ( " SELECT srv_anketa.id, srv_anketa.naslov, users.email FROM srv_anketa, users WHERE users.id=srv_anketa.insert_uid AND active='-1' ORDER BY edit_time DESC " );
if ( ! $sql ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
2022-02-24 02:01:51 +01:00
$table_exists = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
if ( $table_exists == 0 ) {
echo '<p class="bottom16">' . $lang [ 'srv_anketa_deleted_note' ] . '</p>' ;
echo '<table>' ;
echo '<tr>' ;
2022-02-24 13:04:26 +01:00
echo '<th>' . $lang [ 'srv_data_deleted_surveyname' ] . '</th>' ;
echo '<th class="nowrap">' . $lang [ 'srv_data_deleted_user' ] . '</th>' ;
echo '<th></th>' ;
2022-02-24 02:01:51 +01:00
echo '</tr>' ;
$table_exists = 1 ;
}
echo '<tr>' ;
2022-02-24 13:04:26 +01:00
echo '<td><a href="index.php?anketa=' . $row [ 'id' ] . '">' . $row [ 'naslov' ] . '</a></td>' ;
echo '<td>' . $row [ 'email' ] . '</td>' ;
echo '<td><button class="table white-black caps" type="button" onclick="anketa_restore(\'' . $row [ 'id' ] . '\'); return false;">' . $lang [ 'srv_anketa_deleted_restore' ] . '</button></td>' ;
2022-02-24 02:01:51 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
2022-02-24 02:01:51 +01:00
if ( $table_exists == 1 )
echo '</table>' ;
2020-08-14 13:36:36 +02:00
2022-02-24 02:01:51 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
/**
* prikaze izbrisanje podatke
*
*/
function data_deleted () {
global $lang ;
echo '<div id="anketa_edit">' ;
2022-02-24 01:08:18 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_data_deleted' ] . '</legend>' ;
2020-08-14 13:36:36 +02:00
$sql = sisplet_query ( " SELECT a.id, a.naslov, users.email, COUNT(u.id) AS deleted FROM srv_anketa a, srv_user u, users WHERE u.deleted='1' AND u.ank_id=a.id AND users.id=a.insert_uid GROUP BY a.id ORDER BY edit_time DESC " );
if ( ! $sql ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
2022-02-24 01:08:18 +01:00
$table_exists = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
if ( $table_exists == 0 ) {
echo '<p class="bottom16">' . $lang [ 'srv_data_deleted_note' ] . '</p>' ;
echo '<table>' ;
echo '<tr>' ;
2022-02-24 13:04:26 +01:00
echo '<th>' . $lang [ 'srv_data_deleted_surveyname' ] . '</th>' ;
echo '<th class="nowrap">' . $lang [ 'srv_data_deleted_user' ] . '</th>' ;
echo '<th class="nowrap">' . $lang [ 'srv_data_deleted' ] . '</th>' ;
echo '<th></th>' ;
2022-02-24 01:08:18 +01:00
echo '</tr>' ;
$table_exists = 1 ;
}
echo '<tr>' ;
2022-02-24 13:04:26 +01:00
echo '<td><a href="index.php?anketa=' . $row [ 'id' ] . '">' . $row [ 'naslov' ] . '</a></td>' ;
echo '<td>' . $row [ 'email' ] . '</td>' ;
echo '<td class="right">' . $row [ 'deleted' ] . '</td>' ;
echo '<td><button class="table white-black caps" type="button" onclick="data_restore(\'' . $row [ 'id' ] . '\'); return false;">' . $lang [ 'srv_data_deleted_restore' ] . '</button></td>' ;
2022-02-24 01:08:18 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
2022-02-24 01:08:18 +01:00
if ( $table_exists == 1 )
echo '</table>' ;
2020-08-14 13:36:36 +02:00
2022-02-24 01:08:18 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
// online urejanje CSS datoteke
function anketa_editcss () {
$st = new SurveyTheme ( $this -> anketa );
$st -> edit_css ();
}
function anketa_vabila () {
global $lang ;
if ( $_GET [ 'm' ] == '' || $_GET [ 'm' ] == 'settings' ) {
$this -> anketa_vabila_nastavitve ();
}
}
function anketa_vabila_nastavitve () {
global $lang , $site_url , $global_user_id ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$d = new Dostop ();
2022-03-18 00:38:05 +01:00
2020-08-14 13:36:36 +02:00
# Opozorilo o napakah
$sd = new SurveyDiagnostics ( $this -> anketa );
$sd -> doDiagnostics ();
$diagnostic = $sd -> getDiagnostic ();
2022-03-18 00:38:05 +01:00
if ( is_array ( $diagnostic ) && count ( $diagnostic ) > 0 ) {
2020-08-14 13:36:36 +02:00
2022-03-18 00:38:05 +01:00
echo '<div class="top_note" id="publication_warnings">' ;
echo ' <div class="title">' ;
echo ' <span class="faicon warning"></span> ' . $lang [ 'srv_warning' ];
echo '<div class="note_hide"><a href="#" onClick="top_note_hide(\'publication_warnings\'); return false;"">✕</a></div>' ;
echo ' </div>' ;
echo $lang [ 'srv_publication_survey_warnings' ] . '\'<a href="index.php?anketa=' . $this -> anketa . '&a=' . A_TESTIRANJE . '">' . $lang [ 'srv_testiranje' ] . '</a>\'.' ;
echo '</div>' ;
}
2020-08-14 13:36:36 +02:00
2022-03-18 00:38:05 +01:00
# Opozorilo - anketa ni aktivna
if ( $row [ 'active' ] == 0 ) {
echo '<div class="top_note">' ;
echo ' <div class="title">' ;
echo ' <span class="faicon warning"></span> ' . $lang [ 'srv_publication_survey_noactive' ];
echo ' </div>' ;
echo '<p class="bottom16">' . $lang [ 'srv_publication_survey_noactive_note' ] . '</p>' ;
echo '<div class="top_note_activate">' ;
2022-03-23 16:32:53 +01:00
echo '<p class="semi-bold">' . $lang [ 'srv_anketa_noactive2' ] . '</p>' ;
2022-03-18 00:38:05 +01:00
//Toggle kopiran iz headerja
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 '<a href="index.php?anketa=' . $this -> anketa . '&a=' . A_HIERARHIJA_SUPERADMIN . '&m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang [ 'srv_anketa_noactive' ] . '">' ;
}
else {
echo '<a href="#" class="srv_ico" title="' . $lang [ 'srv_anketa_active' ] . '" style="cursor:text !important;">' ;
}
}
else {
echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this -> anketa . '\',\'' . $row [ 'active' ] . '\'); return false;" title="' . $lang [ 'srv_anketa_active' ] . '">' ;
}
echo '<div id="srv_active" class="switch_anketa anketa_on"><span class="switch_anketa_content">ON</span></div>' ;
echo '</a>' ;
}
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 '<a href="index.php?anketa=' . $this -> anketa . '&a=' . A_HIERARHIJA_SUPERADMIN . '&m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang [ 'srv_anketa_noactive' ] . '">' ;
} else {
echo '<a href="#" class="srv_ico" title="' . $lang [ 'srv_anketa_noactive' ] . '">' ;
}
}
else {
echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;" title="' . $lang [ 'srv_anketa_noactive' ] . '">' ;
}
if (( int ) $_last_active > 0 ) {
# anketa je zaključena
echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>' ;
}
else {
# anketa je neaktivna
echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>' ;
}
echo '</a>' ;
}
echo '</div>' ;
2022-03-23 16:32:53 +01:00
echo '<p class="top16">' . $lang [ 'srv_publication_survey_noactive_note2' ] . '</p>' ;
2022-03-18 00:38:05 +01:00
echo '</div>' ;
}
// Delite povezavo do ankete
echo '<div class="title"><div class="title_icon"><span class="faicon edit_square empty"></span></div><h2>' . $lang [ 'srv_publication_survey_links' ] . '</h2></div>' ;
echo '<p class="bottom16">' . $lang [ 'srv_publication_survey_links_note' ] . '</p>' ;
echo '<div class="button_holder">' ;
echo '<div class="input_box">' ;
echo '<span class="faicon link-chain link-right blue"></span><span class="italic"></span>' ;
echo '<input type="text" onClick="this.select();" value="' . SurveyInfo :: getSurveyLink () . '" readonly/>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-03-18 00:38:05 +01:00
echo '<button type="button" class="medium blue" onclick="CopyToClipboard(\'' . SurveyInfo :: getSurveyLink () . '\'); actionNotePopup(\'link_copied\', \'success\');">' . $lang [ 'srv_diagnostika_testiranje_copy' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
2022-03-23 16:32:53 +01:00
//Lep URL - dodajanje
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess :: getInstance ( $global_user_id );
if ( ! $userAccess -> checkUserAccess ( $what = 'nice_url' )){
echo '<button type="button" class="medium yellow">' . $lang [ 'srv_nice_url_add' ] . '</button>' ;
echo '</div>' ; // div.button_holder
}
else {
// Gumb za dodajanje lepega linka
echo '<button id="nice_url_button" type="button" class="medium white-black" onclick="toggleNiceURL(\'show\');">' . $lang [ 'srv_nice_url_add' ] . '</button>' ;
echo '<div id="nice_url_holder" class="displayNone">' ;
echo $site_url ;
echo '<input type="text" class="text large" name="nice_url" id="nice_url" value=""/>' ;
echo '<button type="button" class="medium blue" onclick="$.redirect(\'ajax.php?a=nice_url\', {anketa: ' . $this -> anketa . ', nice_url: $(\'#nice_url\').val()}); return false;">' . $lang [ 'add' ] . '</button>' ;
echo '<button type="button" class="medium white-blue" onclick="toggleNiceURL(\'hide\')">' . $lang [ 'edit1338' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-03-18 00:38:05 +01:00
2022-03-23 16:32:53 +01:00
echo '</div>' ; // div.button_holder
if ( isset ( $_GET [ 'error' ])) {
?> <script type="text/javascript">
toggleNiceURL ( 'show' );
</ script >< ? php
echo '<div id="nice_url_error">' ;
// Prekratek lep url
if ( strlen ( $_GET [ 'error' ]) <= 2 )
echo '<p class="red"><span class="bold">' . $_GET [ 'error' ] . '</span> ' . $lang [ 'srv_nice_url_short' ] . '</p>' ;
// Predolg lep url
elseif ( strlen ( $_GET [ 'error' ]) > 20 )
echo '<p class="red"><span class="bold">' . $_GET [ 'error' ] . '</span> ' . $lang [ 'srv_nice_url_long' ] . '</p>' ;
// Ze obstaja
else
echo '<p class="red"><span class="bold">' . $_GET [ 'error' ] . '</span> ' . $lang [ 'srv_nice_url_taken' ] . '</p>' ;
echo '</div>' ;
}
2022-03-18 00:38:05 +01:00
2022-03-23 16:32:53 +01:00
}
2022-03-18 00:38:05 +01:00
2022-03-23 16:32:53 +01:00
// Zlistamo nice URL, povezave za skupine in jezike
$this -> niceUrlSettings ();
2022-03-18 00:38:05 +01:00
// Več načinov deljenja ankete
2022-03-24 23:22:15 +01:00
echo '<div class="title"><div class="title_icon"><span class="faicon share-arrow"></span></div><h2>' . $lang [ 'srv_publication_survey_more' ] . '</h2></div>' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more">' ;
// Vabila
echo '<div class="more_block" onclick="window.location.href=\'index.php?anketa=' . $this -> anketa . '&a=invitations\'">' ;
echo '<div class="more_title">' ;
echo '<div class="more_title_icon"><span class="faicon inv_sent_1 empty"></span></div>' ;
echo $lang [ 'srv_publication_invitations' ];
echo '</div>' ;
echo $lang [ 'srv_publication_invitations_text' ];
echo '</div>' ;
//HTML koda
2022-03-23 16:32:53 +01:00
echo '<div class="more_block" onclick="publishPopupOpen(\'html\');">' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more_title">' ;
2022-03-23 16:32:53 +01:00
echo '<div class="more_title_icon"><span class="fa-brands red html5"></span></div>' ;
2022-03-18 00:38:05 +01:00
echo $lang [ 'srv_anketa_href' ];
echo '</div>' ;
echo $lang [ 'srv_anketa_href_text' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-18 00:38:05 +01:00
//HTML koda + števec
2022-03-23 16:32:53 +01:00
echo '<div class="more_block" onclick="publishPopupOpen(\'htmlcount\');">' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more_title">' ;
2022-03-23 16:32:53 +01:00
echo '<div class="more_title_icon"><span class="fa-brands red html5"></span><span class="faicon fa-1"></span></div>' ;
2022-03-18 00:38:05 +01:00
echo $lang [ 'srv_anketa_href_count' ];
echo '</div>' ;
echo $lang [ 'srv_anketa_href_count_text' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-24 20:16:53 +01:00
//QR koda
echo '<div class="more_block" onclick="publishPopupOpen(\'QR\');">' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more_title">' ;
echo '<div class="more_title_icon"><span class="faicon fa-qrcode"></span></div>' ;
echo $lang [ 'srv_anketa_href_friends' ];
echo '</div>' ;
echo $lang [ 'srv_anketa_href_friends_text' ];
echo '</div>' ;
// iFrame - js
2022-03-23 16:32:53 +01:00
echo '<div class="more_block" onclick="publishPopupOpen(\'iframejs\');">' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more_title">' ;
echo '<div class="more_title_icon"><span class="faicon fa-window-maximize"></span></div>' ;
2022-03-24 20:16:53 +01:00
echo $lang [ 'srv_anketa_href_ijs' ];
2022-03-18 00:38:05 +01:00
echo '</div>' ;
echo $lang [ 'srv_anketa_href_ijs_text' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-18 00:38:05 +01:00
// iFrame - brez js
2022-03-23 16:32:53 +01:00
echo '<div class="more_block" onclick="publishPopupOpen(\'iframenojs\');">' ;
2022-03-18 00:38:05 +01:00
echo '<div class="more_title">' ;
echo '<div class="more_title_icon"><span class="faicon fa-window-maximize empty"></span></div>' ;
2022-03-24 20:16:53 +01:00
echo $lang [ 'srv_anketa_href_inojs' ];
2022-03-18 00:38:05 +01:00
echo '</div>' ;
echo $lang [ 'srv_anketa_href_inojs_text' ];
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
function niceUrlSettings () {
global $lang , $site_url , $global_user_id ;
$p = new Prevajanje ( $this -> anketa );
$p -> dostop ();
$lang_array = $p -> get_all_translation_langs ();
$link = SurveyInfo :: getSurveyLink ();
$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' : '' ) . '' ;
2022-03-18 00:38:05 +01:00
/*// Predogled url
2020-08-14 13:36:36 +02:00
echo '<div class="publish_url_holder">' ;
echo '<p style="margin: 2px 0;"><a href="' . $link . '&preview=on' . $preview_options . '" target="_blank" class="srv_icox spaceRight"><span class="faicon preview"></span> ' . $lang [ 'srv_poglejanketo2' ] . '</b></a>' ;
2021-07-20 17:18:21 +02:00
echo '<span class="spaceLeft italic">(' . $lang [ 'srv_preview_text' ] . ')</span>' ;
echo '<p style="margin: 2px 0;">' . $lang [ 'url' ] . ': ' . $link . '&preview=on' . $preview_options . '' ;
echo '<a href="#" onclick="CopyToClipboard(\'' . $link . '&preview=on' . $preview_options . '\');" return false;" title="Kopiraj povezavo" class="srv_ico">'
. '  '
. '<span class="faicon copy"></span></a></p>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
// Test url
if ( $this -> survey_type > 1 ){
echo '<div class="publish_url_holder">' ;
echo '<p style="margin: 2px 0;"><a href="' . $link . '&preview=on&testdata=on' . $preview_options . '" title="" target="_blank" class="srv_ico spaceRight"><span class="faicon test large"></span> ' . $lang [ 'srv_survey_testdata2' ] . '</b></a>' ;
echo '<span class="spaceLeft italic">(' . $lang [ 'srv_testdata_text' ] . ')</span></p>' ;
echo '<p style="margin: 2px 0;">' . $lang [ 'url' ] . ': ' . $link . '&preview=on&testdata=on' . $preview_options ;
2021-07-20 17:18:21 +02:00
echo '<a href="#" onclick="CopyToClipboard(\'' . $link . '&preview=on&testdata=on' . $preview_options . '\');" return false;" title="Kopiraj povezavo" class="srv_ico">'
. '  '
. '<span class="faicon copy"></span></a>' ;
2020-08-14 13:36:36 +02:00
echo ' (<a href="#" id="popup-open" onclick="javascript:testiranje_preview_settings(); return false;">' . $lang [ 'srv_testrianje_how' ] . '</a>)</p>' ;
echo '</div>' ;
2022-03-23 16:32:53 +01:00
} */
echo '<div class="publish_url_holder">' ;
2020-08-14 13:36:36 +02:00
2022-03-23 16:32:53 +01:00
//Zlistamo vse lepe url-je
$title = 0 ;
2022-03-18 00:38:05 +01:00
$sqll = sisplet_query ( " SELECT id, link FROM srv_nice_links WHERE ank_id = ' $this->anketa ' ORDER BY id ASC " );
while ( $rowl = mysqli_fetch_assoc ( $sqll )) {
2022-03-23 16:32:53 +01:00
if ( $title == 0 ) {
echo '<p class="semi-bold survey_links">' . $lang [ 'srv_publication_survey_niceurl' ] . '</p>' ;
$title = 1 ;
}
2022-03-18 00:38:05 +01:00
$link_nice = $site_url . $rowl [ 'link' ];
2022-03-23 16:32:53 +01:00
echo '<div class="niceurl">' ;
echo '<a href="' . $link_nice . '" target="_blank">' . $link_nice . '</a>' . ( count ( $lang_array ) > 0 ? ' - ' . $base_lang_resp : '' );
echo '<span class="faicon blue copy" onclick="CopyToClipboard(\'' . $link_nice . '\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="' . $lang [ 'srv_publication_survey_copylink' ] . '"></span>' ;
echo '<a href="ajax.php?a=nice_url_remove&anketa=' . $this -> anketa . '&nice_url=' . $rowl [ 'id' ] . '" title="' . $lang [ 'srv_copy_remove' ] . '"><span class="faicon trash empty"></span></a>' ;
echo '</div>' ;
}
2020-08-14 13:36:36 +02:00
2022-03-23 16:32:53 +01:00
echo '<p class="semi-bold survey_links">' . $lang [ 'srv_publication_survey_grouplang' ] . '</p>' ;
// Navaden url
2020-08-14 13:36:36 +02:00
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$p -> include_lang ( $p -> lang_resp );
$base_lang_resp = $lang [ 'language' ];
$p -> include_base_lang ();
2021-09-30 14:11:09 +02:00
$link1 = $site_url . 'a/' . $row [ 'hash' ];
2022-03-18 00:38:05 +01:00
echo '<div class="grouplang">' ;
echo '<a href="' . $link1 . '" target="_blank">' . $link1 . '</a>' . ( count ( $lang_array ) > 0 ? ' - ' . $base_lang_resp : '' );
echo '<span class="faicon blue copy" onclick="CopyToClipboard(\'' . $link1 . '\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="' . $lang [ 'srv_publication_survey_copylink' ] . '"></span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Imamo vec linkov za skupine
$ss = new SurveySkupine ( $this -> anketa );
$spr_id = $ss -> hasSkupine ();
if ( $spr_id > 0 ){
$vrednosti = $ss -> getVrednosti ( $spr_id );
foreach ( $vrednosti as $vrednost ){
$link_skupine = isset ( $vrednost [ 'nice_url' ]) ? $vrednost [ 'nice_url' ] : $vrednost [ 'url' ];
2022-03-18 00:38:05 +01:00
echo '<div class="grouplang">' ;
echo '<a href="' . $link_skupine . '" target="_blank">' . $link_skupine . '</a>' . ( count ( $lang_array ) > 0 ? ' - ' . $base_lang_resp : '' ) . ' - ' . $vrednost [ 'naslov' ];
echo '<span class="faicon blue copy" onclick="CopyToClipboard(\'' . $link_skupine . '\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="' . $lang [ 'srv_publication_survey_copylink' ] . '"></span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
// Imamo vec linkov za jezike
if ( count ( $lang_array ) > 0 ) {
foreach ( $lang_array AS $lang_id => $lang_name ) {
2022-03-18 00:38:05 +01:00
echo '<div class="grouplang">' ;
echo '<a href="' . $link . '?language=' . $lang_id . '" target="_blank">' . $link . '?language=' . $lang_id . '</a> - ' . $lang_name ;
echo '<span class="faicon blue copy" onclick="CopyToClipboard(\'' . $link . '?language=' . $lang_id . '\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="' . $lang [ 'srv_publication_survey_copylink' ] . '"></span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $spr_id > 0 ){
foreach ( $vrednosti as $vrednost ){
$link_skupine = isset ( $vrednost [ 'nice_url' ]) ? $vrednost [ 'nice_url' ] : $vrednost [ 'url' ];
2022-03-18 00:38:05 +01:00
echo '<div class="grouplang">' ;
echo '<a href="' . $link_skupine . '&language=' . $lang_id . '" target="_blank">' . $link_skupine . '&language=' . $lang_id . '</a> - ' . $lang_name . ' - ' . $vrednost [ 'naslov' ];
echo '<span class="faicon blue copy" onclick="CopyToClipboard(\'' . $link_skupine . '&language=' . $lang_id . '\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="' . $lang [ 'srv_publication_survey_copylink' ] . '"></span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
}
}
}
function displayInvSurveyPopup () {
global $lang ;
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_popup_title' ] . ':</legend>' ;
echo '<p><span onclick="$(\'#popup\').toggle(); $(\'#popup textarea\').click();" class="as_link">' . $lang [ 'srv_embed_js' ] . Help :: display ( 'srv_popup_js' ) . '</span></p>' ;
echo '<p id="popup" ' . ( $_GET [ 'js' ] != 'open' ? 'style="display:none"' : '' ) . '><textarea id="pop" style="width: 99%; height:80px" onclick="this.select();" readonly>' . $this -> getPopup () . '</textarea></p>' ;
echo '</fieldset>' ;
}
/**
* nastavitve za obveščanje na email
*
*/
function email_nastavitve ( $show_fieldset = true ) {
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
# echo '<div id="anketa_edit">';
// če ni aktivna damo opozorilo
echo '<form name="settingsanketa_' . $row [ 'id' ] . '" action="ajax.php?a=editanketasettings&m=vabila" method="post" autocomplete="off">' . " \n \r " ;
echo '<input type="hidden" name="submited" value="1" />' . " \n \r " ;
echo '<div id="userCodeSettings1">' ;
$this -> respondenti_iz_baze ( $row , $show_fieldset );
echo '</div>' ;
if ( $admin_type == 0 ) {
if ( $show_fieldset ) {
echo '<fieldset><legend>' . $lang [ 'srv_show_mail_with_data' ] . '</legend>' ;
} else {
echo '<p class="strong">4.' . $lang [ 'srv_show_mail_with_data' ] . '</p>' ;
}
echo '<span>' . $lang [ 'srv_show_mail_with_data2' ] . ': </span>' ;
echo '<input type="radio" name="show_email"' . ( $row [ 'show_email' ] == 0 ? ' checked' : '' ) . ' value="0">' . $lang [ 'no' ] . ' ' ;
echo '<input type="radio" name="show_email"' . ( $row [ 'show_email' ] == 1 ? ' checked' : '' ) . ' value="1">' . $lang [ 'yes' ] . ' ' ;
echo '<p>* ' . $lang [ 'srv_show_mail_with_data3' ] . '</p>' ;
if ( $show_fieldset ) {
echo '</fieldset>' ;
}
}
echo '</form>' ;
echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;"><span>' ;
// echo '<img src="icons/icons/disk.png" alt="" vartical-align="middle" />';
echo $lang [ 'edit1337' ] . '</span></a></div></span>' ;
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
#echo '</div>';
}
/**
* vrne kodo ankete , ki se jo uporabi za embed
*
*/
function getEmbed ( $js = true ) {
global $site_url ;
$link = SurveyInfo :: getSurveyLink ();
SurveyInfo :: getInstance () -> SurveyInit ( $this -> anketa );
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$iframe = '<iframe id="1ka" src="' . $link . '?e=1" height="500px" width="100%" scrolling="auto" frameborder="0"></iframe>' ;
$javascript = '<script type="text/javascript">function r(){var a=window.location.hash.replace("#","");if(a.length==0)return;document.getElementById("1ka").style.height=a+"px";window.location.hash=""};window.setInterval("r()",100);'
. '</script>' ;
if ( $js )
return htmlentities ( $iframe . $javascript , ENT_QUOTES );
else
return htmlentities ( $iframe , ENT_QUOTES );
}
/**
* vrne kodo ankete , ki se jo uporabi za popup embed
*
*/
function getPopup () {
global $site_url ;
$link = SurveyInfo :: getSurveyLink () . '&popup=1' ;
SurveyInfo :: getInstance () -> SurveyInit ( $this -> anketa );
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$javascript = '<script type="text/javascript">window.onload=function() {var body=document.getElementsByTagName("body")[0];var div=document.createElement("div");var iframe=document.createElement("iframe");div.setAttribute("id","popup_div");div.setAttribute("style","position:fixed; top:0; right:0; bottom:0; left:0; background:#000; opacity:0.5");iframe.setAttribute("id","popup_iframe");iframe.setAttribute("src","' . $link . '");iframe.setAttribute("style","position: fixed; top:10%; left:50%; margin-left:-400px; background:#fff; height:80%; width:800px;");iframe.setAttribute("scrolling","auto");iframe.setAttribute("frameborder","0");body.appendChild(div);body.appendChild(iframe)}</script>' ;
// Dodatek ce bomo delali se naprej popup embed (cross domain problem)
//if(window.addEventListener){window.addEventListener("message", function(e){if(e.data == "closePopup"){document.getElementById("popup_iframe").remove();document.getElementById("popup_div").remove();}});}
return htmlentities ( $javascript , ENT_QUOTES );
}
/**
* @ desc prika ? e nastavitve alerta za formo
*/
function alert_nastavitve () { //OSTANE
global $lang ;
global $site_url ;
global $admin_type ;
$anketa = $this -> anketa ;
2021-12-23 03:31:10 +01:00
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
/* moznosti :
* 'complete' -> obvsetilo o izpolnjeni anketi ( respondent , respondent iz cms , avtor + dostop , dodatn - emaili )
* 'delete' -> obvestilo o izbrisani anketi ( avtor + dostop , dodatni - emaili )
* 'active' -> obvestilo o aktivnosti , neaktivnosti ankete ( avtor + dostop , dodatni - emaili )
* 'expire' -> obvestilo o izteku ankete ( avtor + dostop , dodatni - emaili )
* 'email_server' -> nastavitve mail streznika
*/
if ( isset ( $_GET [ 'm' ]) && $_GET [ 'm' ] != " " ) {
$tab = $_GET [ 'm' ];
}
else {
$tab = $_GET [ 'm' ] = 'complete' ;
}
// preberemo nastavitve alertov
$sqlAlert = sisplet_query ( " SELECT * FROM srv_alert WHERE ank_id = ' $anketa ' " );
if ( ! $sqlAlert )
echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
if ( mysqli_num_rows ( $sqlAlert ) > 0 ) {
$rowAlert = mysqli_fetch_array ( $sqlAlert );
}
else {
SurveyAlert :: getInstance () -> Init ( $anketa , $global_user_id );
$rowAlert = SurveyAlert :: setDefaultAlertBeforeExpire ();
}
$days = $rowAlert [ 'expire_days' ];
$sqlS = sisplet_query ( " SELECT id, expire, survey_type, insert_uid, DATE_SUB(expire,INTERVAL $days DAY) as newdate FROM srv_anketa WHERE id = ' $anketa ' " );
if ( ! $sqlS ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
$rowS = mysqli_fetch_array ( $sqlS );
$rowAlert [ 'newdate' ] = $rowS [ 'newdate' ];
$sqlu = sisplet_query ( " SELECT email FROM users WHERE id = ' $rowS[insert_uid] ' " );
$rowu = mysqli_fetch_array ( $sqlu );
$MailReply = $rowu [ 'email' ];
$custom_alert = array ();
$sql_custom_alert = sisplet_query ( " SELECT uid, type FROM srv_alert_custom WHERE ank_id = ' $this->anketa ' " );
while ( $row_custom_alert = mysqli_fetch_array ( $sql_custom_alert )) {
$custom_alert [ $row_custom_alert [ 'type' ]][ $row_custom_alert [ 'uid' ]] = 1 ;
}
if ( $tab == 'complete' ) {
2022-01-05 02:43:52 +01:00
//Obveščanje o izpolnjeni anketi
2020-08-14 13:36:36 +02:00
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m=' . $tab . '" method="post" autocomplete="off">' . " \n " ;
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . " \n " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="m" value="' . $_GET [ 'm' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n " ;
2022-01-05 02:43:52 +01:00
echo ' <fieldset>' ;
echo ' <legend>' . $lang [ 'srv_alert_completed_2' ] . '</legend>' ;
2022-01-05 17:46:49 +01:00
echo '<div class="setting_holder alert_prejemniki">' ;
2022-01-05 02:43:52 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_alert_completed_prejemniki' ] . '</span>' ;
// respondent - ne prikazemo ce gre za glasovanje oz. volitve
2021-04-19 13:22:00 +02:00
if ( $rowS [ 'survey_type' ] != 0 && ! SurveyInfo :: getInstance () -> checkSurveyModule ( 'voting' )){
2022-01-05 02:43:52 +01:00
echo '<div class="setting_item" id="label_alert_finish_respondent">' ;
2021-04-19 13:22:00 +02:00
echo '<input type="checkbox" name="alert_finish_respondent" id="alert_finish_respondent" value="1" onChange="change_alert_respondent(\'finish_respondent\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ( $rowAlert [ 'finish_respondent' ] == 1 ? ' checked' : '' ) . '>' ;
$this -> display_alert_label ( 'finish_respondent' ,( $rowAlert [ 'finish_respondent' ] == 1 ));
2022-01-05 02:43:52 +01:00
echo '</div>' ;
2022-01-05 17:46:49 +01:00
// Ce imamo vec prevodov omogocimo za vsak prevod svoj email
2021-04-19 13:22:00 +02:00
$this -> display_alert_label ( 'finish_respondent_language' ,( $rowAlert [ 'finish_respondent' ] == 1 ));
2022-01-05 02:43:52 +01:00
2021-04-19 13:22:00 +02:00
}
2022-01-05 02:43:52 +01:00
// respondent iz cms ne prikazemo ce gre za volitve
2021-04-19 13:24:30 +02:00
if ( ! SurveyInfo :: getInstance () -> checkSurveyModule ( 'voting' )){
2022-01-05 02:43:52 +01:00
echo '<div class="setting_item" id="label_alert_finish_respondent_cms">' ;
2022-01-05 17:46:49 +01:00
echo '<input type="checkbox" name="alert_finish_respondent_cms" id="alert_finish_respondent_cms" value="1" onChange="change_alert_respondent(\'finish_respondent_cms\', $(this)); change_alert_instruction($(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ( $rowAlert [ 'finish_respondent_cms' ] == 1 ? ' checked' : '' ) . '>' ;
2021-04-19 13:24:30 +02:00
$this -> display_alert_label ( 'finish_respondent_cms' ,( $rowAlert [ 'finish_respondent_cms' ] == 1 ));
2022-01-05 02:43:52 +01:00
echo '</div>' ;
2021-04-19 13:22:00 +02:00
2022-01-05 02:43:52 +01:00
}
//Avtor ankete oz. souredniki
echo '<div class="setting_item" id="label_alert_finish_author">' ;
echo '<input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="change_alert_respondent(\'finish_author\', $(this));return false;"' . ( $rowAlert [ 'finish_author' ] == 1 ? ' checked' : '' ) . '>' ;
2021-04-19 13:22:00 +02:00
$this -> display_alert_label ( 'finish_author' ,( $rowAlert [ 'finish_author' ] == 1 ));
2022-01-05 02:43:52 +01:00
echo '</div>' ;
2021-04-19 13:22:00 +02:00
2022-01-05 02:43:52 +01:00
//Posebej navedeni maili
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_finish_other" id="alert_finish_other" value="1"' . (( $rowAlert [ 'finish_other' ] == 1 || ( $rowAlert [ 'finish_other_emails' ] && $rowAlert [ 'finish_other' ] != 0 )) ? ' checked' : '' ) . ' onchange="toggleStatusAlertOtherCheckbox(\'finish_other\'); if ( ! $(this).attr(\'checked\') ) { $(\'form[name=alertanketa_' . $anketa . ']\').submit(); }"><label for="alert_finish_other">' . $lang [ 'email_prejemniki' ] . '</label>' ;
2022-01-05 17:46:49 +01:00
echo ' <a href="#" onclick="alert_custom(\'other\', \'0\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2021-04-19 13:22:00 +02:00
echo ' <a href="#" onclick="alert_edit_if(\'4\'); return false;"><span class="faicon if_add" ' . ( $rowAlert [ 'finish_other_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
2022-01-05 02:43:52 +01:00
if ( $rowAlert [ 'finish_other_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $rowAlert [ 'finish_other_if' ]); }
echo '</div>' ;
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
2022-01-05 02:43:52 +01:00
echo '<div class="setting_holder alert_other_emails ' . ( $rowAlert [ 'finish_other' ] == 0 ? 'displayNone' : '' ) . '" id="alert_holder_finish_other_emails">' ;
echo '<label for="alert_finish_other_emails">' . $lang [ 'email_prejemniki_one_per_line' ] . ':</label>' ;
echo '<textarea class="alert_other_emails" name="alert_finish_other_emails" id="alert_finish_other_emails">' . $rowAlert [ 'delete_other_emails' ] . '</textarea>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 13:29:30 +01:00
echo '</div>' ;
2022-01-05 02:43:52 +01:00
echo '<div id="obvescanje_sidebyside_holder">' ;
echo '<div id="obvescanje_sidebyside_left">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'message_content' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<label for="alert_finish_subject">' . $lang [ 'subject' ] . ': </label>' ;
echo '<input type="text" class="large wauto" id="alert_finish_subject" name="alert_finish_subject" value="' . ( $rowAlert [ 'finish_subject' ] ? $rowAlert [ 'finish_subject' ] : $lang [ 'srv_alert_finish_subject' ]) . '"/>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
2022-04-14 18:06:01 +02:00
echo '<label for="reply_to">' . $lang [ 'srv_replay_to' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . ': </label>' ;
2022-01-05 02:43:52 +01:00
echo '<input type="text" class="large wauto" id="reply_to" name="reply_to" value="' . ( $rowAlert [ 'reply_to' ] ? $rowAlert [ 'reply_to' ] : $MailReply ) . '"/>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rowAlert [ 'finish_text' ] != '' ) {
$text = $rowAlert [ 'finish_text' ];
}
else {
// Podpis
$signature = Common :: getEmailSignature ();
$text = nl2br ( $lang [ 'srv_alert_finish_text' ] . $signature );
}
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
2022-01-05 02:43:52 +01:00
echo '<div class="setting_holder">' ;
echo '<label class="bottom4" for="alert_finish_text">' . $lang [ 'message' ] . ':</label>' ;
echo '<textarea name="alert_finish_text" id="alert_finish_text">' . $text . '</textarea>' ;
echo '</div>' ;
echo '</div>' ;
//Navodila na desni
echo '<div id="obvescanje_sidebyside_right">' ;
echo '<div class="message_instructions">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'srv_alert_instruction1' ] . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction1a' ] . ':</p>' ;
echo '<div class="izpolnjena_spremenljivke">' ;
2020-08-14 13:36:36 +02:00
// ta se skriva, potreben respondent iz CMS, da dobi NAME
echo '<span id="alert_respondent_cms_instruction" class="' . ( $rowAlert [ 'finish_respondent_cms' ] == 1 ? '' : 'displayNone' ) . '">' . $lang [ 'srv_alert_instruction2' ] . '</span>' ;
2022-01-05 02:43:52 +01:00
echo '<p>' . $lang [ 'srv_alert_instruction_survey' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_date' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_site' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_url' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_pdf' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_rtf' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
# če imamo prepoznavanje uporabnik iz CMS, potem ponudimo tudi META_REFERAL_URL
2022-01-06 09:45:56 +01:00
if ( $rowAlert [ 'finish_respondent_cms' ] == 1 )
2022-01-05 02:43:52 +01:00
echo '<p>' . $lang [ 'srv_alert_instruction_meta_referer_url' ] . '</p>' ;
echo '</div>' ;
echo '<div class="izpolnjena_spremenljivke">' ;
2020-08-14 13:36:36 +02:00
$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=' $anketa ' ORDER BY g.vrstni_red, s.vrstni_red " );
$prefix = " " ;
2022-01-05 17:46:49 +01:00
2020-08-14 13:36:36 +02:00
while ( $rowSistemske = mysqli_fetch_assoc ( $sqlSistemske )) {
2022-01-05 17:46:49 +01:00
$prefix = $prefix . $rowSistemske [ 'variable' ] . ', ' ;
}
if ( $prefix != " " ) {
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction_available' ] . '</p>' ;
echo '<p class="bottom16">' . rtrim ( $prefix , " , " ) . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction_system' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_alert_instruction_sample' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
2022-01-05 17:46:49 +01:00
else { // ni sistemskih spremenljivk
echo '<p class="bold">' . $lang [ 'srv_alert_no_sys_var' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
2022-01-05 02:43:52 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-01-05 02:43:52 +01:00
echo '</div>' ;
echo '</div>' ;
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 02:43:52 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo ' </form>' ;
} else if ( $tab == 'expired' ) {
global $site_path , $global_user_id ;
2022-01-05 00:10:30 +01:00
//Obveščanje o izteku ankete
2020-08-14 13:36:36 +02:00
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m=' . $tab . '" method="post" autocomplete="off">' . " \n " ;
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . " \n " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="m" value="' . $_GET [ 'm' ] . '" />' . " \n " ;
2022-01-05 00:10:30 +01:00
echo ' <fieldset>' ;
echo ' <legend>' . $lang [ 'srv_alert_expired_2' ] . '</legend>' ;
echo '<div class="setting_holder">' ;
echo '<label for="alert_expire_days">' . $lang [ 'srv_alert_expire_days' ] . ':</label>' ;
echo '<input type="text" class="large w200" id="alert_expire_days" name="alert_expire_days" value="' . $rowAlert [ 'expire_days' ] . '" size="3" >' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:10:30 +01:00
echo '<div class="setting_holder">' ;
echo '<p class="bold">' . $lang [ 'srv_alert_expire_expire_at' ] . '</p>' ;
echo $rowS [ 'expire' ] . $lang [ 'at' ] . '00:00' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:10:30 +01:00
echo '<div class="setting_holder">' ;
echo '<p class="bold">' . $lang [ 'srv_alert_expire_note_at' ] . '</p>' ;
echo '<p><span id="calc_alert_expire">' . $rowAlert [ 'newdate' ] . '</span><span>' . $lang [ 'at' ] . '01:00</span></p>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_alert_expire_prejemniki' ] . '</span>' ;
echo '<div class="setting_item" id="label_alert_expire_author">' ;
echo '<input type="checkbox" name="alert_expire_author" id="alert_expire_author" value="1" onChange="change_alert_respondent(\'expire_author\', $(this));return false;"' . ( $rowAlert [ 'expire_author' ] == 1 ? ' checked' : '' ) . '>' ;
2020-08-14 13:36:36 +02:00
$this -> display_alert_label ( 'expire_author' ,( $rowAlert [ 'expire_author' ] == 1 ));
2022-01-05 00:10:30 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:10:30 +01:00
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_expire_other" id="alert_expire_other" value="1"' . (( $rowAlert [ 'expire_other' ] == 1 || ( $rowAlert [ 'expire_other_emails' ] && $rowAlert [ 'expire_other' ] != 0 )) ? ' checked' : '' ) . ' onchange="toggleStatusAlertOtherCheckbox(\'expire_other\');"><label for="alert_expire_other">' . $lang [ 'email_prejemniki' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:10:30 +01:00
echo '<div class="setting_item">' ;
echo '<div class="setting_holder alert_other_emails ' . ( $rowAlert [ 'expire_other' ] == 0 ? 'displayNone' : '' ) . '" id="alert_holder_expire_other_emails">' ;
echo '<label for="alert_expire_other_emails">' . $lang [ 'email_prejemniki_one_per_line' ] . ':</label>' ;
echo '<textarea class="alert_other_emails" name="alert_expire_other_emails" id="alert_expire_other_emails" >' . $rowAlert [ 'expire_other_emails' ] . '</textarea>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div id="obvescanje_sidebyside_holder">' ;
echo '<div id="obvescanje_sidebyside_left">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'message_content' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<label for="subject">' . $lang [ 'subject' ] . ': </label>' ;
echo '<input type="text" class="large wauto" id="alert_delete_subject" id="alert_expire_subject" name="alert_expire_subject" value="' . ( $rowAlert [ 'expire_subject' ] ? $rowAlert [ 'expire_subject' ] : $lang [ 'srv_alert_expire_subject' ]) . '"/>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rowAlert [ 'expire_text' ] != '' ){
$text = $rowAlert [ 'expire_text' ];
}
else {
// Podpis
$signature = Common :: getEmailSignature ();
$text = nl2br ( $lang [ 'srv_alert_expire_text' ] . $signature );
}
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
2022-01-05 00:10:30 +01:00
echo '<div class="setting_holder">' ;
echo '<label class="bottom4" for="alert_expire_text">' . $lang [ 'message' ] . ':</label>' ;
echo '<textarea name="alert_expire_text" id="alert_expire_text">' . $text . '</textarea>' ;
echo '</div>' ;
echo '</div>' ;
//Navodila na desni
echo '<div id="obvescanje_sidebyside_right">' ;
echo '<div class="message_instructions">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'srv_alert_instruction1' ] . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction1a' ] . ':</p>' ;
echo '<p class="bottom16">' . $lang [ 'srv_alert_instruction4' ] . '</p>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '</fieldset>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo '</form>' ;
2022-01-05 00:10:30 +01:00
}
// Obveščanje o spremembi aktivnosti ankete
else if ( $tab == 'active' ) {
2020-08-14 13:36:36 +02:00
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m=' . $tab . '" method="post" autocomplete="off">' . " \n " ;
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . " \n " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="m" value="' . $_GET [ 'm' ] . '" />' . " \n " ;
echo '<fieldset>' ;
2022-01-05 00:52:44 +01:00
echo '<legend>' . $lang [ 'srv_alert_active_2' ] . '</legend>' ;
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_alert_active_prejemniki' ] . '</span>' ;
echo '<div class="setting_item" id="label_alert_active_author">' ;
echo '<input type="checkbox" name="alert_active_author" id="alert_active_author" value="1" onChange="change_alert_respondent(\'active_author\', $(this));return false;"' . ( $rowAlert [ 'active_author' ] == 1 ? ' checked' : '' ) . '>' ;
$this -> display_alert_label ( 'active_author' ,( $rowAlert [ 'active_author' ] == 1 ));
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_active_other" id="alert_active_other" value="1"' . (( $rowAlert [ 'active_other' ] == 1 || ( $rowAlert [ 'active_other_emails' ] && $rowAlert [ 'active_other' ] != 0 )) ? ' checked' : '' ) . ' onchange="toggleStatusAlertOtherCheckbox(\'active_other\');"><label for="alert_active_other">' . $lang [ 'email_prejemniki' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<div class="setting_holder alert_other_emails ' . ( $rowAlert [ 'active_other' ] == 0 ? 'displayNone' : '' ) . '" id="alert_holder_active_other_emails">' ;
echo '<label for="alert_active_other_emails">' . $lang [ 'email_prejemniki_one_per_line' ] . ':</label>' ;
echo '<textarea class="alert_other_emails" name="alert_active_other_emails" id="alert_active_other_emails">' . $rowAlert [ 'active_other_emails' ] . '</textarea>' ;
echo '</div>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div id="obvescanje_sidebyside_holder">' ;
echo '<div id="obvescanje_sidebyside_left">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'message_content' ] . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_oblika_deactivate_note' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<label for="subject">' . $lang [ 'subject' ] . ': </label>' ;
echo '<input type="text" class="large wauto" id="alert_active_subject0" name="alert_active_subject0" value="' . ( $rowAlert [ 'active_subject0' ] ? $rowAlert [ 'active_subject0' ] : $lang [ 'srv_alert_active_subject0' ]) . '"/>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rowAlert [ 'active_text0' ] != '' ) {
$text0 = $rowAlert [ 'active_text0' ];
}
else {
// Podpis
$signature = Common :: getEmailSignature ();
$text0 = nl2br ( $lang [ 'srv_alert_active_text0' ] . $signature );
}
2022-01-05 00:52:44 +01:00
2020-08-14 13:36:36 +02:00
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
2022-01-05 00:52:44 +01:00
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:52:44 +01:00
echo '<label class="bottom4" for="alert_active_text0">' . $lang [ 'message' ] . ':</label>' ;
2022-05-03 09:22:14 +02:00
echo '<textarea name="alert_active_text0" id="alert_active_text0">' . $text0 . '</textarea>' ;
2022-01-05 00:52:44 +01:00
echo '</div>' ;
echo '<p class="bold top32 bottom16">' . $lang [ 'srv_alert_oblika_activate_note' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<label for="subject">' . $lang [ 'subject' ] . ': </label>' ;
echo '<input type="text" class="large wauto" id="alert_active_subject1" name="alert_active_subject1" value="' . ( $rowAlert [ 'active_subject1' ] ? $rowAlert [ 'active_subject1' ] : $lang [ 'srv_alert_active_subject1' ]) . '"/>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rowAlert [ 'active_text1' ] != '' ) {
$text1 = $rowAlert [ 'active_text1' ];
}
else {
// Podpis
$signature = Common :: getEmailSignature ();
$text1 = nl2br ( $lang [ 'srv_alert_active_text1' ] . $signature );
}
2022-01-05 00:52:44 +01:00
echo '<div class="setting_holder">' ;
echo '<label class="bottom4" for="alert_active_text1">' . $lang [ 'message' ] . ':</label>' ;
2022-05-03 09:22:14 +02:00
echo '<textarea name="alert_active_text1" id="alert_active_text1">' . $text1 . '</textarea>' ;
2022-01-05 00:52:44 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:52:44 +01:00
//Navodila na desni
echo '<div id="obvescanje_sidebyside_right">' ;
echo '<div class="message_instructions">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'srv_alert_instruction1' ] . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction1a' ] . ':</p>' ;
echo '<p class="bottom16">' . $lang [ 'srv_alert_instruction5' ] . '</p>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-01-05 00:52:44 +01:00
echo '</div>' ;
echo '</fieldset>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-01-05 00:52:44 +01:00
2020-08-14 13:36:36 +02:00
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo '</form>' ;
2022-01-05 00:52:44 +01:00
}
else if ( $tab == 'delete' ) {
2020-08-14 13:36:36 +02:00
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m=' . $tab . '" method="post" autocomplete="off">' . " \n " ;
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . " \n " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="m" value="' . $_GET [ 'm' ] . '" />' . " \n " ;
2022-01-05 17:46:49 +01:00
//Obveščanje o izbrisu ankete
2021-12-17 10:36:31 +01:00
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_alert_surveydelete' ] . '</legend>' ;
2021-12-17 11:55:40 +01:00
echo '<div class="setting_holder">' ;
2021-12-23 03:31:10 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_alert_surveydelete_text' ] . '</span>' ;
2021-12-23 14:37:41 +01:00
echo '<div class="setting_item" id="label_alert_delete_author">' ;
2021-12-23 03:31:10 +01:00
echo '<input type="checkbox" name="alert_delete_author" id="alert_delete_author" value="1" onChange="change_alert_respondent(\'delete_author\', $(this));return false;"' . ( $rowAlert [ 'delete_author' ] == 1 ? ' checked' : '' ) . '>' ;
$this -> display_alert_label ( 'delete_author' ,( $rowAlert [ 'delete_author' ] == 1 ));
2021-12-17 11:55:40 +01:00
echo '</div>' ;
2021-12-23 03:31:10 +01:00
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_delete_other" id="alert_delete_other" value="1"' . (( $rowAlert [ 'delete_other' ] == 1 || ( $rowAlert [ 'delete_other_emails' ] && $rowAlert [ 'delete_other' ] != 0 )) ? ' checked' : '' ) . ' onchange="toggleStatusAlertOtherCheckbox(\'delete_other\');"><label for="alert_delete_other">' . $lang [ 'email_prejemniki' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
2022-01-05 00:10:30 +01:00
echo '<div class="setting_holder alert_other_emails ' . ( $rowAlert [ 'delete_other' ] == 0 ? 'displayNone' : '' ) . '" id="alert_holder_delete_other_emails">' ;
2021-12-23 03:31:10 +01:00
echo '<label for="alert_delete_other_emails">' . $lang [ 'email_prejemniki_one_per_line' ] . ':</label>' ;
2022-01-05 00:10:30 +01:00
echo '<textarea class="alert_other_emails" name="alert_delete_other_emails" id="alert_delete_other_emails">' . $rowAlert [ 'delete_other_emails' ] . '</textarea>' ;
2021-12-17 11:55:40 +01:00
echo '</div>' ;
2021-12-23 03:31:10 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-23 03:31:10 +01:00
echo '</div>' ;
2021-12-17 10:36:31 +01:00
2021-12-23 03:31:10 +01:00
echo '<div id="obvescanje_sidebyside_holder">' ;
echo '<div id="obvescanje_sidebyside_left">' ;
echo '<p class="bold caps bottom16">' . $lang [ 'message_content' ] . '</p>' ;
2021-12-17 10:36:31 +01:00
echo '<div class="setting_holder">' ;
echo '<label for="subject">' . $lang [ 'subject' ] . ': </label>' ;
echo '<input type="text" class="large wauto" id="alert_delete_subject" name="alert_delete_subject" value="' . ( $rowAlert [ 'delete_subject' ] ? $rowAlert [ 'delete_subject' ] : $lang [ 'srv_alert_delete_subject' ]) . '"/>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rowAlert [ 'delete_text' ] != '' ) {
$text = $rowAlert [ 'delete_text' ];
}
else {
// Podpis
$signature = Common :: getEmailSignature ();
$text = nl2br ( $lang [ 'srv_alert_delete_text' ] . $signature );
}
2022-01-05 00:52:44 +01:00
2020-08-14 13:36:36 +02:00
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
2021-12-17 10:36:31 +01:00
echo '<div class="setting_holder">' ;
2021-12-23 03:31:10 +01:00
echo '<label class="bottom4" for="alert_delete_text">' . $lang [ 'message' ] . ':</label>' ;
2022-01-05 00:10:30 +01:00
echo '<textarea name="alert_delete_text" id="alert_delete_text">' . $text . '</textarea>' ;
2021-12-17 10:36:31 +01:00
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2021-12-17 10:36:31 +01:00
echo '</div>' ;
//Navodila na desni
2021-12-23 03:31:10 +01:00
echo '<div id="obvescanje_sidebyside_right">' ;
2021-12-17 10:36:31 +01:00
echo '<div class="message_instructions">' ;
2021-12-24 00:52:31 +01:00
echo '<p class="bold caps bottom16">' . $lang [ 'srv_alert_instruction1' ] . '</p>' ;
echo '<p class="bold bottom16">' . $lang [ 'srv_alert_instruction1a' ] . ':</p>' ;
2021-12-24 11:41:21 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_alert_instruction5a' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
echo '</div>' ;
2021-12-17 10:36:31 +01:00
2021-12-23 03:31:10 +01:00
echo '</div>' ;
2021-12-17 10:36:31 +01:00
2021-12-23 03:31:10 +01:00
echo '</fieldset>' ;
2021-12-17 10:36:31 +01:00
2021-12-23 03:31:10 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS [ 'id' ] . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo '</form>' ;
} else if ( $tab == 'email_server' ) {
// Gorenje tega nima
2021-02-01 10:59:50 +01:00
if ( ! Common :: checkModule ( 'gorenje' ) && $admin_type == '0' )
2020-08-14 13:36:36 +02:00
$this -> viewServerSettings ();
} else {
print_r ( $tab );
}
?>
< script type = " text/javascript " >
alleditors_remove ();
if ( $ ( " #alert_finish_text " ) . length )
create_editor ( " alert_finish_text " , false );
if ( $ ( " #alert_expire_text " ) . length )
create_editor ( " alert_expire_text " , false );
if ( $ ( " #alert_active_text0 " ) . length )
create_editor ( " alert_active_text0 " , false );
if ( $ ( " #alert_active_text1 " ) . length )
create_editor ( " alert_active_text1 " , false );
if ( $ ( " #alert_delete_text " ) . length )
create_editor ( " alert_delete_text " , false );
$ ( " #alert_expire_days " ) . bind ( " keyup " , function ( e ) {
oldVal = this . value ;
newVal = this . value ;
if ( this . value . match ( / [ ^ 0 - 9 ] / g )) {
newVal = this . value . replace ( / [ ^ 0 - 9 ] / g , '' );
this . value = newVal ;
};
if ( oldVal == newVal ) // da ne postamo za vsako malenkost :)
recalc_alert_expire ( newVal );
});
</ script >
< ? php
}
function viewServerSettings (){
global $lang ;
global $admin_type ;
global $global_user_id ;
global $mysql_database_name ;
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_user_base_email_server_settings' ] . '</legend>' ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
// Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
$isEmail = ( int ) SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' );
if ( $isEmail )
echo '<p class="red bold">' . $lang [ 'srv_email_server_settings_warning' ] . '</p>' ;
echo '<form name="settingsanketa_' . $row [ 'id' ] . '" action="ajax.php?a=editanketasettings&m=email_server" method="post" autocomplete="off">' . " \n \r " ;
echo ' <input type="hidden" name="anketa" value="' . $this -> anketa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
echo ' <input type="hidden" name="m" value="' . $_GET [ 'm' ] . '" />' . " \n " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
$MA = new MailAdapter ( $this -> anketa );
// Dostop za posiljanje mailov preko 1ka serverja
$enabled1ka = ( $MA -> is1KA () || (( $admin_type == 0 ) && ( $mysql_database_name == 'www1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'real1kasi' || $mysql_database_name == '1kaarnessi' )) ) ? true : false ;
echo '<p>' ;
echo '<span class="bold">' . $lang [ 'srv_email_setting_select_server' ] . '</span> ' ;
echo '<label><input type="radio" name="SMTPMailMode" value="0" ' . ( $MA -> is1KA () ? 'checked ="checked" ' : '' ) . ' ' . ( $enabled1ka ? '' : ' disabled="disabled"' ) . ' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">' ;
echo $lang [ 'srv_email_setting_adapter0' ] . ' </label>' ;
// Google smtp je viden samo starim, kjer je ze vklopljen
if ( $MA -> isGoogle ()){
echo '<label><input type="radio" name="SMTPMailMode" value="1" ' . ( $MA -> isGoogle () ? 'checked ="checked" ' : '' ) . ' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">' ;
echo $lang [ 'srv_email_setting_adapter1' ] . ' </label>' ;
}
echo '<label><input type="radio" name="SMTPMailMode" value="2" ' . ( $MA -> isSMTP () ? 'checked ="checked" ' : '' ) . ' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">' ;
echo $lang [ 'srv_email_setting_adapter2' ] . ' </label>' ;
echo Help :: display ( 'srv_mail_mode' );
echo '</p>' ;
#1KA
$enkaSettings = $MA -> get1KASettings ( $raziskave = true );
echo '<div id="send_mail_mode0" ' . ( ! $MA -> is1KA () ? ' class="displayNone"' : '' ) . '>' ;
echo '<span class="bold">' . $lang [ 'srv_email_setting_settings' ] . '</span>' ;
echo '<br />' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<span>' . $enkaSettings [ 'SMTPFrom' ] . '</span><input type="hidden" name="SMTPFrom0" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo0" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
echo '</div>' ;
#GMAIL - Google
$enkaSettings = $MA -> getGoogleSettings ();
echo '<div id="send_mail_mode1" ' . ( ! $MA -> isGoogle () ? ' class="displayNone"' : '' ) . '>' ;
echo '<span class="italic">' . $lang [ 'srv_email_setting_adapter1_note' ] . '</span><br />' ;
echo '<br /><span class="bold">' . $lang [ 'srv_email_setting_settings' ] . '</span><br />' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<input type="text" name="SMTPFrom1" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo1" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
#Password
echo '<p><label>' . $lang [ 'srv_email_setting_password' ] . '<input type="password" name="SMTPPassword1" placeholder="' . $lang [ 'srv_email_setting_password_placeholder' ] . '"></label>' ;
echo '</p>' ;
echo '</div>' ;
#SMTP
$enkaSettings = $MA -> getSMTPSettings ();
echo '<div id="send_mail_mode2" ' . ( ! $MA -> isSMTP () ? ' class="displayNone"' : '' ) . '>' ;
echo '<span class="italic">' . $lang [ 'srv_email_setting_adapter2_note' ] . '</span><br />' ;
echo '<br /><span class="bold">' . $lang [ 'srv_email_setting_settings' ] . '</span><br />' ;
# from - NICE
echo '<p><label>' . $lang [ 'srv_email_setting_from_nice' ] . '<input type="text" name="SMTPFromNice2" value="' . $enkaSettings [ 'SMTPFromNice' ] . '"></label>' ;
echo '</p>' ;
# from
echo '<p><label>' . $lang [ 'srv_email_setting_from' ] . '<input type="text" name="SMTPFrom2" value="' . $enkaSettings [ 'SMTPFrom' ] . '"></label>' ;
echo '</p>' ;
# replyTo
2022-04-14 18:06:01 +02:00
echo '<p><label>' . $lang [ 'srv_email_setting_reply' ] . Help :: display ( 'srv_obvescanje_odgovorZa' ) . '<input type="text" name="SMTPReplyTo2" value="' . $enkaSettings [ 'SMTPReplyTo' ] . '" ></label>' ;
2020-08-14 13:36:36 +02:00
echo '</p>' ;
#Username
echo '<p><label>' . $lang [ 'srv_email_setting_username' ] . '<input type="text" name="SMTPUsername2" value="' . $enkaSettings [ 'SMTPUsername' ] . '" ></label>' ;
echo '</p>' ;
#Password
echo '<p><label>' . $lang [ 'srv_email_setting_password' ] . '<input type="password" name="SMTPPassword2" placeholder="' . $lang [ 'srv_email_setting_password_placeholder' ] . '"></label>' ;
echo '</p>' ;
#autentikacija
echo '<p>' ;
echo $lang [ 'srv_email_setting_autentication' ];
echo '<label><input type="radio" name="SMTPAuth2" value="0" ' . (( int ) $enkaSettings [ 'SMTPAuth' ] != 1 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_no' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPAuth2" value="1" ' . (( int ) $enkaSettings [ 'SMTPAuth' ] == 1 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_yes' ] . '</label>' ;
echo '</p>' ;
#Varnost SMTPSecure
echo '<p>' ;
echo $lang [ 'srv_email_setting_encryption' ];
echo '<label><input type="radio" name="SMTPSecure2" value="0" ' . (( int ) $enkaSettings [ 'SMTPSecure' ] == 0 ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_none' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPSecure2" value="ssl" ' . ( $enkaSettings [ 'SMTPSecure' ] == 'ssl' ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_ssl' ] . '</label>' ;
echo '<label><input type="radio" name="SMTPSecure2" value="tls" ' . ( $enkaSettings [ 'SMTPSecure' ] == 'tls' ? 'checked ="checked" ' : '' ) . '>' ;
echo $lang [ 'srv_email_setting_encryption_tls' ] . '</label>' ;
echo '</p>' ;
#port
echo '<p><label>' . $lang [ 'srv_email_setting_port' ] . '<input type="number" min="0" max="65535" name="SMTPPort2" value="' . ( int ) $enkaSettings [ 'SMTPPort' ] . '" style="width:80px;"></label>' ;
echo ' ' . $lang [ 'srv_email_setting_port_note' ];
echo '</p>' ;
#host
echo '<p><label>' . $lang [ 'srv_email_setting_host' ] . '<input type="text" name="SMTPHost2" value="' . $enkaSettings [ 'SMTPHost' ] . '" ></label>' ;
echo '</p>' ;
#delay
2020-10-29 12:25:14 +01:00
echo '<p><label>' . $lang [ 'srv_email_setting_smtp_delay' ] . ' ' . Help :: display ( 'srv_inv_delay' ) . ': <select name="SMTPDelay2">'
/*. '<option value="0" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 0 " ? 'selected="selected"' : '' ) . '>0 </option>'
2020-08-14 13:36:36 +02:00
. '<option value="10000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 10000 " ? 'selected="selected"' : '' ) . '>0.01 sec (max 100 / sec)</option>'
. '<option value="20000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 20000 " ? 'selected="selected"' : '' ) . '>0.02 sec (max 50 / sec)</option>'
. '<option value="50000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 50000 " ? 'selected="selected"' : '' ) . '>0.05 sec (max 20 / sec)</option>'
. '<option value="100000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 100000 " ? 'selected="selected"' : '' ) . '>0.1 sec (max 10 / sec)</option>'
2020-10-29 12:25:14 +01:00
. '<option value="200000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 200000 " ? 'selected="selected"' : '' ) . '>0.2 sec (max 5 / sec)</option>' */
2020-08-14 13:36:36 +02:00
. '<option value="500000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 500000 " ? 'selected="selected"' : '' ) . '>0.5 sec (max 2 / sec)</option>'
. '<option value="1000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 1000000 " ? 'selected="selected"' : '' ) . '>1 sec (max 1 / sec)</option>'
. '<option value="2000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 2000000 " ? 'selected="selected"' : '' ) . '>2 sec (max 30 / min)</option>'
. '<option value="4000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 4000000 " ? 'selected="selected"' : '' ) . '>4 sec (max 15 / min)</option>'
. '<option value="5000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 5000000 " ? 'selected="selected"' : '' ) . '>5 sec (max 12 / min)</option>'
. '<option value="10000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 10000000 " ? 'selected="selected"' : '' ) . '>10 sec (max 6 / min)</option>'
. '<option value="20000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 20000000 " ? 'selected="selected"' : '' ) . '>20 sec (max 3 / min)</option>'
. '<option value="30000000" ' . ( $enkaSettings [ 'SMTPDelay' ] == " 30000000 " ? 'selected="selected"' : '' ) . '>30 sec (max 2 / min)</option>'
. '</select></label>' ;
echo '</p>' ;
echo '</div>' ;
echo '</form>' ;
echo '</fieldset>' ;
// Gumb shrani
echo '<span class="floatLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;">' ;
echo $lang [ 'srv_email_setting_btn_save' ] . '</a></div></span>' ;
// Gumb preveri nastavitve
echo '<span id="send_mail_mode_test" class="floatLeft spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;">' ;
echo $lang [ 'srv_email_setting_btn_test' ] . '</a></div></span>' ;
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save" style="float:left; display:inline; margin: -2px 0 0 0;"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
}
/**
* @ desc poslje maile userjem iz baze
*/
function usermailing () { //OSTANE
global $lang ;
global $site_url ;
global $site_path ;
global $global_user_id ;
// preverimo aktivnost
//$sql = sisplet_query("SELECT active FROM srv_anketa WHERE id = '$this->anketa'");
//$row = mysqli_fetch_array($sql);
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
// ce ne postamo ali ce anketa ni aktivna
if ( ! isset ( $_POST [ 'mailto' ]) || ( $row [ 'active' ] != 1 )) {
echo '<div id="" style="float:left; width:50%;">' ;
echo '<div id="anketa_aktivacija_note" class="div_error">' ;
$this -> anketa_aktivacija_note ();
echo '</div>' ;
echo '<fieldset style="padding:10px; border:1px solid gray;"><legend>' . $lang [ 'srv_mailing' ] . ':</legend>' ;
echo '<form name="frm_mailto_preview" id="frm_mailto_preview" action="index.php?anketa=' . $this -> anketa . '&a=email&m=usermailing" method="post" autocomplete="off">' ;
echo '<p><input name="mailto" value="all" type="radio" checked="">' . $lang [ 'srv_mailing_all' ] . '</p>' ;
echo '<p><input name="mailto" value="norsp" type="radio">' . $lang [ 'srv_mailing_nonrsp' ] . '</p>' ;
echo '<p><input name="mailto" value="rsp" type="radio">' . $lang [ 'srv_mailing_rsp' ] . '</p>' ;
echo '<p><input name="mailto" id="radio_mailto_status" value="status" type="radio">' . $lang [ 'srv_mailing_all_with_status' ] . ':</p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="0" type="checkbox">0 - ' . $lang [ 'srv_userstatus_0' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="1" type="checkbox">1 - ' . $lang [ 'srv_userstatus_1' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="2" type="checkbox">2 - ' . $lang [ 'srv_userstatus_2' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="3" type="checkbox">3 - ' . $lang [ 'srv_userstatus_3' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="4" type="checkbox">4 - ' . $lang [ 'srv_userstatus_4' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="5" type="checkbox">5 - ' . $lang [ 'srv_userstatus_5' ] . '</div></p>' ;
echo '<p><div style="padding-left:150px"><input name="mailto_status[]" value="6" type="checkbox">6 - ' . $lang [ 'srv_userstatus_6' ] . '</div></p>' ;
echo '<script type="text/javascript">' ;
echo '$(document).ready(function() {' ;
echo '$(\'[name="mailto_status[]"]\').bind("click", function () {change_mailto_status();});' ;
echo '$(\'[name="mailto"]\').bind("click", function(el) { change_mailto_radio(); });' ;
echo '});' ;
echo '</script>' ;
echo '<div id="btn_mailto_preview_holder">' ;
$this -> displayBtnMailtoPreview ( $row );
echo '</div>' ;
// echo '<input type="submit">';
echo '</form>' ;
echo '</fieldset>' ;
echo '</div>' ;
echo '<div id="mailto_right" style="float:left; width:50%;">' ;
$sa = new SurveyAdmin ( 1 , $this -> anketa );
$sa -> show_mailto_users ( 'all' , null );
echo '</div>' ;
} else { // pošljemo emaile
$errorMsg = null ;
//v odvisnosti od statusa polovimo emaile
$mailto_radio = $_POST [ 'mailto' ];
$mailto_status = ( isset ( $_POST [ 'mailto_status' ]) && count ( $_POST [ 'mailto_status' ]) > 0 ) ? implode ( " , " , $_POST [ 'mailto_status' ]) : null ;
$sa = new SurveyAdmin ( 1 , $this -> anketa );
$arrayMailtoSqlString = $sa -> getMailtoSqlString ( $mailto_radio , $mailto_status );
$errorMsg = $arrayMailtoSqlString [ 'errorMsg' ];
$sqlString = $arrayMailtoSqlString [ 'sqlString' ];
// preberemo tekst za trenutno anketo
$subject = " " ;
$text = " " ;
$sql_userbase_email = sisplet_query ( " SELECT * FROM srv_userbase_setting WHERE ank_id = ' $this->anketa ' " );
if ( mysqli_num_rows ( $sql_userbase_email ) > 0 ) {
// anketa že ima nastavljen text
$row_userbase_email = mysqli_fetch_array ( $sql_userbase_email );
} 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_email = mysqli_fetch_array ( $sql_userbase_invitations );
}
if ( $row_userbase_email [ 'replyto' ] == '' ) {
$sqluu = sisplet_query ( " SELECT email FROM users WHERE id = ' $global_user_id ' " );
$rowuu = mysqli_fetch_array ( $sqluu );
$row_userbase_email [ 'replyto' ] = $rowuu [ 'email' ];
}
// poiščemo sistemske spremenljivke iz vsebine
preg_match_all ( " /#(.*?)#/s " , $row_userbase_email [ 'text' ], $sisVars );
// poiščemo sistemske spremenljivke iz vsebine
$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' ]);
}
}
$sql_userbase = sisplet_query ( " SELECT MAX(b.tip) AS tip FROM srv_userbase b, srv_user u WHERE b.usr_id=u.id AND u.ank_id=' $this->anketa ' " );
if ( ! $sql_userbase )
echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
$row_userbase = mysqli_fetch_array ( $sql_userbase );
$tip = $row_userbase [ 'tip' ] + 1 ;
if ( $errorMsg == null ) {
$sql = sisplet_query ( $sqlString );
// preprečimo izisovanje warningov
$warnings_msg = " " ;
$send_success = array ();
$send_errors = array ();
// ob_start();
// $htmlContent = ob_get_contents();
// ob_start();
$cnt = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
// dodamo sistemske spremenljivke in poiščemo njihove vrednosti
$userSysData = array ();
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 = '" . $row[' 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 )
$userSysData [ strtolower ( $sysVar )] = $rowUser [ 'text' ];
}
$email = $userSysData [ 'email' ];
if ( trim ( $email ) != '' && $email != null ) {
// shranimo komu in kdaj je kdo poslal mail
sisplet_query ( " INSERT INTO srv_userbase (usr_id, tip, datetime, admin_id) VALUES (' $row[id] ', ' $tip ', NOW(), ' " . $this -> uid () . " ') " );
$url = SurveyInfo :: getSurveyLink () . '?code=' . $row [ 'pass' ] . '' ;
if ( trim ( $row [ 'pass' ]) != '' ) {
$unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this -> anketa . '&code=' . $row [ 'pass' ] . '' ;
} else {
$unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this -> anketa . '&email=' . trim ( $email ) . '&uid=' . $row [ 'id' ];
}
// zamenjamo sistemske vrednosti
$content = $row_userbase_email [ 'text' ];
// za staro verzijo
$content = str_replace ( '[URL]' , '#URL#' , $content );
$content = str_replace ( '[CODE]' , '#CODE#' , $content );
$content = str_replace ( array (
'#URL#' ,
'#CODE#' ,
), array (
'<a href="' . $url . '">' . $url . '</a>' ,
$row [ 'pass' ],
), $content );
$content = str_replace ( '#UNSUBSCRIBE#' , '<a href="' . $unsubscribe . '">' . $lang [ 'user_bye_hl' ] . '</a>' , $content );
// poiščemo prestale variable katere je potrebno zamenjati v vsebini
preg_match_all ( " /#(.*?)#/s " , $content , $toReplace );
foreach ( $toReplace [ 0 ] as $key => $seed ) {
$content = str_replace ( $toReplace [ 0 ][ $key ], $userSysData [ strtolower ( $toReplace [ 1 ][ $key ])], $content );
}
$subject = $row_userbase_email [ 'subject' ];
try
{
$MA = new MailAdapter ( $this -> anketa , $type = 'alert' );
$MA -> addRecipients ( $email );
if ( $cnt ++ == 0 )
{ # en mail pošljemo tudi na enklikanketa
$MA -> addRecipients ( 'enklikanketa@gmail.com' );
}
$resultX = $MA -> sendMail ( stripslashes ( $content ), $subject );
}
catch ( Exception $e )
{
}
if ( $resultX ) {
$status = 1 ; // poslalo ok
$send_success [] = $email ;
} else {
$status = 2 ; // ni poslalo
$send_errors [] = $email ;
}
// nastavimo status
sisplet_query ( " INSERT INTO srv_userstatus (usr_id, tip, status, datetime) VALUES (' $row[id] ', ' $tip ', ' $status ', NOW()) " );
# laststatus updejtamo samo če je bil pred tem status 0 - email še ni poslan ali 2 - napaka pri pošiljanju maila
sisplet_query ( " UPDATE srv_user SET last_status = ' $status ' WHERE id = ' $row[id] ' AND last_status IN (0,2) " );
}
// počistimo warninge
// ob_end_clean();
// echo $htmlContent;
}
echo '<b>Spodnje sporočilo:</b><br/><br/>' . $row_userbase_email [ 'subject' ] . ',<br/> ' . $row_userbase_email [ 'text' ] . '<br/>' ;
if ( count ( $send_success ) > 0 ) {
echo '<b>je bilo uspešno poslano na naslednje naslove:<br/></b>' ;
foreach ( $send_success as $email ) {
echo $email . " ,<br/> " ;
}
}
if ( count ( $send_errors ) > 0 ) {
echo '<br/><b>ni bilo uspešno poslano. Pri pošiljanju na naslednje naslove je prišlo do napake:<br/></b>' ;
foreach ( $send_errors as $email ) {
echo $email . " ,<br/> " ;
}
}
//echo '<br/>Done';
// izpipemo warninge na koncu
} else {
echo '<div id="div_error" class="red"><img src="icons/icons/error.png" alt="" vartical-align="middle" />' . $errorMsg . '</div>' ;
}
}
}
/**
* @ desc prikaze tab Socialna omrezja
*/
function SN_Settings () {
global $lang ;
global $site_url ;
global $site_path ;
2022-01-20 13:53:57 +01:00
echo '<p class="top16 bottom16">' . $lang [ 'srv_social_settings_text1' ] . '</p>' ;
echo '<p class="bottom16">' . $lang [ 'srv_social_settings_text2' ] . $lang [ 'srv_social_settings_text3' ] . $lang [ 'srv_social_settings_text4' ] . '</p>' ;
echo '<p>' . $lang [ 'srv_social_settings_text5' ] . '<a href="index.php?anketa=\'.$this->anketa.\'">' . $lang [ 'srv_social_settings_text6' ] . '</a>.</p>' ;
2020-08-14 13:36:36 +02:00
// Omrežja so sestavljane vprašanja. Začnejo se iz generatorja imen (name generator). S tem respondent (ego) navede objekte, prijatelje - alterje. , s katerim pridobimo imena pzanke in vprašanj. Druga kompnenta je zanka, ki za vse alterje določenega ega sproži enaka vprašanja. Dretja komponenta so vprašanja. Primer omrežja je tukaj, http://www.1ka.si/a/3510, vprašalnik pa najdemo v knjižnjic med Primerov 1KA anket http://www.1ka.si/admin/survey/index.php?a=knjiznica
}
/**
* @ desc prikaze tab arhivi
*/
2022-02-16 22:14:05 +01:00
function arhivi () {
2020-08-14 13:36:36 +02:00
global $lang ;
2022-01-13 07:36:39 +01:00
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<legend >' . $lang [ 'srv_questionnaire_archives' ] . '</legend>' ;
2022-01-13 07:36:39 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_questionnaire_archives_text' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo $lang [ 'srv_questionnaire_archives_note' ] . ':' ;
echo '<input class="large w400" name="intro_opomba" id="intro_opomba" type="text"/>' ;
echo '</div>' ;
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder bottom16">' ;
2022-01-13 07:36:39 +01:00
echo '<button class="medium blue" type="button" href="index.php?anketa=' . $this -> anketa . '&a=backup_create" onclick="create_archive_survey(\'' . $this -> anketa . '\',\'' . $lang [ 'srv_wait_a_moment' ] . '\'); return false;">' . $lang [ 'srv_backup_button' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Seznam ustvarjenih arhivov
$sql = sisplet_query ( " SELECT a.id, a.naslov, a.intro_opomba, a.insert_time, a.edit_time, CONCAT(i.name, ' ', i.surname) AS insert_name, CONCAT(e.name, ' ', e.surname) AS edit_name FROM srv_anketa a, users i, users e WHERE a.insert_uid=i.id AND a.edit_uid=e.id AND a.backup = ' $this->anketa ' AND a.active>='0' ORDER BY a.insert_time DESC " );
if ( ! $sql ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
2022-01-13 07:36:39 +01:00
if ( mysqli_num_rows ( $sql ) > 0 ) {
2022-01-18 14:49:38 +01:00
echo '<p class="bold">' . $lang [ 'srv_backup_list' ] . ':</p>' ;
2022-01-13 07:36:39 +01:00
echo '<table id="survey_archives_table">' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_questionnaire_archives_date' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_questionnaire_archives_by' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_questionnaire_archives_note2' ] . '</th>' ;
echo '<th></th>' ;
echo '</tr>' ;
while ( $row = mysqli_fetch_array ( $sql )) {
echo '<tr>' ;
echo '<td>' . datetime ( $row [ 'insert_time' ]) . '</td>' ;
echo '<td>' . $row [ 'insert_name' ] . '</td>' ;
2022-01-13 10:39:21 +01:00
if ( $row [ 'intro_opomba' ] == '' )
$opomba = " / " ;
else if ( strlen ( $row [ 'intro_opomba' ]) > 40 )
$opomba = substr ( $row [ 'intro_opomba' ], 0 , 37 ) . '...' ;
else
$opomba = $row [ 'intro_opomba' ];
echo '<td>' . $opomba . '</td>' ;
2022-01-13 07:36:39 +01:00
//Ikone
echo '<td class="right">' ;
echo '<div class="icon_holder multiple">' ;
echo '<a class="faicon" href="#" onclick="javascript:anketa_delete(\'' . $row [ 'id' ] . '\', \'' . $lang [ 'srv_anketadeleteconfirm' ] . '\'); return false;"><span class="faicon trash empty"></span></a>' ;
echo '<button class="table-inline white-black caps" type="button" onclick="window.location.href=\'index.php?anketa=' . $row [ 'id' ] . '&a=backup_restore\'">' . $lang [ 'srv_questionnaire_archives_activate' ] . '</button>' ;
echo '</div>' ;
echo '</td>' ;
echo '</tr>' ;
}
echo '</table>' ;
2020-08-14 13:36:36 +02:00
}
2022-01-13 07:36:39 +01:00
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
function arhivi_data () {
global $lang ;
2022-02-03 23:48:58 +01:00
echo '<fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<legend>' . $lang [ 'srv_arhiv_data' ] . '</legend>' ;
2022-02-03 23:48:58 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_backup_data_text' ] . '</p>' ;
echo '<div class="button_holder bottom16">' ;
echo '<button class="medium blue" type="button" href="ajax.php?anketa=' . $this -> anketa . '&a=backup_data" onclick="create_archive_survey_data(\'' . $this -> anketa . '\',\'' . $lang [ 'srv_wait_a_moment' ] . '\'); return false;">' . $lang [ 'srv_backup_data_label' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-02-03 23:48:58 +01:00
// Seznam ustvarjenih arhivov - 2. faza: kdo je arhiviral, opomba, možnost izbrisa
2020-08-14 13:36:36 +02:00
$backups = array ();
if ( $handle = opendir ( dirname ( __FILE__ ) . '/SurveyBackup/' )) {
while ( false !== ( $entry = readdir ( $handle ))) {
if ( $entry != " . " && $entry != " .. " ) {
$file = explode ( '-' , $entry );
if ( $file [ 0 ] == $this -> anketa ) {
$backups [] = $entry ;
}
}
}
closedir ( $handle );
}
if ( count ( $backups ) > 0 ) {
2022-02-03 23:48:58 +01:00
echo '<p class="bold">' . $lang [ 'srv_backup_data_list' ] . ':</p>' ;
echo '<table id="survey_data_archives_table">' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_questionnaire_archives_date' ] . '</th>' ;
echo '<th></th>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
foreach ( $backups AS $file ) {
$e = explode ( '-' , $file );
$e [ 2 ] = str_replace ( '.1ka' , '' , $e [ 2 ]);
2022-02-03 23:48:58 +01:00
$e [ 2 ] = str_replace ( '.' , ':' , $e [ 2 ]);
$e [ 2 ] = substr ( $e [ 2 ], 0 , - 3 );
echo '<tr>' ;
echo '<td>' . $e [ 1 ] . ' ' . $e [ 2 ] . '</td>' ;
//Ikone
echo '<td class="right">' ;
echo '<div class="icon_holder multiple">' ;
//echo '<a class="faicon" href="#" onclick="delete_funkcija_todo"><span class="faicon trash empty"></span></a>';
echo '<button class="table-inline white-black caps" type="button" onclick="window.location.href=\'ajax.php?anketa=' . $this -> anketa . '&a=backup_restore&filename=' . $file . '\'">' . $lang [ 'srv_questionnaire_archives_activate' ] . '</button>' ;
echo '</div>' ;
echo '</td>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
2022-02-03 23:48:58 +01:00
echo '</table>' ;
2020-08-14 13:36:36 +02:00
}
echo '</fieldset>' ;
}
function arhivi_testdata () {
global $lang ;
2022-02-16 01:43:28 +01:00
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_arhiv_testdata' ] . '</legend>' ;
$link = SurveyInfo :: getSurveyLink ();
$surveyName = SurveyInfo :: getInstance () -> getSurveyTitle ();
$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' : '' ) . '' ;
echo '<p class="bottom16">' . $lang [ 'srv_archive_test_data_text1' ] . '<a href="index.php?anketa=' . $this -> anketa . '&a=testiranje&m=testnipodatki">' . $lang [ 'srv_archive_test_data_text1a' ] . '</a>' . $lang [ 'srv_archive_test_data_text2' ] . '<a href="' . $link . '&preview=on&testdata=on' . $preview_options . '" title="" target="_blank">' . $lang [ 'srv_archive_test_data_text2a' ] . '</a>' . $lang [ 'srv_archive_test_data_text3' ] . '</p>' ;
2022-02-16 18:58:57 +01:00
//Nimamo nobenih vnosov
$str_testdata_any = " SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id=' " . $this -> anketa . " ' AND (testdata='1' OR testdata='2') GROUP BY day(time_insert) " ;
$query_testdata_any = sisplet_query ( $str_testdata_any );
list ( $testdata_any ) = mysqli_fetch_row ( $query_testdata_any );
if (( int ) $testdata_any == 0 ) {
echo '<p class="top16">' . $lang [ 'srv_archive_test_data_none1' ] . $surveyName . $lang [ 'srv_archive_test_data_none2' ] . $lang [ 'srv_archive_test_data_none3' ] . '.</p>' ;
}
else { // Imamo vnose, izpišemo eno ali obe tabeli
// Avtomatski vnosi
$str_testdata = " SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id=' " . $this -> anketa . " ' AND (testdata='2') GROUP BY day(time_insert) " ;
$query_testdata = sisplet_query ( $str_testdata );
$table_exists1 = 0 ;
while ( $testdata = mysqli_fetch_array ( $query_testdata )) {
// Izpišemo naslov in začetek tabele
if ( $table_exists1 == 0 && $testdata [ cnt ] != 0 ) {
echo '<p class="bold">' . $lang [ 'srv_archive_test_data_timeline_auto' ] . $surveyName . ':</p>' ;
echo '<table id="testni_vnosi">' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_archive_test_data_date' ] . '</th>' ;
echo '<th class="right">' . $lang [ 'srv_archive_test_data_count' ] . '</th>' ;
echo '</tr>' ;
$table_exists1 = 1 ;
}
2022-02-16 01:43:28 +01:00
echo '<tr>' ;
2022-02-16 18:58:57 +01:00
echo '<td>' . date ( " d.m.Y " , strtotime ( $testdata [ time ])) . '</td>' ;
echo '<td class="right">' . $testdata [ cnt ] . '</td>' ;
2022-02-16 01:43:28 +01:00
echo '</tr>' ;
2022-02-16 18:58:57 +01:00
}
2022-02-16 01:43:28 +01:00
2022-02-16 18:58:57 +01:00
if ( $table_exists1 == 1 ) {
echo '</table>' ;
2022-02-16 01:43:28 +01:00
}
2022-02-16 18:58:57 +01:00
// Ročni vnosi
$str_testdata = " SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id=' " . $this -> anketa . " ' AND (testdata='1') GROUP BY day(time_insert) " ;
$query_testdata = sisplet_query ( $str_testdata );
$table_exists2 = 0 ;
while ( $testdata = mysqli_fetch_array ( $query_testdata )) {
// Izpišemo naslov in začetek tabele
if ( $table_exists2 == 0 && $testdata [ cnt ] != 0 ) {
echo '<p class="bold top16">' . $lang [ 'srv_archive_test_data_timeline_manual' ] . $surveyName . ':</p>' ;
echo '<table id="testni_vnosi">' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_archive_test_data_date' ] . '</th>' ;
echo '<th class="right">' . $lang [ 'srv_archive_test_data_count' ] . '</th>' ;
echo '</tr>' ;
$table_exists2 = 1 ;
}
2022-02-16 01:43:28 +01:00
echo '<tr>' ;
2022-02-16 18:58:57 +01:00
echo '<td>' . date ( " d.m.Y " , strtotime ( $testdata [ time ])) . '</td>' ;
echo '<td class="right">' . $testdata [ cnt ] . '</td>' ;
2022-02-16 01:43:28 +01:00
echo '</tr>' ;
}
2022-02-16 18:58:57 +01:00
if ( $table_exists2 == 1 ) {
echo '</table>' ;
}
2022-02-16 01:43:28 +01:00
}
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
function arhivi_survey () {
global $lang ;
2022-01-27 20:59:12 +01:00
// Izvoz samo ankete
2020-08-14 13:36:36 +02:00
if ( $_GET [ 'm' ] == 'survey' ){
echo '<fieldset>' ;
2022-04-14 18:06:01 +02:00
echo '<legend>' . $lang [ 'srv_survey_archives_ie_title' ] . Help :: display ( 'srv_arhiv_vprasalnik' ) . '</legend>' ;
2020-08-14 13:36:36 +02:00
2022-01-27 18:36:30 +01:00
echo '<p>' . $lang [ 'srv_survey_archives_note_survey' ] . '</p>' ;
2022-01-27 20:59:12 +01:00
echo '<div class="button_holder top16 bottom0">' ;
2022-01-27 18:44:43 +01:00
echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?a=archive_download&anketa=' . $this -> anketa . '\';" >' . $lang [ 'srv_survey_archives_export' ] . '</button>' ;
2022-01-27 18:36:30 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
2022-01-27 18:44:43 +01:00
2022-01-27 20:59:12 +01:00
// Izvoz ankete s podatki
2020-08-14 13:36:36 +02:00
else {
echo '<fieldset>' ;
2022-04-14 18:06:01 +02:00
echo '<legend>' . $lang [ 'srv_survey_archives_ie_data_title' ] . Help :: display ( 'srv_arhiv_podatki' ) . '</legend>' ;
2022-01-27 18:44:43 +01:00
echo '<p>' . $lang [ 'srv_survey_archives_note_survey_data' ] . '</p>' ;
2022-01-27 20:59:12 +01:00
echo '<div class="button_holder top16 bottom0">' ;
2022-01-27 18:44:43 +01:00
echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?a=archive_download&anketa=' . $this -> anketa . '&data=true\';" >' . $lang [ 'srv_survey_archives_export' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
}
// Preveri ce gre za prvo popravljanje podatkov in ce da, potem ustvari arhiv podatkov
function checkFirstDataChange ( $inserted = false ){
global $connect_db ;
$sql = sisplet_query ( 'SELECT count(*) AS cnt FROM srv_tracking' . $this -> db_table . ' WHERE ank_id=\'' . $this -> anketa . ' \ '
AND ( `get` LIKE \ ' % edit_data % \ '
OR ( `get` LIKE \ ' % a : " data " , m : " quick_edit " % \ ' AND `get` LIKE \ ' % post : " 1 " % \ ' )
OR ( `get` LIKE \ ' % a : " dataCopyRow " % \ ' )
OR ( `get` LIKE \ ' % a : " dataDeleteMultipleRow " % \ ' )
OR ( `get` LIKE \ ' % a : " dataDeleteRow " % \ ' )
OR ( `get` LIKE \ ' % urejanje : " 1 " % \ ' AND status = \ ' 4 \ ' ))
ORDER BY datetime DESC ' );
$row = mysqli_fetch_array ( $sql );
// Naredimo arhiv podatkov
if ( $row [ 'cnt' ] == 0 || ( $inserted && $row [ 'cnt' ] == 1 )){
SurveyCopy :: setSrcSurvey ( $this -> anketa );
SurveyCopy :: setSrcConectDb ( $connect_db );
SurveyCopy :: saveArrayFile ( $data = true );
}
}
/**
* @ desc skopira anketo
*/
function anketa_copy ( $anketa = 0 ) { //OSTANE
// stara kopija kode je v classu class.SurveyCopy.php na dnu :)
global $connect_db ;
if ( $anketa > 0 )
$this -> anketa = $anketa ;
$site = $_GET [ 'site' ];
SurveyCopy :: setSrcSurvey ( $this -> anketa );
SurveyCopy :: setSrcConectDb ( $connect_db );
SurveyCopy :: setDestSite ( $site );
$new_anketa_id = SurveyCopy :: doCopy ();
$napake = SurveyCopy :: getErrors ();
if ( count ( $napake ) > 0 )
print_r ( $napake );
if ( ! $new_anketa_id )
die ( " Can not create new survey! " );
if ( ! $site || $site == 0 )
return $new_anketa_id ;
elseif ( $site != - 1 )
header ( " Refresh:1; url=index.php?anketa= $this->anketa &a=arhivi " );
}
/**
* @ desc kreira backup ( skopira celotno anketo v novo )
*/
function backup_create ( $NoRedirect = false ) { //OSTANE
$anketa = $this -> anketa_copy ();
sisplet_query ( " UPDATE srv_anketa SET backup=' $this->anketa ', active='0', naslov = CONCAT( naslov, ' ', DAY(NOW()), '.', MONTH(NOW()), '.', YEAR(NOW()) ), intro_opomba=' { $_POST [ 'intro_opomba' ] } ' WHERE id=' $anketa ' " );
// vsilimo refresh podatkov
SurveyInfo :: getInstance () -> resetSurveyData ();
if ( $NoRedirect == false ) {
header ( " Refresh:1; url=index.php?anketa= $this->anketa &a=arhivi " );
//header("Location: index.php?anketa=$this->anketa&a=arhivi");
}
}
/**
* @ desc kreira backup in da obvestilo o uspešnosti ( skopira celotno anketo v novo )
*/
function backup_create_popup () { //OSTANE
global $lang ;
$anketa = $this -> anketa_copy ();
sisplet_query ( " UPDATE srv_anketa SET backup=' $this->anketa ', active='0', naslov = CONCAT( naslov, ' ', DAY(NOW()), '.', MONTH(NOW()), '.', YEAR(NOW()) ) WHERE id=' $anketa ' " );
// vsilimo refresh podatkov
SurveyInfo :: getInstance () -> resetSurveyData ();
if ( $anketa > 0 || true ) {
echo $lang [ 'srv_backup_create_popup_ok' ];
}
echo '<span class="buttonwrapper floatRight spaceRight" title="' . $lang [ 'srv_backup_create_popup_view' ] . '"><a class="ovalbutton ovalbutton_orange" href="#" onclick="archivePopupView(); return false;"><span>' . $lang [ 'srv_backup_create_popup_view' ] . '</span></a></span>' ;
echo '<span class="buttonwrapper floatRight spaceRight" title="' . $lang [ 'srv_backup_create_popup_close' ] . '"><a class="ovalbutton ovalbutton_gray" href="#" onclick="archivePopupClose(); return false;"><span>' . $lang [ 'srv_backup_create_popup_close' ] . '</span></a></span>' ;
}
/**
* @ desc prenese arhivsko anketo v folderje
*/
function backup_restore () { //OSTANE
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$active = 0 ;
$backup = 0 ;
$sql = sisplet_query ( " UPDATE srv_anketa SET active=' $active ', backup=' $backup ' WHERE id = ' $this->anketa ' " );
// vsilimo refresh podatkov
SurveyInfo :: getInstance () -> resetSurveyData ();
header ( " Location: index.php?anketa= $this->anketa " );
}
/**
* prikaze tab z opcijami za vnos
*/
function vnos () {
global $lang ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
echo '<fieldset><legend>' . $lang [ 'settings' ] . '</legend>' ;
echo '<p>' . $lang [ 'srv_vnos_navodila' ] . '</p>' ;
/* echo '</fieldset>' ;
echo '<br />' ;
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_cookie' ] . '</legend>' ; */
//prepoznaj uporabnika iz sispleta
echo '<form name="settingsanketa_' . $row [ 'id' ] . '" action="ajax.php?a=editanketasettings" method="post" autocomplete="off">' . " \n \r " ;
echo ' <input type="hidden" name="anketa" value="' . $this -> anketa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="grupa" value="' . $this -> grupa . '" />' . " \n \r " ;
echo ' <input type="hidden" name="location" value="vnos" />' . " \n \r " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
echo '<span class="nastavitveSpan3 bold" ><label>' . $lang [ 'srv_mass_input' ] . ':</label></span>' ;
echo ' <input type="radio" name="mass_insert" value="1" id="mass_insert_1"' . ( $row [ 'mass_insert' ] == 1 ? ' checked="checked"' : '' ) . ' /><label for="mass_insert_1">' . $lang [ 'srv_mass_input_1' ] . '</label>' . " \n \r " ;
echo ' <input type="radio" name="mass_insert" value="0" id="mass_insert_0"' . ( $row [ 'mass_insert' ] == 0 ? ' checked="checked"' : '' ) . ' /><label for="mass_insert_0">' . $lang [ 'srv_mass_input_0' ] . '</label>' . " \n \r " ;
echo '<br />' ;
echo '<br />' ;
echo '</form>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<span class="floatLeft spaceRight">' ;
echo '<div class="buttonwrapper">' ;
echo '<a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="document.settingsanketa_' . $row [ 'id' ] . '.submit(); return false;" href="#">' ;
echo '<span>' . $lang [ 'edit1337' ] . '</span>' ;
echo '</a>' ;
echo '</div>' ;
echo '</span>' ;
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
}
/**
* @ desc prikaze tab za uporabnost - nastavitve
*/
function uporabnost () {
global $site_url ;
global $lang ;
2022-01-20 15:20:13 +01:00
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
SurveySetting :: getInstance () -> Init ( $this -> anketa );
if ( count ( $_POST ) > 0 && ( isset ( $_POST [ 'uporabnost_link' ]) || isset ( $_POST [ 'uporabnost_razdeli' ]))) {
$uporabnost_link = $_POST [ 'uporabnost_link' ];
$uporabnost = $_POST [ 'uporabnost' ];
sisplet_query ( " UPDATE srv_anketa SET uporabnost_link = ' $uporabnost_link ' WHERE id = ' $this->anketa ' " );
$sqlg = sisplet_query ( " SELECT id FROM srv_grupa WHERE ank_id = ' $this->anketa ' " );
while ( $rowg = mysqli_fetch_array ( $sqlg )) {
if ( isset ( $_POST [ 'uporabnost_link_' . $rowg [ 'id' ]])) {
SurveySetting :: getInstance () -> setSurveyMiscSetting ( 'uporabnost_link_' . $rowg [ 'id' ], $_POST [ 'uporabnost_link_' . $rowg [ 'id' ]]);
}
}
if ( isset ( $_POST [ 'uporabnost_razdeli' ])) {
SurveySetting :: getInstance () -> setSurveyMiscSetting ( 'uporabnost_razdeli' , $_POST [ 'uporabnost_razdeli' ]);
}
// vsilimo refresh podatkov
SurveyInfo :: getInstance () -> resetSurveyData ();
}
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
echo '<fieldset><legend>' . $lang [ 'settings' ] . '</legend>' ;
echo '<form action="index.php?anketa=' . $this -> anketa . '&a=uporabnost" name="settingsanketa_' . $this -> anketa . '" method="post">' ;
if ( $row [ 'uporabnost_link' ] == '' )
$row [ 'uporabnost_link' ] = 'http://' ;
2022-01-20 15:20:13 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vrsta_survey_note_4_3b' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'srv_uporabnost_link' ] . '</p>' ;
echo '<input type="text" class="large w400" name="uporabnost_link" value="' . $row [ 'uporabnost_link' ] . '">' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$uporabnost_razdeli = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'uporabnost_razdeli' );
2022-01-20 15:20:13 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_uporabnost_razdeli' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
2022-01-20 15:20:13 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" id="uporabnost_razdeli_0" name="uporabnost_razdeli" value="0" ' . ( $uporabnost_razdeli != 1 ? ' checked' : '' ) . '>' ;
echo '<label for="uporabnost_razdeli_0">' . $lang [ 'srv_vodoravno' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" id="uporabnost_razdeli_1" name="uporabnost_razdeli" value="1" ' . ( $uporabnost_razdeli == 1 ? ' checked' : '' ) . '>' ;
echo '<label for="uporabnost_razdeli_1">' . $lang [ 'srv_navpicno' ] . ' (' . $lang [ 'srv_razdeli_dodatno' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<p class="top16">' . $lang [ 'srv_uporabnost_warning' ] . '</p>' ;
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_uporabnost_nadaljne' ] . '</legend>' ;
2022-01-20 15:20:13 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_uporabnost_link_stran' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
$sqlg = sisplet_query ( " SELECT id, naslov FROM srv_grupa WHERE ank_id = ' $this->anketa ' ORDER BY vrstni_red ASC " );
while ( $rowg = mysqli_fetch_array ( $sqlg )) {
$link = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'uporabnost_link_' . $rowg [ 'id' ]);
if ( $link == '' )
$link = 'http://' ;
2022-01-20 15:20:13 +01:00
echo '<div class="setting_holder">' ;
echo '<p>' . $rowg [ 'naslov' ] . ':</p>' ;
echo '<input type="text" class="large w400" name="uporabnost_link_' . $rowg [ 'id' ] . '" value="' . $link . '">' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
echo '</fieldset>' ;
2022-01-20 15:20:13 +01:00
// Gumb shrani
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . '; return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.settingsanketa_' . $this -> anketa . '.submit(); return false;">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
}
/**
* @ desc prikaze vnose v anketo
*/
function displayIzvozi () {
global $lang , $site_url , $global_user_id ;
$sdf = SurveyDataFile :: get_instance ();
$sdf -> init ( $this -> anketa );
$headFileName = $sdf -> getHeaderFileName ();
$dataFileName = $sdf -> getDataFileName ();
$dataFileStatus = $sdf -> getStatus ();
if ( $dataFileStatus == FILE_STATUS_NO_DATA
|| $dataFileStatus == FILE_STATUS_NO_FILE
|| $dataFileStatus == FILE_STATUS_SRV_DELETED ){
Common :: noDataAlert ();
return false ;
}
if ( $_GET [ 'm' ] == 'excel' ) {
echo '<form id="export_excel_form" target="_blank" action="ajax.php?t=export&anketa=' . $this -> anketa . '&a=doexport&m=excel" method="POST">' ;
} else if ( $_GET [ 'm' ] == 'excel_xls' ) {
echo '<form id="export_excel_xls_form" target="_blank" action="ajax.php?t=export&anketa=' . $this -> anketa . '&a=doexport&m=excel_xls" method="POST">' ;
} else if ( $_GET [ 'm' ] == 'txt' ) {
echo '<form id="export_txt_form" target="_blank" action="ajax.php?t=export&anketa=' . $this -> anketa . '&a=doexport&m=txt" method="POST">' ;
} else if ( $_GET [ 'm' ] == 'spss' ) {
echo '<form id="export_spss_form" target="_blank" action="ajax.php?t=export&anketa=' . $this -> anketa . '&a=doexport&m=spss" method="POST">' ;
} else if ( $_GET [ 'm' ] == 'sav' ) {
echo '<form id="export_sav_form" target="_blank" action="ajax.php?t=export&anketa=' . $this -> anketa . '&a=doexport&m=sav" method="POST">' ;
}
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $_GET [ 'm' ] != 'export_PDF' ){
if ( session_id () == '' )
session_start ();
echo '<div id="div_export_setting_show">' ;
// Izvozi identifikatorje
echo '<label><input type="radio" name="exportSetting" id="hiddenSystem" value="2"' .
(( isset ( $_SESSION [ 'exportHiddenSystem' ]) && $_SESSION [ 'exportHiddenSystem' ] == true ) ? ' checked="checked"' : '' ) .
' onchange="exportChangeCheckbox(\'exportHiddenSystem\');"/>' . $lang [ 'srv_export_hidden_system' ]
. '</label>' ;
echo Help :: display ( 'exportSettings' );
echo '<br />' ;
// Izvozi podatke
echo '<label><input type="radio" name="exportSetting" id="onlyData" value="0"' .
(( isset ( $_SESSION [ 'exportOnlyData' ]) && $_SESSION [ 'exportOnlyData' ] == true ) ? ' checked="checked"' : '' ) .
' onchange="exportChangeCheckbox(\'exportOnlyData\');"/>' . $lang [ 'srv_export_only_data' ]
. '</label>' ;
echo '<br />' ;
// Izvozi podatke in parapodatke
echo '<label><input type="radio" name="exportSetting" id="fullMeta" value="1"' .
(( isset ( $_SESSION [ 'exportFullMeta' ]) && $_SESSION [ 'exportFullMeta' ] == true ) ? ' checked="checked"' : '' ) .
' onchange="exportChangeCheckbox(\'exportFullMeta\');"/>' . $lang [ 'srv_export_full_meta' ]
. '</label>' ;
echo Help :: display ( 'srv_export_full_meta' );
echo '<br />' ;
echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="$(\'#div_export_setting_show\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');return false;"><span>' . $lang [ 'srv_zapri' ] . '</span></a></div>' ;
echo '</div>' ;
}
# v odvisnosti od $_GET['m'] prikazemo podstran
if ( ! $_GET [ 'm' ] || $_GET [ 'm' ] == M_EXPORT_EXCEL ) {
echo '<fieldset><legend>' . $lang [ 'srv_lnk_excel' ] . '</legend>' ;
2022-01-13 22:42:58 +01:00
echo $lang [ 'srv_izvoz_Excel_note_a' ];
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder intext">' ;
2022-01-13 22:42:58 +01:00
echo '<button class="medium blue" onclick="doExcelExport(); return false;">' . $lang [ 'srv_izvoz_Excel_file' ] . '</button>' ;
echo '</div>' ;
echo '<p class="top16">' . $lang [ 'srv_izvoz_Excel_note_b' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
2022-01-13 22:42:58 +01:00
echo '<p class="top16 bottom16">' . $lang [ 'srv_izvoz_Excel_note_2' ] . '</p>' ;
echo '<div class="setting_holder">' ;
2022-04-14 18:06:01 +02:00
echo '<span class="setting_title">' . $lang [ 'srv_expor_excel_cell_delimiter' ] . Help :: display ( 'srv_izvozCSV_locitveni' ) . ':</span>' ;
2022-01-13 22:42:58 +01:00
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_delimit" id="export_delimit_semicolon" value="0" onchange="excelExportChangeDelimit(1); return false;" checked="checked"/>' ;
echo '<label for="export_delimit_semicolon">' . $lang [ 'srv_expor_excel_cell_delimiter1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="export_delimit" id="export_delimit_coma" value="1" onchange="excelExportChangeDelimit(2); return false;"/>' ;
echo '<label for="export_delimit_coma">' . $lang [ 'srv_expor_excel_cell_delimiter2' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="export_labels" id="export_labels" checked="checked" value="1"/>' ;
2022-04-14 18:06:01 +02:00
echo '<label for="export_labels">' . $lang [ 'srv_export_texts' ] . Help :: display ( 'srv_izvozCSV_tekst' ) . '</label>' ;
2022-01-13 22:42:58 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
} elseif ( $_GET [ 'm' ] == M_EXPORT_EXCEL_XLS ) {
echo '<fieldset><legend>' . $lang [ 'srv_lnk_excel_xls' ] . '</legend>' ;
2022-01-19 08:45:00 +01:00
echo $lang [ 'srv_izvoz_Excel_xls_note1' ];
echo '<div class="button_holder intext">' ;
echo '<button class="medium blue" onclick="doExcelXlsExport(); return false;">' . $lang [ 'srv_izvoz_Excel_xls_file' ] . '</button>' ;
echo '</div>' ;
2022-01-19 09:04:14 +01:00
echo '<p>' . $lang [ 'srv_izvoz_Excel_note_b' ] . ' ' . $lang [ 'srv_izvoz_Excel_xls_prirocnik' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
elseif ( $_GET [ 'm' ] == M_EXPORT_SPSS ) {
echo '<fieldset><legend>' . $lang [ 'srv_lnk_spss' ] . '</legend>' ;
2022-01-13 22:11:34 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_izvoz_SPSS_faq' ] . '</p>' ;
echo '<p class="bottom16">' . $lang [ 'srv_izvoz_SPSS_note' ] . '</p>' ;
echo '<p class="bold">' . $lang [ 'srv_izvoz_step1' ] . '</p>' ;
echo '<div class="export_indent">' ;
echo '<p>' . $lang [ 'srv_izvoz_step1_SPSS' ] . '</p>' ;
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder intext">' ;
2022-01-13 23:17:49 +01:00
echo '<button class="medium blue" onclick="doSpssExport(\'yes\'); return false;">' . $lang [ 'srv_izvoz_step1_SPSS_file' ] . '</button>' ;
2022-01-13 22:11:34 +01:00
echo '</div>' ;
echo '</div>' ;
echo '<p class="bold">' . $lang [ 'srv_izvoz_step2' ] . '</p>' ;
echo '<div class="export_indent">' ;
echo '<p>' . $lang [ 'srv_izvoz_step2a_SPSS' ] . '</p>' ;
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder intext">' ;
2022-01-13 23:17:49 +01:00
echo '<button class="medium blue" onclick="doSpssExport(\'no\'); return false;">' . $lang [ 'srv_izvoz_step2_SPSS_file' ] . '</button>' ;
2022-01-13 22:11:34 +01:00
echo '</div>' ;
echo '<p class="top16">' . $lang [ 'srv_izvoz_step2b_SPSS' ] . '</p>' ;
echo '</div>' ;
echo '<p class="bold">' . $lang [ 'srv_izvoz_step3' ] . '</p>' ;
echo '<div class="export_indent">' ;
echo '<ul>' ;
echo '<li>' . $lang [ 'srv_izvoz_step3a_SPSS' ] . '</li>' ;
echo '<li>' . $lang [ 'srv_izvoz_step3b_SPSS' ] . '</li>' ;
echo '<li class="no_bullet top16">' . $lang [ 'srv_izvoz_step3c_SPSS' ] . '</li>' ;
echo '</ul>' ;
echo '</div>' ;
echo '<p class="bold">' . $lang [ 'srv_izvoz_step4' ] . '</p>' ;
echo '<div class="export_indent">' ;
echo '<p>' . $lang [ 'srv_izvoz_step4_SPSS' ] . '</p>' ;
echo '</div>' ;
echo '<p class="bold">' . $lang [ 'srv_izvoz_step5' ] . '</p>' ;
echo '<div class="export_indent">' ;
echo '<p>' . $lang [ 'srv_izvoz_step5_SPSS' ] . '</p>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
elseif ( $_GET [ 'm' ] == M_EXPORT_SAV ) {
echo '<fieldset><legend>' . $lang [ 'srv_lnk_sav' ] . '</legend>' ;
2022-01-13 23:09:45 +01:00
echo $lang [ 'srv_izvoz_SAV_note1' ];
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder intext">' ;
2022-01-13 23:09:45 +01:00
echo '<button class="medium blue" onclick="doSAVExport(); return false;">' . $lang [ 'srv_izvoz_SAV_file' ] . '</button>' ;
echo '</div>' ;
echo '<p class="top16">' . $lang [ 'srv_izvoz_SAV_note2a' ] . '<a href="index.php?anketa=' . $this -> anketa . '&a=export&m=spss">' . $lang [ 'srv_izvoz_SAV_note2b' ] . '</a>' . $lang [ 'srv_izvoz_SAV_note2c' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
elseif ( $_GET [ 'm' ] == M_EXPORT_TXT ) {
echo '<fieldset><legend>' . $lang [ 'srv_lnk_txt' ] . '</legend>' ;
2022-01-13 22:18:23 +01:00
echo $lang [ 'srv_izvoz_txt_note' ];
2022-01-18 14:49:38 +01:00
echo '<div class="button_holder intext">' ;
2022-01-13 22:18:23 +01:00
echo '<button class="medium blue" onclick="doTxtExport(); return false;">' . $lang [ 'srv_izvoz_txt_file' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
elseif ( $_GET [ 'm' ] == 'export_PDF' ) {
$pageBreak = isset ( $_GET [ 'pageBreak' ]) ? $_GET [ 'pageBreak' ] : 0 ;
$type = isset ( $_GET [ 'type' ]) ? $_GET [ 'type' ] : 0 ;
$if = isset ( $_GET [ 'if' ]) ? $_GET [ 'if' ] : 0 ;
$font = isset ( $_GET [ 'font' ]) ? $_GET [ 'font' ] : 12 ;
echo '<span class="red bold">' . $lang [ 'srv_export_questionnare_0' ] . '</span>' ;
echo '<p>' ;
echo $lang [ 'srv_export_questionnare_1' ] . '<br /><br />' ;
echo $lang [ 'srv_export_questionnare_2' ];
echo '</p>' ;
# PDF in RTF izvoz rezultatov
echo '<fieldset>' ;
echo '<legend >' . $lang [ 'srv_lnk_PDF/RTF' ] . '</legend>' ;
echo '<a href="' . makeEncodedIzvozUrlString ( 'izvoz.php?a=pdf_results&anketa=' . $this -> anketa . '&pageBreak=' . $pageBreak . '&type=' . $type . '&if=' . $if . '&font=' . $font ) . '" target="_blank">' .
'<span class="faicon pdf"></span> PDF - (Adobe Acrobat)</a>' ;
echo '<br/>' ;
echo '<a href="' . makeEncodedIzvozUrlString ( 'izvoz.php?a=rtf_results&anketa=' . $this -> anketa . '&pageBreak=' . $pageBreak . '&type=' . $type . '&if=' . $if . '&font=' . $font ) . '" target="_blank">' ;
echo '<span class="faicon rtf"></span> DOC - (Microsoft Word)</a>' ;
echo '</fieldset>' ;
//vsak resp na svoji strani
echo '<fieldset>' ;
echo '<legend >' . $lang [ 'settings' ] . '</legend>' ;
echo '<span class="nastavitveSpan1" ><label>' . $lang [ 'srv_export_pagebreak' ] . ':</label></span>' ;
echo '<input type="radio" name="export_pagebreak" value="1" id="export_pagebreak_1" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=1&type=' . $type . '&if=' . $if . '&font=' . $font . '\');" ' . ( $pageBreak == 1 ? ' checked' : '' ) . ' /><label>' . $lang [ 'yes' ] . '</label>' ;
echo '<input type="radio" name="export_pagebreak" value="0" id="export_pagebreak_0" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=0&type=' . $type . '&if=' . $if . '&font=' . $font . '\');" ' . ( $pageBreak == 0 ? ' checked' : '' ) . ' /><label>' . $lang [ 'no1' ] . '</label>' ;
//dolg/kratek izpis vprasanj v pdf
echo '<br />' ;
echo '<span class="nastavitveSpan1" ><label>' . $lang [ 'srv_displaydata_type' ] . ':</label></span>' ;
echo '<input type="radio" name="type" value="0" id="type_0" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=0&if=' . $if . '&font=' . $font . '\');" ' . ( $type == 0 ? ' checked' : '' ) . ' /><label>' . $lang [ 'srv_displaydata_type0' ] . '</label>' ;
echo '<input type="radio" name="type" value="1" id="type_1" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=1&if=' . $if . '&font=' . $font . '\');" ' . ( $type == 1 ? ' checked' : '' ) . ' /><label>' . $lang [ 'srv_displaydata_type1' ] . '</label>' ;
echo '<input type="radio" name="type" value="2" id="type_2" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=2&if=' . $if . '&font=' . $font . '\');" ' . ( $type == 2 ? ' checked' : '' ) . ' /><label>' . $lang [ 'srv_displaydata_type2' ] . '</label>' ;
//prikaz if-ov
echo '<br />' ;
echo '<span class="nastavitveSpan1" ><label>' . $lang [ 'srv_export_if' ] . ':</label></span>' ;
echo '<input type="radio" name="if" value="1" id="if_1" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=' . $type . '&if=1&font=' . $font . '\');" ' . ( $if == 1 ? ' checked' : '' ) . ' /><label>' . $lang [ 'yes' ] . '</label>' ;
echo '<input type="radio" name="if" value="0" id="if_0" onclick="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=' . $type . '&if=0&font=' . $font . '\');" ' . ( $if == 0 ? ' checked' : '' ) . ' /><label>' . $lang [ 'no1' ] . '</label>' ;
//velikost fonta
echo '<br />' ;
echo '<span class="nastavitveSpan1" ><label>' . $lang [ 'srv_export_font' ] . ':</label></span>' ;
echo '<select name="font" onchange="vnos_redirect(\'' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=export&m=export_PDF&pageBreak=' . $pageBreak . '&type=' . $type . '&if=' . $if . '&font=\'+this.value);">' ;
for ( $i = 8 ; $i < 16 ; $i += 2 ){
echo '<option value="' . $i . '" ' . ( $i == $font ? ' selected' : '' ) . '>' . $i . '</option>' ;
}
echo '</select>' ;
//echo '<input type="radio" name="font" value="1" id="font_1" onclick="vnos_redirect(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=export&m=export_PDF&pageBreak='.$pageBreak.'&type='.$type.'&if='.$if.'&font='.$font.'\');" '.($type == 1 ? ' checked' : '').' /><label>' . $lang['yes'] . '</label>';
echo '</fieldset>' ;
}
echo '</form>' ;
}
/**
* @ desc prikaze vnose v anketo
* /
function displayVnosi () { //OSTANE
global $lang ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $_GET [ 'm' ] == 'SN_izvozi' ) {
echo '<div id="anketa_edit" style="min-height: 160px;">' . " \n \r " ;
//Excel izvozi
echo '<fieldset class="izvozi">' ;
echo '<legend>EXCEL IZVOZI</legend>' ;
echo '<div class="floatLeft" style="width:400px;">' ;
echo '<p><a href="exportexcel.php?anketa=' . $this -> anketa . '"><span>' . $lang [ 'srv_export' ] . ' EXCEL za EGE' . '</span></a></p> ' . " \n \r " ;
echo '<p><a href="exportexcel.php?anketa=' . $this -> anketa . '&tip=SN"><span>' . $lang [ 'srv_export' ] . ' EXCEL za ALTERJE' . '</span></a></p> ' . " \n \r " ;
echo '</div>' ;
echo '<div class="floatLeft" style="width:auto">' ;
echo '<div id="div_error">' ;
// echo '<img src="icons/icons/error.png" alt="" vartical-align="middle" />';
echo $lang [ 'srv_izvoz_Excel_note' ] . '</div>' ;
echo '</div>' ;
echo ' </fieldset>' ;
echo ' <br/>' ;
//SPSS izvozi
echo '<fieldset class="izvozi">' ;
echo '<legend>SPSS IZVOZI ZA EGE</legend>' ;
// echo '<p>Ker se pri nekaterih SPSS verzijah pri izvozu podatkov pojavljajo tezave, je treba izvoz datoteke s podatki opraviti v EXCELu, nato pa s spodnjimi SPSS datotekami s strukturami (sintaksami) podatke uvoziti v SPSS iz EXCELa.</p>';
echo '<div class="floatLeft" style="width:400px;">' ;
echo '<p>' . $lang [ 'srv_export' ] . ' SPSS: <a href="exportspss.php?anketa=' . $this -> anketa . '">' . $lang [ 'srv_structure' ] . '</a> ' . $lang [ 'srv_and' ] . '
< a href = " exportspss.php?anketa=' . $this->anketa . '&podatki=yes " > ' . $lang[' srv_data '] . ' </ a > </ p >
< p > ' . $lang[' srv_notext '] . ' :
< a href = " exportspss.php?anketa=' . $this->anketa . '&notext=yes " > ' . $lang[' srv_structure '] . ' </ a > ' . $lang[' srv_and '] . '
< a href = " exportspss.php?anketa=' . $this->anketa . '&notext=yes&podatki=yes " > ' . $lang[' srv_data '] . ' </ a >
</ p > ' . " \n \r " ;
echo '<p>' . $lang [ 'srv_metapodatki' ] . ' SPSS: <a href="exportspss.php?anketa=' . $this -> anketa . '&meta=yes">' . $lang [ 'srv_structure' ] . '</a> ' . $lang [ 'srv_and' ] . '
< a href = " exportspss.php?anketa=' . $this->anketa . '&podatki=yes&meta=yes " > ' . $lang[' srv_data '] . ' </ a > </ p > ' ;
echo '</div>' ;
echo '<div class="floatLeft" style="width:800px">' ;
echo '<div id="div_error">' ;
// echo '<img src="icons/icons/error.png" alt="" vartical-align="middle" />';
echo $lang [ 'srv_izvoz_SPSS_note' ] . '</div>' ;
echo '</div>' ;
echo ' </fieldset>' ;
// EGO
echo ' <br/>' ;
echo '<fieldset class="izvozi">' ;
echo '<legend>SPSS IZVOZI ZA ALTERJE</legend>' ;
echo '</fieldset>' ;
} else { // data iz baze
echo '<div id="anketa_edit">' . " \n \r " ;
$this -> displayData ();
echo ' </div>' ;
}
}
*/
/**
* @ desc prikaze podatke v tabeli
*/
function displayData () {
global $lang ;
global $site_url ;
//include_once ('DisplaySurveyData.php');
$dsd = new DisplaySurveyData ( $this -> anketa );
$dsd -> display ();
}
/**
* @ 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 vse nepobrisane uporabnike iz baze
*/
private static function db_select_users_forLevel ( $anketa = null ) {
global $global_user_id , $admin_type ;
// tip admina: 0=>admin, 1=>manager, 2=>clan, 3=>user
switch ( $admin_type ) {
// admin vidi vse
case 0 :
return sisplet_query ( " SELECT name, surname, id, email FROM users WHERE status!='0' ORDER BY name ASC " );
break ;
// manager vidi ljudi pod sabo
case 1 :
if ( $anketa === null )
return sisplet_query ( " SELECT a.name, a.surname, a.id, a.email FROM users a, srv_dostop_manage m WHERE a.status!='0' AND m.manager=' " . $global_user_id . " ' AND m.user=a.id " );
else
return sisplet_query ( " SELECT a.name, a.surname, a.id, a.email FROM users a, srv_dostop_manage m WHERE a.status!='0' AND m.manager=' " . $global_user_id . " ' AND m.user=a.id UNION SELECT u.name, u.surname, u.id, u.email FROM users u, srv_dostop d WHERE d.ank_id=' $anketa ' AND d.uid=u.id " );
break ;
case 2 :
case 3 :
// TODO // clani in userji lahko vidijo samo tiste ki so jim poslali maile in so se registrirali
// ce smo v urejanju nastavitve ankete vidijo vse, ki so dodeljeni anketi, da jim lahko nastavijo
if ( $anketa === null )
return sisplet_query ( " SELECT name, surname, id, email FROM users WHERE 1 = 0 " );
else
return sisplet_query ( " SELECT u.name, u.surname, u.id, u.email FROM users u, srv_dostop d WHERE u.status!='0' AND d.ank_id=' $anketa ' AND d.uid=u.id " );
break ;
}
return null ;
}
function display_dostop_users ( $show_all = 0 ){
global $global_user_id , $admin_type , $lang ;
$avtorRow = SurveyInfo :: getInstance () -> getSurveyRow ();
2021-12-16 15:53:34 +01:00
echo '<p class="bold">' . $lang [ 'srv_dostop_users_list' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
// Prikazemo samo userje ki lahko urejajo anketo
if ( $show_all == 0 ){
echo ' <input type="hidden" name="dostop_edit" value="1" />' . " \n " ;
2021-12-16 15:53:34 +01:00
echo '<table>' ;
echo '<tr>' ;
2021-12-20 15:27:15 +01:00
echo '<th>' ;
2021-12-23 15:47:26 +01:00
//echo '<input type="checkbox" id="user_access_check_all" name="user_access_check_all"></input><label class="empty" for="user_access_check_all"></label>';
echo '</th>' ;
echo '<th>' . $lang [ 'srv_dostop_users_username' ] . '</th>' ;
2021-12-16 15:53:34 +01:00
echo '<th>' . $lang [ 'srv_dostop_users_email' ] . '</th>' ;
2021-12-20 15:12:13 +01:00
echo '<th></th>' ;
2021-12-16 15:53:34 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
$sql1 = sisplet_query ( " SELECT u.name, u.surname, u.id, u.email FROM users u, srv_dostop d WHERE d.ank_id=' $this->anketa ' AND d.uid=u.id " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
2021-12-17 11:55:40 +01:00
2021-12-16 15:53:34 +01:00
// Da ga ne pocistimo, ce je disablan (sam sebe ne more odstranit in avtorja se ne sme odstranit)
2020-08-14 13:36:36 +02:00
if ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] || $global_user_id == $row1 [ 'id' ])
echo ' <input type="hidden" name="uid[]" value="' . $row1 [ 'id' ] . '" />' . " \n " ;
2021-12-16 15:53:34 +01:00
echo '<tr id="div_for_uid_' . $row1 [ 'id' ] . '" name="dostop_active_uid">' ;
2022-05-03 08:41:01 +02:00
echo ' <td><input type="checkbox" name="uid[]" value="' . $row1 [ 'id' ] . '" id="uid_' . $row1 [ 'id' ] . '" checked="checked" ' . ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] || $global_user_id == $row1 [ 'id' ] ? ' disabled="disabled"' : '' ) . ' autocomplete="off"/><label class="empty" for="uid_' . $row1 [ 'id' ] . '" title="' . $row1 [ 'email' ] . '"></label></td>' ;
echo ' <td>' . $row1 [ 'name' ] . ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] ? ' (' . $lang [ 'author' ] . ')' : '' ) . '</td>' ;
echo ' <td>' . $row1 [ 'email' ] . '</td>' ;
// Avtor ne rabi ikone za urejanje
echo ' <td>' ;
if ( $avtorRow [ 'insert_uid' ] != $row1 [ 'id' ])
echo ' <div class="icon_holder multiple"><a><span class="faicon edit" onclick="javascript:anketa_user_dostop(\'' . $row1 [ 'id' ] . '\');"></span></a>' ;
echo ' </td>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-16 15:53:34 +01:00
echo '</table>' ;
2021-12-20 15:27:15 +01:00
//echo '<a class="noline undertable" href="#" onClick="________IZBRIS DOSTOPA ZA VSE OZNAČENE____________"><span class="faicon trash empty link-right"></span>'.$lang['srv_dostop_users_removeselected'].'</a>';
2021-12-16 15:53:34 +01:00
2020-08-14 13:36:36 +02:00
}
2021-12-16 15:53:34 +01:00
// Prikazemo vse userje, ki jih lahko uporabnik dodaja
2020-08-14 13:36:36 +02:00
else {
$sql1 = $this -> db_select_users_forLevel ( $this -> anketa );
if ( mysqli_num_rows ( $sql1 ) > 0 ) {
echo '<span id="dostop_active_show_1"><a href="#" onClick="dostopActiveShowAll(\'true\'); return false;">' . $lang [ 'srv_dostop_show_all' ] . '</a></span>' ;
echo '<span id="dostop_active_show_2" class="displayNone"><a href="#" onClick="dostopActiveShowAll(\'false\'); return false;">' . $lang [ 'srv_dostop_hide_all' ] . '</a></span>' ;
echo ' <input type="hidden" name="dostop_edit" value="1" />' . " \n " ;
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT ank_id, uid FROM srv_dostop WHERE ank_id=' $this->anketa ' AND uid=' $row1[id] ' " );
$checked = ( mysqli_num_rows ( $sql2 ) > 0 ) ? ' checked="checked"' : '' ;
// Da ga ne pocistimo ce je disablan (sam sebe ne more odstranit in avtorja se ne sme odstranit)
if ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] || $global_user_id == $row1 [ 'id' ])
echo ' <input type="hidden" name="uid[]" value="' . $row1 [ 'id' ] . '" />' . " \n " ;
echo '<div id="div_for_uid_' . $row1 [ 'id' ] . '" name="dostop_active_uid" class="floatLeft dostop_for_uid' . $_css_hidden . '">' . " \n " ;
echo '<label nowrap for="uid_' . $row1 [ 'id' ] . '" title="' . $row1 [ 'email' ] . '">' ;
echo '<input type="checkbox" name="uid[]" value="' . $row1 [ 'id' ] . '" id="uid_' . $row1 [ 'id' ] . '" ' . $checked . ' ' . ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] || $global_user_id == $row1 [ 'id' ] ? ' disabled="disabled"' : '' ) . ' autocomplete="off"/>' . " \n " ;
echo $row1 [ 'name' ] . ( $avtorRow [ 'insert_uid' ] == $row1 [ 'id' ] ? ' (' . $lang [ 'author' ] . ')' : '' ) . '</label>' ;
if ( $checked != '' )
echo ' <span class="faicon edit small icon-as_link" onclick="javascript:anketa_user_dostop(\'' . $row1 [ 'id' ] . '\');"></span>' ;
echo '</div>' . " \n " ;
}
}
}
}
2021-07-14 12:24:05 +02:00
// Dodajanje uredniskega dostopa do ankete
public function display_add_survey_dostop (){
global $lang ;
global $admin_type ;
2021-12-16 15:53:34 +01:00
echo '<p class="red bottom16">' ;
2021-07-14 12:24:05 +02:00
// Admini in managerji lahko dodajo dostop komurkoli
if ( $admin_type == 0 || $admin_type == 1 ){
2021-09-29 10:37:17 +02:00
echo $lang [ 'srv_dostop_adduserstxt_admin' ] . ' ' . AppSettings :: getInstance () -> getSetting ( 'app_settings-app_name' ) . '. ' ;
2021-07-14 12:24:05 +02:00
}
// Ostali uporabniki lahko dodajo dostop samo ze registriranim uporabnikom
else {
2021-09-29 10:37:17 +02:00
echo $lang [ 'srv_dostop_adduserstxt' ] . ' ' . AppSettings :: getInstance () -> getSetting ( 'app_settings-app_name' ) . '! ' ;
2021-07-14 12:24:05 +02:00
}
// AAI ima poseben link na help
2021-09-29 10:37:17 +02:00
if ( isAAI ()){
2021-07-14 12:24:05 +02:00
echo $lang [ 'srv_dostop_adduserstxt_aai_more' ];
}
echo '</p>' ;
echo '<input type="hidden" name="aktiven" value="1" >' ;
2021-12-16 15:53:34 +01:00
echo '<div class="setting_holder">' ;
echo '<label for="addusers">' . $lang [ 'srv_dostop_adduserstxt_email' ] . '</label>' ;
echo '<textarea name="addusers" id="addusers"></textarea>' ;
echo '</div>' ;
echo '<p class="bottom16">' . $lang [ 'srv_dostop_adduserstxt_end' ] . '</p>' ;
//Opcijsko sporočilo
echo '<div class="setting_holder">' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" id="addusers_note_checkbox" onClick="dostopNoteToggle();">' ;
2021-12-17 11:55:40 +01:00
echo '<label for="addusers_note_checkbox">' . $lang [ 'srv_dostop_adduserstxt_note' ] . '</label>' ;
2021-12-16 15:53:34 +01:00
echo '</div>' ;
echo '<div class="setting_item">' ;
2021-12-20 15:12:13 +01:00
echo '<textarea class="displayNone" name="addusers_note" id="addusers_note">' . $lang [ 'srv_dostop_adduserstxt_note_text' ] . '</textarea>' ;
2021-12-16 15:53:34 +01:00
echo '</div>' ;
echo '</div>' ;
2021-07-14 12:24:05 +02:00
// Gumb za dodajanje in posiljanje
2021-12-16 15:53:34 +01:00
echo '<div class="button_holder below">' ;
echo '<button class="medium blue" href="#" onclick="dostopAddAccess(); return false;">' . $lang [ 'srv_dostop_addusers_button' ] . '</button>' ;
echo '</div>' ;
2021-07-14 12:24:05 +02:00
}
2020-08-14 13:36:36 +02:00
/**
* @ desc Vrne podatke o uporabniku
*/
static function db_select_user ( $uid ) {
return sisplet_query ( " SELECT name, surname, id, email FROM users WHERE id=' $uid ' " );
}
/** 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
$str_survey_type = sisplet_query ( " SELECT survey_type FROM srv_anketa WHERE id = ' " . $sid . " ' " );
$row_survey_type = mysqli_fetch_assoc ( $str_survey_type );
$this -> getSurvey_type = $row_survey_type [ 'survey_type' ];
return $this -> getSurvey_type ;
}
/**
* TODO ? ? ?
*
* @ param mixed $what
* @ param mixed $isChecked
* $forma - pri hitirh nastavitvah forme prikazemo nekje krajsi text
*/
function display_alert_label ( $what , $isChecked = false , $forma = false ) {
global $lang , $global_user_id ;
$custom_alert = array ();
$sql_custom_alert = sisplet_query ( " SELECT uid, type FROM srv_alert_custom WHERE ank_id = ' $this->anketa ' " );
while ( $row_custom_alert = mysqli_fetch_array ( $sql_custom_alert )) {
$custom_alert [ $row_custom_alert [ 'type' ]][ $row_custom_alert [ 'uid' ]] = 1 ;
}
switch ( $what ) {
case 'finish_respondent_language' : // respondent ki je zakljucil anketo v drugem jeziku (mu omogocimo nastavljanje custom maila za obvescanje)
if ( $isChecked ) {
$p = new Prevajanje ( $anketa );
$p -> dostop ();
$jeziki = $p -> get_all_translation_langs ();
if ( ! empty ( $jeziki )){
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
foreach ( $jeziki as $key => $jezik ){
2022-01-05 17:46:49 +01:00
echo '<div class="setting_item respondent_jeziki">' ;
echo '<label>' . $lang [ 'srv_alert_respondent' ] . ' - ' . $jezik . '</label>' ;
echo '<a href="#" onclick="alert_custom(\'respondent_lang_' . $key . '\', \'0\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
}
break ;
case 'finish_respondent' : // respondent ki je zakljucil anketo
if ( $isChecked ) {
2022-01-05 17:46:49 +01:00
// preverimo, ali obstaja sistemska spremenljivka email, če ne jo dodamo
2020-08-14 13:36:36 +02:00
$sqlEmail = sisplet_query ( " SELECT s.sistem, s.variable, s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='email' AND s.gru_id=g.id AND g.ank_id=' $this->anketa ' " );
$sqlIme = sisplet_query ( " SELECT s.sistem, s.variable, s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='ime' AND s.gru_id=g.id AND g.ank_id=' $this->anketa ' " );
2022-01-05 17:46:49 +01:00
// ce sta dodani obe sistemski spremenljivki, je vse ok
2020-08-14 13:36:36 +02:00
$email_ok = $ime_ok = false ;
if ( mysqli_num_rows ( $sqlEmail ) > 0 && mysqli_num_rows ( $sqlIme ) > 0 ) {
$email_ok = $ime_ok = true ;
2022-01-05 17:46:49 +01:00
}
else {
2020-08-14 13:36:36 +02:00
// manjka ena ali obe potrebni sistemski spremenljivki
// email je nujen, zato ga dodamo avtomatsko
if ( mysqli_num_rows ( $sqlEmail ) == 0 ) {
//dodamo email
$sa = new SurveyAdmin ( 1 , $this -> anketa );
if ( in_array ( 'email' , $sa -> alert_add_necessary_sysvar ( array ( 'email' ) , false ))) {
$email_ok = true ;
}
2022-01-05 17:46:49 +01:00
// email v tem primeru spremenimo, da je viden, ker gre za alert
2020-08-14 13:36:36 +02:00
$sqlEmail = sisplet_query ( " SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='email' AND s.gru_id=g.id AND g.ank_id=' $this->anketa ' " );
$rowEmail = mysqli_fetch_array ( $sqlEmail );
sisplet_query ( " UPDATE srv_spremenljivka SET visible='1' WHERE id = ' $rowEmail[id] ' " );
// emailu po novem nastavimo preverjanje pravilnosti emaila in mehko opozorilo na to preverjanje
$v = new Vprasanje ( $this -> anketa );
$v -> spremenljivka = $rowEmail [ 'id' ];
$v -> set_email ( $reminder = 1 );
2022-01-05 17:46:49 +01:00
}
else {
// email je ze dodan, damo tekst za ok
2020-08-14 13:36:36 +02:00
$email_ok = true ;
}
// preverimo še za ime
if ( mysqli_num_rows ( $sqlIme ) == 0 ) {
2022-01-05 17:46:49 +01:00
}
else {
2020-08-14 13:36:36 +02:00
$ime_ok = true ;
}
}
2022-01-05 17:46:49 +01:00
echo '<input type="checkbox" name="alert_' . $what . '" id="alert_' . $what . '" value="1" onChange="change_alert_respondent(\'' . $what . '\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;"' . (( $isChecked ) ? ' checked' : '' ) . '>' ;
echo '<label for="alert_' . $what . '">' . $lang [ 'srv_alert_respondent' ] . '</label>' ;
2020-08-14 13:36:36 +02:00
if ( $email_ok && $ime_ok ) {
2022-01-05 17:46:49 +01:00
echo ' <a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
$sql1 = sisplet_query ( " SELECT finish_respondent_if FROM srv_alert WHERE ank_id=' $this->anketa ' " );
$row1 = mysqli_fetch_array ( $sql1 );
echo ' <a href="#" onclick="alert_edit_if(\'2\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'finish_respondent_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
if ( $row1 [ 'finish_respondent_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'finish_respondent_if' ]); }
2022-01-05 17:46:49 +01:00
echo '<span class="gray">' . $lang [ 'srv_alert_respondent_note_ok_email_ime' ] . ' <span class="faicon fa-check-circle"></span></span>' ;
2020-08-14 13:36:36 +02:00
} else {
if ( $ime_ok ) {
// pomeni da email ni ok! napaka
2022-01-05 17:46:49 +01:00
echo '<span class="red">' . $lang [ 'srv_alert_respondent_note_notok_email' ] . '</span>' ;
2020-08-14 13:36:36 +02:00
} else {
2022-01-05 17:46:49 +01:00
// email je ok, ime ni, uporabnika vprasamo, ali hoce se ime
echo '<a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
$sql1 = sisplet_query ( " SELECT finish_respondent_if FROM srv_alert WHERE ank_id=' $this->anketa ' " );
$row1 = mysqli_fetch_array ( $sql1 );
2022-01-05 17:46:49 +01:00
echo ' <a href="#" onclick="alert_edit_if(\'2\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'finish_respondent_if' ] == 0 ? 'style=""' : '' ) . '></span></a>' ;
2020-08-14 13:36:36 +02:00
if ( $row1 [ 'finish_respondent_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'finish_respondent_if' ]); }
2022-01-05 17:46:49 +01:00
echo '<p class="gray top8">' . $lang [ 'srv_alert_respondent_note_ok_email' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
if ( ! $forma ){
2022-01-05 17:46:49 +01:00
echo '<p class="top8"><span class="gray">' . $lang [ 'srv_alert_respondent_note_ime' ] . '</span>' ;
echo '<a class="noline" href="#" onClick="alert_add_necessary_sysvar(\'finish_respondent\', $(this)); return false;"><span class="faicon add respondent_iconwithlink"></span> ' . $lang [ 'srv_alert_respondent_note_link' ] . '</a></p>' ;
2020-08-14 13:36:36 +02:00
}
}
}
// preverimo sistemske nastavitve in spremenljivke ime
} else {
2022-01-05 17:46:49 +01:00
echo '<input type="checkbox" name="alert_' . $what . '" id="alert_' . $what . '" value="1" onChange="change_alert_respondent(\'' . $what . '\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;"' . (( $isChecked ) ? ' checked' : '' ) . '>' ;
echo '<label for="alert_' . $what . '">' . $lang [ 'srv_alert_respondent' ] . '</label>' ;
2020-08-14 13:36:36 +02:00
}
break ;
case 'finish_respondent_cms' : // respondent prepoznan iz CMS ko je izpolnil anketo
2021-11-16 09:43:12 +01:00
//respondent iz cms
2022-01-05 17:46:49 +01:00
echo '<input type="checkbox" name="alert_' . $what . '" id="alert_' . $what . '" value="1" onChange="change_alert_respondent(\'' . $what . '\', $(this)); change_alert_instruction($(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . (( $isChecked ) ? ' checked' : '' ) . '>' ;
2021-11-16 09:43:12 +01:00
echo '<label for="alert_finish_respondent_cms">' . $lang [ 'srv_alert_respondent_cms' ] . '</label>' ;
2020-08-14 13:36:36 +02:00
if ( $isChecked ) {
// preverimo sistemske nastavitve in spremenljivke
//$sqlCMS = sisplet_query("SELECT user_from_cms FROM srv_anketa WHERE id='$this->anketa'");
//$rowCMS = mysqli_fetch_assoc($sqlCMS);
$rowCMS = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $rowCMS [ 'user_from_cms' ] > 0 ) {
2022-01-05 17:46:49 +01:00
echo ' <a href="#" onclick="alert_custom(\'respondent_cms\', \'0\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
$sql1 = sisplet_query ( " SELECT finish_respondent_cms_if FROM srv_alert WHERE ank_id=' $this->anketa ' " );
$row1 = mysqli_fetch_array ( $sql1 );
echo ' <a href="#" onclick="alert_edit_if(\'3\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'finish_respondent_cms_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
if ( $row1 [ 'finish_respondent_cms_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'finish_respondent_cms_if' ]); }
2022-01-05 17:46:49 +01:00
echo '<span class="gray">' . $lang [ 'srv_alert_respondent_cms_note_ok' ] . ' <span class="faicon fa-check-circle"></span></span>' ;
2020-08-14 13:36:36 +02:00
} else {
2022-01-05 17:46:49 +01:00
echo '<p class="top8"><span class="red">' . $lang [ 'srv_alert_respondent_cms_note' ] . '</spam>' ;
echo '<a class="noline" href="#" onClick="alert_change_user_from_cms(\'finish_respondent_cms\', $(this)); return false;"><span class="faicon add respondent_iconwithlink"></span> ' . $lang [ 'srv_alert_respondent_cms_note_link' ] . '</a></p>' ;
2020-08-14 13:36:36 +02:00
}
}
break ;
2022-01-05 17:46:49 +01:00
case 'finish_author' : // obveščanje o izpolnjeni anketi
case 'expire_author' : // obveščanje o poteku ankete
case 'active_author' : // obveščanje o aktivaciji/deaktivaciej ankete
case 'delete_author' : // obveščanje o izbrisu ankete
2020-08-14 13:36:36 +02:00
2021-12-24 00:52:31 +01:00
// preberemo nastavitve alertov
$sqlAlert = sisplet_query ( " SELECT * FROM srv_alert WHERE ank_id = ' $anketa ' " );
if ( ! $sqlAlert )
echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
if ( mysqli_num_rows ( $sqlAlert ) > 0 ) {
$rowAlert = mysqli_fetch_array ( $sqlAlert );
}
else {
SurveyAlert :: getInstance () -> Init ( $anketa , $global_user_id );
$rowAlert = SurveyAlert :: setDefaultAlertBeforeExpire ();
}
2020-08-14 13:36:36 +02:00
// avtor ankete
2021-12-24 00:52:31 +01:00
if ( $forma ) {
2022-01-05 00:10:30 +01:00
echo '<input type="checkbox" name="alert_' . $what . '" id="alert_' . $what . '" value="1" onChange="change_alert_respondent(\'' . $what . '\', $(this));return false;"' . (( $isChecked ) ? ' checked' : '' ) . '>' ;
2021-12-24 00:52:31 +01:00
echo '<label for="alert_' . $what . '">' . $lang [ 'srv_alert_author2' ] . '</label>' ;
}
else {
2022-01-05 00:10:30 +01:00
echo '<input type="checkbox" name="alert_' . $what . '" id="alert_' . $what . '" value="1" onChange="change_alert_respondent(\'' . $what . '\', $(this));return false;"' . (( $isChecked ) ? ' checked' : '' ) . '>' ;
2020-08-14 13:36:36 +02:00
echo '<label for="alert_' . $what . '">' . $lang [ 'srv_alert_author' ] . '</label>' ;
2021-12-24 00:52:31 +01:00
}
2020-08-14 13:36:36 +02:00
if ( $isChecked ) {
//$sql = sisplet_query("SELECT insert_uid, edit_uid FROM srv_anketa WHERE id='$this->anketa'");
//$row = mysqli_fetch_assoc($sql);
$b = null ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $what == 'finish_author' )
$db_field = 'alert_complete' ;
else if ( $what == 'expire_author' )
$db_field = 'alert_expire' ;
else if ( $what == 'active_author' )
$db_field = 'alert_active' ;
else if ( $what == 'delete_author' )
$db_field = 'alert_delete' ;
// polovimo avtorja - novo kjer se ga lahko tudi izklopi (zaenkrat samo pri koncani anketi)
if ( $what == 'finish_author' ){
$sqlAuthor = $this -> db_select_user ( $row [ 'insert_uid' ]);
$rowAuthor = mysqli_fetch_array ( $sqlAuthor );
$sql1 = sisplet_query ( " SELECT *, uid AS id FROM srv_dostop WHERE ank_id=' $this->anketa ' AND uid=' " . $row [ 'insert_uid' ] . " ' " );
$row1 = mysqli_fetch_array ( $sql1 );
// Ce smo ravno z ajaxom vklopili obvescanje avtorja, ga tudi aktiviramo
if ( isset ( $_POST [ 'checked' ]) && isset ( $_POST [ 'what' ]) && $_POST [ 'what' ] == 'finish_author' ){
$checked = ( $_POST [ 'checked' ] == true ) ? ' checked="checked" ' : '' ;
}
else {
$checked = ( $row1 [ $db_field ] == '1' ) ? ' checked="checked" ' : '' ;
}
2021-12-24 00:52:31 +01:00
echo '<div class="alert_authors">' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_' . $what . '_uid[]" value="' . $row [ 'insert_uid' ] . '" id="alert_' . $what . '_uid_' . $row [ 'insert_uid' ] . '"' . $checked . ' autocomplete="off"/>' ;
echo '<label for="alert_' . $what . '_uid_' . $row [ 'insert_uid' ] . '" title="' . $rowAuthor [ 'email' ] . '">' . $rowAuthor [ 'name' ] . ' (' . $lang [ 'author' ] . ': ' . $rowAuthor [ 'email' ] . ')' . '</label>' ;
2020-08-14 13:36:36 +02:00
if ( $what == 'finish_author' ) {
2022-01-05 17:46:49 +01:00
echo '<span>' ;
echo ' <a href="#" onclick="alert_custom(\'author\', \'' . $row [ 'insert_uid' ] . '\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
echo ' <a href="#" onclick="alert_edit_if(\'1\', \'' . $row1 [ 'id' ] . '\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'alert_complete_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
if ( $row1 [ 'alert_complete_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'alert_complete_if' ]); }
2022-01-05 17:46:49 +01:00
echo '</span>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-24 00:52:31 +01:00
echo '</div>' ;
2022-01-05 17:46:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// polovimo avtorja pri ostalih obvestilih
else {
$sqlAuthor = $this -> db_select_user ( $row [ 'insert_uid' ]);
$rowAuthor = mysqli_fetch_array ( $sqlAuthor );
$sql1 = sisplet_query ( " SELECT *, uid AS id FROM srv_dostop WHERE ank_id=' $this->anketa ' AND uid=' " . $row [ 'insert_uid' ] . " ' " );
$row1 = mysqli_fetch_array ( $sql1 );
2021-12-24 00:52:31 +01:00
echo '<div class="alert_authors">' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_' . $what . '_uid[]" value="' . $row [ 'insert_uid' ] . '" id="alert_' . $what . '_uid_' . $row [ 'insert_uid' ] . '" checked="checked" disabled="disabled" autocomplete="off"/>' ;
echo '<label for="alert_' . $what . '_uid_' . $row [ 'insert_uid' ] . '" title="' . $rowAuthor [ 'email' ] . '">' . $rowAuthor [ 'name' ] . ' (' . $lang [ 'author' ] . ': ' . $rowAuthor [ 'email' ] . ')' . '</label>' ;
2020-08-14 13:36:36 +02:00
if ( $what == 'finish_author' ) {
2022-01-05 17:46:49 +01:00
echo '<span>' ;
echo ' <a href="#" onclick="alert_custom(\'author\', \'' . $row [ 'insert_uid' ] . '\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
echo ' <a href="#" onclick="alert_edit_if(\'1\', \'' . $row1 [ 'id' ] . '\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'alert_complete_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
if ( $row1 [ 'alert_complete_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'alert_complete_if' ]); }
2022-01-05 17:46:49 +01:00
echo '</span>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-24 00:52:31 +01:00
echo '</div>' ;
2022-01-05 17:46:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// polovimo ostale userje ki imajo dostop
$sql1 = sisplet_query ( " SELECT u.id, u.name, u.surname, u.email, dostop. " . $db_field . " , dostop.alert_complete_if FROM users as u "
. " RIGHT JOIN (SELECT sd.uid, sd. " . $db_field . " , sd.alert_complete_if FROM srv_dostop as sd WHERE sd.ank_id=' " . $this -> anketa . " ') AS dostop ON u.id = dostop.uid WHERE u.id != ' " . $row [ 'insert_uid' ] . " ' " );
while ( $row1 = mysqli_fetch_assoc ( $sql1 )) {
if ( $row1 [ 'id' ]) { // se zgodi da je prazno za metauserje
// avtor je vedno chekiran
$checked = ( $row1 [ $db_field ] == '1' ) ? ' checked="checked"' : '' ;
2021-12-24 00:52:31 +01:00
echo '<div class="alert_authors">' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="alert_' . $what . '_uid[]" value="' . $row1 [ 'id' ] . '" id="alert_' . $what . '_uid_' . $row1 [ 'id' ] . '"' . $checked . ' autocomplete="off"/>' ;
echo '<label for="alert_' . $what . '_uid_' . $row1 [ 'id' ] . '" title="' . $row1 [ 'email' ] . '">' . $row1 [ 'name' ] . ' (' . $row1 [ 'email' ] . ')</label>' ;
2022-01-05 17:46:49 +01:00
if ( $what == 'finish_author' ) {
echo '<span>' ;
echo ' <a href="#" onclick="alert_custom(\'author\', \'' . $row1 [ 'id' ] . '\'); return false;" title="' . $lang [ 'srv_alert_custom' ] . '"><span class="faicon text_file empty"></span></a>' ;
2020-08-14 13:36:36 +02:00
echo ' <a href="#" onclick="alert_edit_if(\'1\', \'' . $row1 [ 'id' ] . '\'); return false;"><span class="faicon if_add" ' . ( $row1 [ 'alert_complete_if' ] == 0 ? 'style=""' : '' ) . '></span></a> ' ;
if ( $row1 [ 'alert_complete_if' ] > 0 ) { if ( $b == null ) $b = new Branching ( $this -> anketa ); $b -> conditions_display ( $row1 [ 'alert_complete_if' ]); }
2022-01-05 17:46:49 +01:00
echo '</span>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-24 00:52:31 +01:00
echo '</div>' ;
2022-01-05 17:46:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
}
break ;
}
}
/**
* TODO ? ? ?
*
* @ param mixed $row
*/
function showUserCodeSettings ( $row = null ) {
global $lang ;
if ( $row == null ) {
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
}
$disabled = true ;
$disabled2 = false ;
if ( SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' ) || SurveyInfo :: getInstance () -> checkSurveyModule ( 'phone' )){
$disabled = false ;
}
if ( $row [ 'usercode_skip' ] == 1 ) {
$disabled2 = true ;
}
#echo '<span class="nastavitveSpan" > </span>';
echo '<span ' . ( $disabled ? 'class="gray"' : '' ) . '>' . $lang [ 'usercode_skip' ] . Help :: display ( 'usercode_skip' ) . ':' ;
echo '<input type="radio" name="usercode_skip" value="0" id="usercode_skip_0"' . ( $row [ 'usercode_skip' ] == 0 ? ' checked="checked"' : '' ) . ( $disabled ? ' disabled="disabled"' : '' ) . ' onChange="handleUserCodeSkipSetting();"/><label for="usercode_skip_0">' . $lang [ 'no1' ] . '</label>' . " \n \r " ;
echo '<input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"' . ( $row [ 'usercode_skip' ] == 1 ? ' checked="checked"' : '' ) . ( $disabled ? ' disabled="disabled"' : '' ) . ' onChange="handleUserCodeSkipSetting();"/><label for="usercode_skip_1">' . $lang [ 'yes' ] . '</label>' . " \n \r " ;
echo '<input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"' . ( $row [ 'usercode_skip' ] == 2 ? ' checked="checked"' : '' ) . ( $disabled ? ' disabled="disabled"' : '' ) . ' onChange="handleUserCodeSkipSetting();"/><label for="usercode_skip_2">' . $lang [ 'srv_setting_onlyAuthor' ] . '</label>' . " \n \r " ;
echo '</span>' ;
echo '<br />' ;
echo '<br/>' ;
#echo '<span class="nastavitveSpan" > </span>';
echo '<span ' . ( $disabled /*|| $disabled2*/ ? 'class="gray"' : '' ) . '>' . $lang [ 'usercode_required' ] . help :: display ( 'usercode_required' ) . ': ' ;
echo '<input type="radio" name="usercode_required" value="0" id="usercode_required_0"' . ( $row [ 'usercode_required' ] == 0 ? ' checked="checked"' : '' ) . ( $disabled /*|| $disabled2*/ ? ' disabled="disabled"' : '' ) . ' onChange="handleUserCodeRequiredSetting();"/><label for="usercode_required_0">' . $lang [ 'no1' ] . '</label>' . " \n \r " ;
echo '<input type="radio" name="usercode_required" value="1" id="usercode_required_1"' . ( $row [ 'usercode_required' ] == 1 ? ' checked="checked"' : '' ) . ( $disabled /*|| $disabled2*/ ? ' disabled="disabled"' : '' ) . ' onChange="handleUserCodeRequiredSetting();"/><label for="usercode_required_1">' . $lang [ 'yes' ] . '</label>' . " \n \r " ;
echo '</span>' ;
echo '<br/>' ;
echo '<div id="div_usercode_text"' . ( /*$row['usercode_skip'] == 1 || */ $row [ 'usercode_required' ] == 0 ? ' class="displayNone"' : '' ) . '>' ;
$nagovorText = ( $row [ 'usercode_text' ] && $row [ 'usercode_text' ] != null && $row [ 'usercode_text' ] != " " ) ? $row [ 'usercode_text' ] : $lang [ 'srv_basecode' ];
#echo '<span class="nastavitveSpan2" > </span>';
echo '<span ' . ( $disabled ? 'class="gray"' : '' ) . '>' . $lang [ 'usercode_text' ] . ': ' ;
echo ' <textarea name="usercode_text" ' . ( $disabled ? ' disabled="disabled"' : '' ) . '>' . $nagovorText . '</textarea>' . " \n \r " ;
echo '</span>' ;
echo '</div>' ;
}
/**
* TODO ? ? ?
*
* @ param mixed $row
*/
function respondenti_iz_baze ( $row = null , $show_fieldset = true ) {
global $lang ;
global $admin_type ;
if ( $row == null ) {
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
}
/* aktivnost vec ni pogoj za vklop email vabil :
* - omogočiti aktiviranje emial zavihka , četudi je anketa neaktivna ( preprečiti pa pošijanje emailov če je ankete neaktivna )
*/
if ( $admin_type <= 1 ) {
$_cssDisabled = '' ;
$_disabled = '' ;
} else {
$_cssDisabled = ' gray' ;
$_disabled = ' disabled="disabled"' ;
}
echo '<input type="hidden" name="anketa" value="' . $this -> anketa . '" />' . " \n \r " ;
echo '<input type="hidden" name="grupa" value="' . $this -> grupa . '" />' . " \n \r " ;
echo '<input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
if ( $show_fieldset ) {
echo '<fieldset>' ;
echo '<legend class="' . $_cssDisabled . '">' . $lang [ 'srv_user_base_vabila' ] . '</legend>' ;
} else {
echo '<p class="strong">3. ' . $lang [ 'srv_user_base_vabila' ] . '</p>' ;
}
if ( $_cssDisabled == '' && $_disabled == '' ) {
echo '<span class="' . $_cssDisabled . '" ><label>' . $lang [ 'srv_user_base_email' ] . ':</label></span>' ;
echo ' <input type="radio" name="email" value="1" id="email_1"' . ( SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' ) ? ' checked="checked"' : '' ) . ' onChange="//handleUserCodeSetting();" ' . $_disabled . '/><label for="email_1" class="' . $_cssDisabled . '">' . $lang [ 'yes' ] . '</label>' . " \n \r " ;
echo ' <input type="radio" name="email" value="0" id="email_0"' . ( ! SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' ) ? ' checked="checked"' : '' ) . ' onChange="//handleUserCodeSetting();" ' . $_disabled . '/><label for="email_0" class="' . $_cssDisabled . '">' . $lang [ 'no1' ] . '</label>' . " \n \r " ;
echo '<br/>' ;
}
// dodatne nastavitve za pošiljanje kode pri izpolnjevanju ankete
if ( $_GET [ 'a' ] == 'vabila' || $_GET [ 'a' ] == 'email' ) {
echo '<div id="userCodeSettings">' ;
$this -> showUserCodeSettings ( $row );
echo '</div>' ;
}
if ( $admin_type > 1 )
echo '' . $lang [ 'srv_user_base_user_note' ] . '' ;
if ( $show_fieldset ) {
echo '</fieldset>' ;
}
}
/**
* TODO ? ? ?
*
*/
function anketa_aktivacija_note () {
global $lang ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $row [ 'active' ] == 0 ) {
echo $lang [ 'srv_url_survey_not_active' ];
echo ' <span id="vabila_anketa_aktivacija" class="link_no_decoration">' . " \n \r " ;
echo ' <a href="#" onclick="anketa_active(\'' . $this -> anketa . '\',\'' . $row [ 'active' ] . '\'); return false;" title="' . $lang [ 'srv_anketa_noactive' ] . '">' ;
echo ' <span class="faicon star icon-orange_very_dark"></span>' ;
echo ' <span >' . $lang [ 'srv_anketa_setActive' ] . '</span>' ;
echo ' </a>' . " \n \r " ;
echo ' </span>' . " \n \r " ;
} else {
echo $lang [ 'srv_url_intro_active' ];
echo ' <span id="vabila_anketa_aktivacija" class="link_no_decoration">' . " \n \r " ;
echo ' <a href="#" onclick="anketa_active(\'' . $this -> anketa . '\',\'' . $row [ 'active' ] . '\'); return false;" title="' . $lang [ 'srv_anketa_active' ] . '">' ;
echo ' <span class="faicon star_on"></span>' ;
echo ' <span >' . $lang [ 'srv_anketa_setNoActive' ] . '</span>' ;
echo ' </a>' . " \n \r " ;
echo ' </span>' . " \n \r " ;
}
}
function anketa_diagnostika_note ( $diagnostics , $show_link = false ) {
global $lang ;
$diagnostics -> printNote ( $show_link );
}
/**
* @ desc prikaze dropdown z nastavitvami ankete ( globalne , za celo 1 ko ) -- Prva stran -> Nastavitve -> Sistemske nastavitve
2021-10-19 13:01:22 +02:00
* Sistemske nastavitve : mora biti admin da ima dostop
2020-08-14 13:36:36 +02:00
*/
function anketa_nastavitve_system () {
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
2022-03-02 00:43:49 +01:00
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
// Ni admin - nima pravic
if ( $admin_type != 0 ) {
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
echo '<div id="anketa_edit">' ;
echo $lang [ 'srv_settingsSystemNoRights' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
return ;
}
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
echo '<div id="anketa_edit">' ;
2021-09-21 12:11:55 +02:00
2021-10-19 13:01:22 +02:00
echo '<form name="settingsanketa" action="ajax.php?a=editanketasettings&m=system" method="post" autocomplete="off">' ;
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' ;
echo ' <input type="hidden" name="submited" value="1" />' ;
2020-08-14 13:36:36 +02:00
2021-10-19 13:01:22 +02:00
// SISTEMSKE NASTAVITVE (prej v settings_optional.php)
echo '<fieldset><legend>' . $lang [ 'as_basic' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve">' ;
2021-10-19 13:01:22 +02:00
2022-03-02 00:43:49 +01:00
AppSettings :: getInstance () -> displaySettingsGroup ( 'basic' );
2021-10-19 13:01:22 +02:00
// Kdo lahko ureja ankete
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve_single">' ;
echo '<label>' . $lang [ 'SurveyDostop' ] . ':</label>' ;
2021-10-19 13:01:22 +02:00
$result = sisplet_query ( " SELECT value FROM misc WHERE what='SurveyDostop' " );
list ( $SurveyDostop ) = mysqli_fetch_row ( $result );
2022-03-02 22:44:53 +01:00
echo '<select class="dropdown" name="SurveyDostop">' ;
2021-10-19 13:01:22 +02:00
echo ' <option value="0" ' . ( $SurveyDostop == '0' ? " SELECTED " : " " ) . '>' . $lang [ 'forum_admin' ] . '</option>' ;
echo ' <option value="1" ' . ( $SurveyDostop == '1' ? " SELECTED " : " " ) . '>' . $lang [ 'forum_manager' ] . '</option>' ;
echo ' <option value="2" ' . ( $SurveyDostop == '2' ? " SELECTED " : " " ) . '>' . $lang [ 'forum_clan' ] . '</option>' ;
echo ' <option value="3" ' . ( $SurveyDostop == '3' ? " SELECTED " : " " ) . '>' . $lang [ 'forum_registered' ] . '</option>' ;
echo '</select>' ;
2022-03-02 00:43:49 +01:00
echo '</div>' ;
2021-10-19 13:01:22 +02:00
// Default trajanje piskotka
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve_single">' ;
echo '<label>' . $lang [ 'SurveyCookie' ] . ':</label>' ;
2021-10-19 13:01:22 +02:00
$result = sisplet_query ( " SELECT value FROM misc WHERE what='SurveyCookie' " );
list ( $SurveyCookie ) = mysqli_fetch_row ( $result );
2022-03-02 22:44:53 +01:00
echo '<select class="dropdown" name="SurveyCookie">' ;
2021-10-19 13:01:22 +02:00
echo ' <option value="-1" ' . ( $SurveyCookie == '-1' ? " SELECTED " : " " ) . '>' . $lang [ 'without' ] . '</option>' ;
echo ' <option value="0" ' . ( $SurveyCookie == '0' ? " SELECTED " : " " ) . '>' . $lang [ 'srv_cookie_0' ] . '</option>' ;
echo ' <option value="1" ' . ( $SurveyCookie == '1' ? " SELECTED " : " " ) . '>' . $lang [ 'srv_cookie_1' ] . '</option>' ;
echo ' <option value="2" ' . ( $SurveyCookie == '2' ? " SELECTED " : " " ) . '>' . $lang [ 'srv_cookie_2' ] . '</option>' ;
echo '</select>' ;
2022-03-02 00:43:49 +01:00
echo '</div>' ;
echo '</div>' ;
2021-10-19 13:01:22 +02:00
echo '</fieldset>' ;
// INFO
echo '<fieldset><legend>' . $lang [ 'as_info' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve">' ;
2021-10-19 13:01:22 +02:00
AppSettings :: getInstance () -> displaySettingsGroup ( 'info' );
2022-03-02 00:43:49 +01:00
echo '</div>' ;
2021-10-19 13:01:22 +02:00
echo '</fieldset>' ;
// OMEJITVE
echo '<fieldset><legend>' . $lang [ 'as_limits' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve">' ;
2021-10-19 13:01:22 +02:00
AppSettings :: getInstance () -> displaySettingsGroup ( 'limits' );
2022-03-02 00:43:49 +01:00
echo '</div>' ;
2021-10-19 13:01:22 +02:00
echo '</fieldset>' ;
// SMTP NASTAVITVE
echo '<fieldset><legend>' . $lang [ 'as_smtp' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve">' ;
2021-10-19 13:01:22 +02:00
AppSettings :: getInstance () -> displaySettingsGroup ( 'smtp' );
2022-03-02 00:43:49 +01:00
echo '</div>' ;
2021-10-19 13:01:22 +02:00
echo '</fieldset>' ;
// MODULI
echo '<fieldset><legend>' . $lang [ 'as_modules' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<div class="osnovne_nastavitve">' ;
2021-10-19 13:01:22 +02:00
AppSettings :: getInstance () -> displaySettingsGroup ( 'modules' );
2022-03-02 00:43:49 +01:00
echo '</div>' ;
2021-10-19 13:01:22 +02:00
echo '</fieldset>' ;
2022-03-02 00:43:49 +01:00
//UREJANJE OKEN S POMOČJO
2021-10-19 13:01:22 +02:00
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_edithelp' ] . '</legend>' ;
2022-03-02 00:43:49 +01:00
echo '<p class="bottom16" >' . $lang [ 'srv_edithelp' ] . ' ' . Help :: display ( 'srv_window_help' ) . ':</p>' ;
2021-10-19 13:01:22 +02:00
Help :: edit_toggle ();
echo '</form>' ;
echo '</fieldset>' ;
2022-03-03 01:57:38 +01:00
/* Missingi - zakomentirano , prenova po redizajnu
2021-10-19 13:01:22 +02:00
$smv = new SurveyMissingValues ();
$smv -> SystemFilters ();
2022-03-02 00:43:49 +01:00
*/
2021-10-19 13:01:22 +02:00
// save gumb
2022-03-02 00:43:49 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.settingsanketa.submit();">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2021-10-19 13:01:22 +02:00
// div za prikaz uspešnosti shranjevanja
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2021-10-19 13:01:22 +02:00
}
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
/**
* nastavitve predvidenih casov za komponente ankete in vprasanj iz katerih se nato racuna celotna dolzina vprasanj in ankete
*
*/
function anketa_nastavitve_predvidenicasi () {
global $lang ;
2022-03-03 00:07:49 +01:00
global $site_url ;
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
echo '<div id="anketa_edit">' ;
echo '<form name="timinganketa" method="post" action="ajax.php?a=editanketasettings&m=predvidenicasi">' ;
2022-03-03 00:07:49 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_testiranje_predvidenicas' ] . '</legend>' ;
echo '<p class="bottom16">' . $lang [ 'srv_predvidenicasi_help' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<label>' . $lang [ 'srv_timing_page' ] . '</label>' ;
echo '<span><input type="text" class="text large w200" name="timing_stran" value="' . GlobalMisc :: getMisc ( 'timing_stran' ) . '" />  s</span>' ;
echo '</div>' ;
echo '<p class="top16 bottom16">' . $lang [ 'srv_predvidenicasi_note' ] . '</p>' ;
echo '<table id="timinganketa_table">' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_question_type' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_timing_vprasanje' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_timing_kategorija' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_timing_kategorija_max' ] . '</th>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 00:07:49 +01:00
for ( $tip = 1 ; $tip <= 21 ; $tip ++ ) {
2020-08-14 13:36:36 +02:00
2022-03-03 00:07:49 +01:00
if ( $tip <= 8 || $tip >= 16 ) {
echo '<tr>' ;
echo '<td class="left">' . $lang [ 'srv_vprasanje_tip_' . $tip ] . '</td>' ;
echo '<td class="nowrap"><input type="text" name="timing_vprasanje_' . $tip . '" value="' . GlobalMisc :: getMisc ( 'timing_vprasanje_' . $tip ) . '" />  s</td>' ;
if ( $tip <= 3 || $tip == 6 || $tip == 16 || $tip == 17 || $tip == 18 || $tip == 19 || $tip == 20 )
echo '<td class="nowrap"><input type="text" name="timing_kategorija_' . $tip . '" value="' . GlobalMisc :: getMisc ( 'timing_kategorija_' . $tip ) . '" />  s</td>' ;
else
echo '<td></td>' ;
if ( $tip == 3 ){
$kategorija_max = GlobalMisc :: getMisc ( 'timing_kategorija_max_' . $tip );
echo '<td class="nowrap"><input type="text" name="timing_kategorija_max_' . $tip . '" value="' . GlobalMisc :: getMisc ( 'timing_kategorija_max_' . $tip ) . '" />  s</td>' ;
}
else
echo '<td></td>' ;
echo '</tr>' ;
}
}
2020-08-14 13:36:36 +02:00
echo '</table>' ;
echo '</fieldset>' ;
2022-03-03 00:07:49 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . '; return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.timinganketa.submit();">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
echo '</div>' ;
}
function tabTestiranje () {
global $lang ;
// predvideni casi
if ( $_GET [ 'm' ] == 'predvidenicas' ) {
$this -> testiranje_predvidenicas ();
}
// testni podatki
elseif ( $_GET [ 'm' ] == 'testnipodatki' ) {
$this -> testiranje_testnipodatki ();
}
// cas
elseif ( $_GET [ 'm' ] == M_TESTIRANJE_CAS ) {
$this -> testiranje_cas ();;
}
// cas
elseif ( $_GET [ 'm' ] == 'cas' ) {
$this -> testiranje_cas ();
}
}
/**
* izracuna predvidene case po straneh glede na število in dolžino vprašanj
*
*/
function testiranje_predvidenicas ( $samo_izracunaj_skupini_cas = 0 ) {
global $lang ;
$expected_time = array ();
$expected_time_block = array ();
$block_labels_by_number = array ();
$expected_vprasanja = array ();
$verjetnost = array ();
$verjetnost_block = array ();
//from php 7.2 this helps to round numbers calculated in bcmod() - without it, it always rounds down to int
bcscale ( 1 );
$sql = sisplet_query ( " SELECT introduction FROM srv_anketa WHERE id = ' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
// nagovor racunamo kot da gre za labelo
$expected_vprasanja [ 0 ][ 0 ] = strlen ( strip_tags ( $row [ 'introduction' ])) * GlobalMisc :: getMisc ( 'timing_vprasanje_5' ) / 100 ;
$expected_vprasanja [ 0 ][ 1 ] = 1 ;
$expected_vprasanja [ 0 ][ 2 ] = $lang [ 'srv_vprasanje_tip_5' ];
$expected_vprasanja [ 0 ][ 3 ] = $lang [ 'srv_intro_label' ];
$expected_time [ 0 ][ 0 ] = $expected_vprasanja [ 0 ][ 0 ] + GlobalMisc :: getMisc ( 'timing_stran' );
$expected_time [ 0 ][ 1 ] = $expected_time [ 0 ][ 0 ];
$block_spr_data = $this -> get_block_data_by_spr_id ();
$sql = sisplet_query ( " SELECT id, naslov, vrstni_red FROM srv_grupa g WHERE g.ank_id=' $this->anketa ' ORDER BY g.vrstni_red ASC " );
while ( $row = mysqli_fetch_array ( $sql )) {
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] = 0 ;
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] = 0 ;
$sql1 = sisplet_query ( " SELECT id, naslov FROM srv_spremenljivka WHERE gru_id=' $row[id] ' AND visible = '1' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$expected_vprasanja [ $row1 [ 'id' ]][ 0 ] = $this -> vprasanje_predvideni_cas ( $row1 [ 'id' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 1 ] = $this -> vprasanje_verjetnost ( $row1 [ 'id' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 2 ] = strip_tags ( $row1 [ 'naslov' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 3 ] = strip_tags ( $row [ 'naslov' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 4 ] = strip_tags ( $block_spr_data [ $row1 [ 'id' ]][ 'label' ]);
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] += $expected_vprasanja [ $row1 [ 'id' ]][ 0 ] * $expected_vprasanja [ $row1 [ 'id' ]][ 1 ]; // dejanski
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] += $expected_vprasanja [ $row1 [ 'id' ]][ 0 ]; // bruto - z vsemi vprasanji
if ( $expected_vprasanja [ $row1 [ 'id' ]][ 1 ] > $verjetnost [ $row [ 'vrstni_red' ]])
$verjetnost [ $row [ 'vrstni_red' ]] = $expected_vprasanja [ $row1 [ 'id' ]][ 1 ];
}
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] += GlobalMisc :: getMisc ( 'timing_stran' ) * $verjetnost [ $row [ 'vrstni_red' ]]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] += GlobalMisc :: getMisc ( 'timing_stran' );
}
$sql = sisplet_query ( " SELECT * FROM srv_if as bl LEFT JOIN srv_branching as br ON br.parent = bl.id WHERE bl.enabled='0' AND bl.tip='1' AND br.ank_id = ' $this->anketa ' ORDER BY bl.number ASC, br.vrstni_red ASC " );
$last_block_st = - 1 ;
while ( $row = mysqli_fetch_array ( $sql )) {
$new_block = $last_block_st != $row [ 'number' ];
if ( $new_block ){
$last_block_st = $row [ 'number' ];
$label = $row [ 'label' ] ? $row [ 'label' ] : $lang [ 'srv_blok' ] . ' ' . $last_block_st ;
$block_labels_by_number [ $last_block_st ] = $label ;
$expected_time_block [ $last_block_st - 1 ][ 0 ] = 0 ;
$expected_time_block [ $last_block_st - 1 ][ 1 ] = 0 ;
}
if ( ! $row [ 'element_if' ]){
$expected_time_block [ $last_block_st - 1 ][ 0 ] += $expected_vprasanja [ $row [ 'element_spr' ]][ 0 ] * $expected_vprasanja [ $row [ 'element_spr' ]][ 1 ]; // dejanski
$expected_time_block [ $last_block_st - 1 ][ 1 ] += $expected_vprasanja [ $row [ 'element_spr' ]][ 0 ]; // bruto - z vsemi vprasanji
if ( $expected_vprasanja [ $row [ 'element_spr' ]][ 1 ] > $verjetnost_block [ $last_block_st - 1 ])
$verjetnost_block [ $last_block_st - 1 ] = $expected_vprasanja [ $row [ 'element_spr' ]][ 1 ];
}
else {
$sql1 = sisplet_query ( " SELECT * FROM srv_branching WHERE parent=' " . $row [ 'element_if' ] . " ' ORDER BY vrstni_red ASC " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$expected_time_block [ $last_block_st - 1 ][ 0 ] += $expected_vprasanja [ $row1 [ 'element_spr' ]][ 0 ] * $expected_vprasanja [ $row1 [ 'element_spr' ]][ 1 ]; // dejanski
$expected_time_block [ $last_block_st - 1 ][ 1 ] += $expected_vprasanja [ $row1 [ 'element_spr' ]][ 0 ]; // bruto - z vsemi vprasanji
$expected_vprasanja [ $row1 [ 'element_spr' ]][ 4 ] = $label ;
if ( $expected_vprasanja [ $row1 [ 'element_spr' ]][ 1 ] > $verjetnost_block [ $last_block_st - 1 ])
$verjetnost_block [ $last_block_st - 1 ] = $expected_vprasanja [ $row1 [ 'element_spr' ]][ 1 ];
}
}
if ( $new_block ){
$expected_time_block [ $last_block_st - 1 ][ 0 ] += GlobalMisc :: getMisc ( 'timing_stran' ) * $verjetnost_block [ $last_block_st - 1 ]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
$expected_time_block [ $last_block_st - 1 ][ 1 ] += GlobalMisc :: getMisc ( 'timing_stran' );
}
}
// izpis za strani
$max = 0 ;
$total = 0 ;
foreach ( $expected_time AS $key => $val ) {
if ( $val [ 1 ] > $max ) $max = $val [ 1 ];
$total += $val [ 0 ];
}
if ( $max == 0 ) return ;
if ( $samo_izracunaj_skupini_cas == 2 ) {
return $total ;
}
$skupni_cas = ( bcdiv ( $total , 60 , 0 ) > 0 ? bcdiv ( $total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $total , 60 ), 0 ) . 's' ;
if ( $samo_izracunaj_skupini_cas == 1 )
return $skupni_cas ;
echo '<fieldset><legend>' . $lang [ 'srv_total_trajanje' ] . '</legend>' ;
2022-03-03 22:38:40 +01:00
echo '<p class="semi-bold">' . $lang [ 'srv_dejansko_trajanje' ] . ':</p>' ;
2022-03-03 16:01:25 +01:00
echo '<p>' . $skupni_cas . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<fieldset><legend>' . $lang [ 'srv_casi_po_straneh' ] . '</legend>' ;
2022-03-03 16:01:25 +01:00
echo '<table>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_casi_po_straneh_stran' ] . '</th>' ;
2022-03-03 18:01:30 +01:00
echo '<th colspan="2">' . $lang [ 'srv_neto_t_cas' ] . ' / ' . $lang [ 'srv_bruto_t_cas' ] . '</th>' ;
2022-03-03 16:01:25 +01:00
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
foreach ( $expected_time AS $vrstni_red => $time ) {
$sql = sisplet_query ( " SELECT naslov FROM srv_grupa WHERE vrstni_red=' $vrstni_red ' AND ank_id = ' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
echo '<tr>' ;
2022-03-03 18:01:30 +01:00
echo '<td>' . ( $row [ 'naslov' ] != '' ? $row [ 'naslov' ] : $lang [ 'srv_intro_label' ]) . '</td>' ;
2022-03-03 16:01:25 +01:00
2022-03-03 18:05:00 +01:00
echo '<td class="right time">' ;
2022-03-03 16:01:25 +01:00
echo ( $time [ 0 ] < 60 ? round ( $time [ 0 ], 1 ) . 's ' : round ( $time [ 0 ] / 60 , 1 ) . 'min ' ) . '/ <span class="gray">' . ( $time [ 1 ] < 60 ? round ( $time [ 1 ], 1 ) . 's ' : round ( $time [ 1 ] / 60 , 1 ) . 'min ' ) . '</span>' ;
2022-03-03 18:01:30 +01:00
echo '</td>' ;
2022-03-03 16:01:25 +01:00
2022-03-03 18:01:30 +01:00
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
2022-03-09 18:36:32 +01:00
echo '<div class="graph_full" style="width: ' . ( $time [ 0 ] / $max * 85 ) . '%"></div>' ;
2020-08-14 13:36:36 +02:00
if ((( $time [ 1 ] - $time [ 0 ]) / $max * 85 ) > 0 )
2022-03-09 18:36:32 +01:00
echo ' <div class="graph_empty" style="width: ' . (( $time [ 1 ] - $time [ 0 ]) / $max * 85 ) . '%"></div>' ;
2022-03-03 16:01:25 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</td>' ;
echo '</tr>' ;
}
2022-03-08 23:36:15 +01:00
echo '<tr class="semi-bold"><td>' . $lang [ 'srv_casi_po_vprasanjih_skupaj' ] . '</td><td class="right time">' . $skupni_cas . 's</td><td></td></tr>' ;
2020-08-14 13:36:36 +02:00
echo '</table>' ;
2022-03-03 16:01:25 +01:00
echo '<div class="tabela_trajanje_legenda">' ;
echo '<div class="graph_full legend"></div><span class="legend"> ' . $lang [ 'srv_neto_t_cas' ] . '</span>' ;
echo '<div class="graph_empty legend"></div><span class="legend"> ' . $lang [ 'srv_bruto_t_cas' ] . '</span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// izpis za vprasanja
$max = 0 ;
$bruto_total = 0 ;
$neto_total = 0 ;
foreach ( $expected_vprasanja AS $vpr ) {
if ( $vpr [ 0 ] > $max ) $max = $vpr [ 0 ];
$bruto_total += $vpr [ 0 ];
$neto_total += $vpr [ 0 ] * $vpr [ 1 ];
}
$prevstran = false ;
echo '<fieldset><legend>' . $lang [ 'srv_casi_po_vprasanjih_strani' ] . '</legend>' ;
2022-03-03 20:49:11 +01:00
echo '<table>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_casi_po_straneh_stran' ] . '/' . $lang [ 'srv_casi_po_vprasanjih_vprasanje' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_bruto_v_cas' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_verjetnost_pojavitve' ] . '</th>' ;
echo '<th colspan="2">' . $lang [ 'srv_neto_v_cas' ] . '/' . $lang [ 'srv_bruto_v_cas_long' ] . '</th>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
foreach ( $expected_vprasanja AS $vprasanje ) {
if ( ! $prevstran || $prevstran != $vprasanje [ 3 ]) {
2022-03-03 22:38:40 +01:00
echo '<tr><td class="semi-bold" colspan="5">' . $vprasanje [ 3 ] . '</td></tr>' ;
2020-08-14 13:36:36 +02:00
$prevstran = $vprasanje [ 3 ];
}
$bruto = $vprasanje [ 0 ];
$verjetnost = $vprasanje [ 1 ];
$neto = $bruto * $verjetnost ;
2022-03-03 20:49:11 +01:00
echo '<tr>' ;
echo '<td><span title="' . $vprasanje [ 2 ] . '">' . skrajsaj ( $vprasanje [ 2 ], 30 ) . '</span></td>' ;
echo '<td class="right">' . round ( $bruto , 1 ) . 's</td>' ;
echo '<td class="center">' . round ( $verjetnost * 100 , 2 ) . '%</td>' ;
echo '<td class="right time">' ;
echo round ( $neto , 1 ) . 's / <span class="gray">' . round ( $bruto , 1 ) . 's</span>' ;
echo '</td>' ;
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
2022-03-09 18:36:32 +01:00
echo '<div class="graph_full" style="width: ' . ( $neto / $max * 85 ) . '%"></div>' ;
2020-08-14 13:36:36 +02:00
if (( $bruto - $neto ) / $max * 85 > 0 )
2022-03-09 18:36:32 +01:00
echo ' <div class="graph_empty" style="width: ' . (( $bruto - $neto ) / $max * 85 ) . '%"></div>' ;
2022-03-03 20:49:11 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</td>' ;
2022-03-03 20:49:11 +01:00
2020-08-14 13:36:36 +02:00
echo '</tr>' ;
}
2022-03-08 23:36:15 +01:00
echo '<tr class="semi-bold"><td>' . $lang [ 'srv_casi_po_vprasanjih_skupaj' ] . '</td><td class="right">' . ( bcdiv ( $bruto_total , 60 , 0 ) > 0 ? bcdiv ( $bruto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $bruto_total , 60 ), 0 ) . 's</td><td></td><td class="right time">' . ( bcdiv ( $neto_total , 60 , 0 ) > 0 ? bcdiv ( $neto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $neto_total , 60 ), 0 ) . 's / ' . ( bcdiv ( $bruto_total , 60 , 0 ) > 0 ? bcdiv ( $bruto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $bruto_total , 60 ), 0 ) . 's</td><td></td></tr>' ;
2020-08-14 13:36:36 +02:00
echo '</table>' ;
2022-03-03 20:49:11 +01:00
echo '<div class="tabela_trajanje_legenda">' ;
echo '<div class="graph_full legend"></div><span class="legend"> ' . $lang [ 'srv_neto_v_cas' ] . '</span>' ;
echo '<div class="graph_empty legend"></div><span class="legend"> ' . $lang [ 'srv_bruto_v_cas_long' ] . '</span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2022-03-03 20:49:11 +01:00
//CASI PO BLOKIH
if ( $block_spr_data ){
// izpis za bloke
$maxb = 0 ;
$totalb = 0 ;
foreach ( $expected_time_block AS $key => $val ) {
if ( $val [ 1 ] > $maxb ) $maxb = $val [ 1 ];
$totalb += $val [ 0 ];
}
echo '<fieldset><legend>' . $lang [ 'srv_casi_po_blokih' ] . '</legend>' ;
echo '<table>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_casi_po_blokih_blok' ] . '</th>' ;
echo '<th colspan="2">' . $lang [ 'srv_neto_t_cas' ] . ' / ' . $lang [ 'srv_bruto_t_cas' ] . '</th>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
foreach ( $expected_time_block AS $vrstni_red => $time ) {
echo '<tr>' ;
echo '<td class="nowrap">' . $block_labels_by_number [ $vrstni_red + 1 ] . '</td>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '<td class="right time">' ;
echo ( $time [ 0 ] < 60 ? round ( $time [ 0 ], 1 ) . 's ' : round ( $time [ 0 ] / 60 , 1 ) . 'min ' ) . '<span class="gray">/ ' . ( $time [ 1 ] < 60 ? round ( $time [ 1 ], 1 ) . 's ' : round ( $time [ 1 ] / 60 , 1 ) . 'min ' ) . '</span>' ;
echo '</td>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
2022-03-09 18:36:32 +01:00
echo ' <div class="graph_full" style="width: ' . ( $time [ 0 ] / $maxb * 85 ) . '%"></div>' ;
2022-03-03 20:49:11 +01:00
if ((( $time [ 1 ] - $time [ 0 ]) / $maxb * 85 ) > 0 )
2022-03-09 18:36:32 +01:00
echo ' <div class="graph_empty" style="width: ' . (( $time [ 1 ] - $time [ 0 ]) / $maxb * 85 ) . '%"></div>' ;
2022-03-03 20:49:11 +01:00
echo '</div>' ;
echo '</td>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '</tr>' ;
}
2022-03-03 22:38:40 +01:00
echo '<tr class="semi-bold"><td>' . $lang [ 'srv_casi_po_vprasanjih_skupaj' ] . '</td><td class="right time">' . ( bcdiv ( $totalb , 60 , 0 ) > 0 ? bcdiv ( $totalb , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $totalb , 60 ), 0 ) . 's</td><td></td><td></td><td></td></tr>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '</table>' ;
2020-08-14 13:36:36 +02:00
2022-03-03 20:49:11 +01:00
echo '<div class="tabela_trajanje_legenda">' ;
echo '<div class="graph_full legend"></div><span class="legend"> ' . $lang [ 'srv_neto_t_cas' ] . '</span>' ;
echo '<div class="graph_empty legend"></div><span class="legend"> ' . $lang [ 'srv_bruto_t_cas' ] . '</span>' ;
echo '</div>' ;
echo '</fieldset>' ;
// izpis za vprasanja po blokih
$max = 0 ;
$bruto_total = 0 ;
$neto_total = 0 ;
foreach ( $expected_vprasanja AS $vpr ) {
if ( $vpr [ 4 ]){
if ( $vpr [ 0 ] > $max ) $max = $vpr [ 0 ];
$bruto_total += $vpr [ 0 ];
$neto_total += $vpr [ 0 ] * $vpr [ 1 ];
}
}
$prevstran = false ;
echo '<fieldset><legend>' . $lang [ 'srv_casi_po_vprasanjih_bloki' ] . '</legend>' ;
echo '<table>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_casi_po_straneh_stran' ] . '/' . $lang [ 'srv_casi_po_vprasanjih_vprasanje' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_bruto_v_cas' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_verjetnost_pojavitve' ] . '</th>' ;
echo '<th colspan="2">' . $lang [ 'srv_neto_v_cas' ] . '/' . $lang [ 'srv_bruto_v_cas_long' ] . '</th>' ;
echo '</tr>' ;
foreach ( $expected_vprasanja AS $vprasanje ) {
if ( $vprasanje [ 4 ]){
if ( ! $prevstran || $prevstran != $vprasanje [ 4 ]) {
2022-03-03 22:38:40 +01:00
echo '<tr><td class="semi-bold" colspan="5">' . $vprasanje [ 4 ] . '</td></tr>' ;
2022-03-03 20:49:11 +01:00
$prevstran = $vprasanje [ 4 ];
}
$bruto = $vprasanje [ 0 ];
$verjetnost = $vprasanje [ 1 ];
$neto = $bruto * $verjetnost ;
echo '<tr>' ;
echo '<td><span title="' . $vprasanje [ 2 ] . '">' . skrajsaj ( $vprasanje [ 2 ], 30 ) . '</span></td>' ;
echo '<td class="right">' . round ( $bruto , 1 ) . 's</td>' ;
echo '<td class="center">' . round ( $verjetnost * 100 , 2 ) . '%</td>' ;
echo '<td class="right time">' ;
echo round ( $neto , 1 ) . 's / <span class="gray">' . round ( $bruto , 1 ) . 's</span>' ;
echo '</td>' ;
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
2022-03-09 18:36:32 +01:00
echo '<div class="graph_full" style="width: ' . ( $neto / $max * 85 ) . '%"></div>' ;
2022-03-03 20:49:11 +01:00
if (( $bruto - $neto ) / $max * 85 > 0 )
2022-03-09 18:36:32 +01:00
echo ' <div class="graph_empty" style="width: ' . (( $bruto - $neto ) / $max * 85 ) . '%"></div>' ;
2022-03-03 20:49:11 +01:00
echo '</div>' ;
echo '</td>' ;
echo '</tr>' ;
}
}
2022-03-08 23:36:15 +01:00
echo '<tr class="semi-bold"><td>' . $lang [ 'srv_casi_po_vprasanjih_skupaj' ] . '</td><td class="right">' . ( bcdiv ( $bruto_total , 60 , 0 ) > 0 ? bcdiv ( $bruto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $bruto_total , 60 ), 0 ) . 's</td><td></td><td class="right time">' . ( bcdiv ( $neto_total , 60 , 0 ) > 0 ? bcdiv ( $neto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $neto_total , 60 ), 0 ) . 's / ' . ( bcdiv ( $bruto_total , 60 , 0 ) > 0 ? bcdiv ( $bruto_total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $bruto_total , 60 ), 0 ) . 's</td><td></td></tr>' ;
2022-03-03 20:49:11 +01:00
echo '</table>' ;
echo '<div class="tabela_trajanje_legenda">' ;
echo '<div class="graph_full legend"></div><span class="legend"> ' . $lang [ 'srv_neto_v_cas' ] . '</span>' ;
echo '<div class="graph_empty legend"></div><span class="legend"> ' . $lang [ 'srv_bruto_v_cas_long' ] . '</span>' ;
echo '</div>' ;
echo '</fieldset>' ;
}
2020-08-14 13:36:36 +02:00
}
/**
* Dobi podatke o bloku za vsako spremenljivko , ali false , ce ni blokov
*/
function get_block_data_by_spr_id (){
global $lang ;
$data = array ();
$block_query = sisplet_query ( " SELECT * FROM srv_if as bl LEFT JOIN srv_branching as br ON br.parent = bl.id WHERE bl.enabled='0' AND bl.tip='1' AND br.ank_id = ' $this->anketa ' ORDER BY br.vrstni_red ASC " , 'array' );
if ( $block_query ){
foreach ( $block_query as $row ) {
$label = $row [ 'label' ] ? $row [ 'label' ] : $lang [ 'srv_blok' ] . ' ' . $row [ 'number' ];
$data [ $row [ 'element_spr' ]] = array ( 'label' => $label );
}
return $data ;
}
return false ;
}
/**
* oceni predvideni cas za vprasanje
*
* @ param mixed $spremenljivka
*/
function vprasanje_predvideni_cas ( $spremenljivka ) {
$sql1 = sisplet_query ( " SELECT id, naslov, tip FROM srv_spremenljivka WHERE id = ' $spremenljivka ' " );
$row1 = mysqli_fetch_array ( $sql1 );
$expected_time = strlen ( strip_tags ( $row1 [ 'naslov' ])) * GlobalMisc :: getMisc ( 'timing_vprasanje_' . $row1 [ 'tip' ]) / 100 ;
// vprasanja, ki imajo tudi kategorije/vrednosti
if ( $row1 [ 'tip' ] <= 3 || $row1 [ 'tip' ] == 6 || $row1 [ 'tip' ] == 16 || $row1 [ 'tip' ] == 17 || $row1 [ 'tip' ] == 18 || $row1 [ 'tip' ] == 19 || $row1 [ 'tip' ] == 20 ) {
$sql2 = sisplet_query ( " SELECT naslov FROM srv_vrednost WHERE spr_id=' $row1[id] ' " );
//for those types we have max time option
if ( $row1 [ 'tip' ] == 3 ){
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
$expected_time_temp += strlen ( strip_tags ( $row2 [ 'naslov' ])) * GlobalMisc :: getMisc ( 'timing_kategorija_' . $row1 [ 'tip' ]) / 100 ;
}
//if time is greater than max time, use max time
$max_time = GlobalMisc :: getMisc ( 'timing_kategorija_max_' . $row1 [ 'tip' ]);
$expected_time += ( $max_time > $expected_time_temp ) ? $expected_time_temp : $max_time ;
}
//types that doesnt have max time option
else {
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
$expected_time += strlen ( strip_tags ( $row2 [ 'naslov' ])) * GlobalMisc :: getMisc ( 'timing_kategorija_' . $row1 [ 'tip' ]) / 100 ;
}
}
}
return $expected_time ;
}
/**
* oceni verjetnost prikaza vprasanja glede na pogoje , ki so mu nastavljeni
*
* @ param mixed $spremenljivka
*/
function vprasanje_verjetnost ( $spremenljivka ) {
$sql = sisplet_query ( " SELECT parent FROM srv_branching WHERE element_spr = ' $spremenljivka ' " );
$row = mysqli_fetch_array ( $sql );
if ( $row [ 'parent' ] == 0 ) return 1 ; // vprasanje se vedno prikaze
//echo $this->if_verjetnost($row['parent']).'<hr>';
return $this -> if_verjetnost ( $row [ 'parent' ]);
}
/**
* oceni verjetnost da bo pogoj ( if ) izpolnjen
*
* @ param mixed $if
*/
function if_verjetnost ( $if ) {
$sql = sisplet_query ( " SELECT parent FROM srv_branching WHERE element_if = ' $if ' " );
if ( mysqli_num_rows ( $sql ) == 0 ) return 0 ;
$row = mysqli_fetch_array ( $sql );
// izracunamo se verjetnost parentov
if ( $row [ 'parent' ] > 0 ){
// dodaten pogoj da nismo v deadlocku (zaradi bugov se znata v branchingu pojavit ifa, ki imata drug drugega za parenta)
$sqlX = sisplet_query ( " SELECT parent, element_if FROM srv_branching WHERE parent=' " . $if . " ' AND element_if=' " . $row [ 'parent' ] . " ' " );
if ( mysqli_num_rows ( $sqlX ) > 0 ){
return 0 ;
}
$parent = $this -> if_verjetnost ( $row [ 'parent' ]);
}
else
$parent = 1 ;
$sql = sisplet_query ( " SELECT tip FROM srv_if WHERE id = ' $if ' " );
$row = mysqli_fetch_array ( $sql );
if ( $row [ 'tip' ] == 1 ) return 1 * $parent ; // blok je vedno 'izpolnjen'
$eval = ' $total = ' ;
$i = 0 ;
// racunanje verjetnosti za podani if
$sql = sisplet_query ( " SELECT * FROM srv_condition WHERE if_id = ' $if ' ORDER BY vrstni_red ASC " );
while ( $row = mysqli_fetch_array ( $sql )) {
$value = '' ;
if (( $value = $this -> condition_verjetnost ( $row [ 'id' ])) !== false ){
if ( $i ++ != 0 ){
if ( $row [ 'conjunction' ] == 0 )
$eval .= ' * ' ;
else
$eval .= ' + ' ;
}
for ( $i = 1 ; $i <= $row [ 'left_bracket' ]; $i ++ )
$eval .= ' ( ' ;
$eval .= $value ;
for ( $i = 1 ; $i <= $row [ 'right_bracket' ]; $i ++ )
$eval .= ' ) ' ;
}
}
$eval .= ';' ;
if ( $eval != ' $total = ;' )
@ eval ( $eval ); //echo '--'.$eval.'--';
else
$total = 1 ;
if ( $total > 1 ) return 1 * $parent ; else return $total * $parent ;
}
/**
* vrne verjetnost , da je izpolnjen condition ( ena vrstica v IFu )
*
* @ param mixed $condition
*/
function condition_verjetnost ( $condition ) {
$sql = sisplet_query ( " SELECT * FROM srv_condition WHERE id = ' $condition ' " );
if ( mysqli_num_rows ( $sql ) == 0 ) return 0 ;
$row = mysqli_fetch_array ( $sql );
// obicne spremenljivke
if ( $row [ 'spr_id' ] > 0 ) {
$row2 = Cache :: srv_spremenljivka ( $row [ 'spr_id' ]);
// radio, checkbox, dropdown in multigrid
if ( $row2 [ 'tip' ] <= 3 || $row2 [ 'tip' ] == 6 ) {
// obicne spremenljivke
if ( $row [ 'vre_id' ] == 0 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id=' $row[spr_id] ' " );
$vse_vrednosti = mysqli_num_rows ( $sql1 );
$sql1 = sisplet_query ( " SELECT * FROM srv_condition_vre WHERE cond_id = ' $condition ' " );
$izbrane_vrednosti = mysqli_num_rows ( $sql1 );
if ( $vse_vrednosti > 0 )
$p = $izbrane_vrednosti / $vse_vrednosti ;
else
$p = 0 ;
if ( $row [ 'operator' ] == 0 )
return $p ;
else
return 1 - $p ;
// multigrid
} elseif ( $row [ 'vre_id' ] > 0 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id=' $row[spr_id] ' " );
$vse_vrednosti = mysqli_num_rows ( $sql1 );
$sql1 = sisplet_query ( " SELECT * FROM srv_condition_grid WHERE cond_id = ' $condition ' " );
$izbrane_vrednosti = mysqli_num_rows ( $sql1 );
if ( $vse_vrednosti > 0 )
$p = $izbrane_vrednosti / $vse_vrednosti ;
else
$p = 0 ;
if ( $row [ 'operator' ] == 0 )
return $p ;
else
return 1 - $p ;
}
// number in text
} else {
return 0.5 ;
}
// recnum
} elseif ( $row [ 'spr_id' ] == - 1 ) {
return 1 / $row [ 'modul' ];
// calculations
} elseif ( $row [ 'spr_id' ] == - 2 ) {
return 0.5 ;
// quotas
} elseif ( $row [ 'spr_id' ] == - 3 ) {
return 1 ;
}
return false ;
}
/**
* prikazuje povprecne case po straneh ipd ....
*
*/
function testiranje_cas ( $samo_izracunaj_skupini_cas = 0 ) {
global $lang ;
global $global_user_id ;
global $admin_type ;
SurveyUserSetting :: getInstance () -> Init ( $this -> anketa , $global_user_id );
// nastavitve iz popupa
$rezanje = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje' ); if ( $rezanje == '' ) $rezanje = 1 ;
$rezanje_meja_sp = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_meja_sp' ); if ( $rezanje_meja_sp == '' ) $rezanje_meja_sp = 5 ;
$rezanje_meja_zg = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_meja_zg' ); if ( $rezanje_meja_zg == '' ) $rezanje_meja_zg = 5 ;
$rezanje_predvidena_sp = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_predvidena_sp' ); if ( $rezanje_predvidena_sp == '' ) $rezanje_predvidena_sp = 10 ;
$rezanje_predvidena_zg = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_predvidena_zg' ); if ( $rezanje_predvidena_zg == '' ) $rezanje_predvidena_zg = 200 ;
$rezanje_preskocene = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_preskocene' ); if ( $rezanje_preskocene == '' ) $rezanje_preskocene = 1 ;
/* ++ Predvideni casi */
if ( $_GET [ 'predvideni' ] == 1 || $rezanje == 1 ) {
$expected_time = array ();
$expected_vprasanja = array ();
$verjetnost = array ();
$sql = sisplet_query ( " SELECT introduction FROM srv_anketa WHERE id = ' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
// nagovor racunamo kot da gre za labelo
$expected_vprasanja [ 0 ][ 0 ] = strlen ( strip_tags ( $row [ 'introduction' ])) * GlobalMisc :: getMisc ( 'timing_vprasanje_5' ) / 100 ;
$expected_vprasanja [ 0 ][ 1 ] = 1 ;
$expected_vprasanja [ 0 ][ 2 ] = $lang [ 'srv_vprasanje_tip_5' ];
$expected_vprasanja [ 0 ][ 3 ] = $lang [ 'srv_intro_label' ];
$expected_time [ 0 ][ 0 ] = $expected_vprasanja [ 0 ][ 0 ] + GlobalMisc :: getMisc ( 'timing_stran' );
$expected_time [ 0 ][ 1 ] = $expected_time [ 0 ][ 0 ];
$sql = sisplet_query ( " SELECT id, naslov, vrstni_red FROM srv_grupa g WHERE g.ank_id=' $this->anketa ' ORDER BY g.vrstni_red ASC " );
while ( $row = mysqli_fetch_array ( $sql )) {
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] = 0 ;
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] = 0 ;
$sql1 = sisplet_query ( " SELECT id, naslov FROM srv_spremenljivka WHERE gru_id=' $row[id] ' AND visible='1' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$expected_vprasanja [ $row1 [ 'id' ]][ 0 ] = $this -> vprasanje_predvideni_cas ( $row1 [ 'id' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 1 ] = $this -> vprasanje_verjetnost ( $row1 [ 'id' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 2 ] = strip_tags ( $row1 [ 'naslov' ]);
$expected_vprasanja [ $row1 [ 'id' ]][ 3 ] = strip_tags ( $row [ 'naslov' ]);
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] += $expected_vprasanja [ $row1 [ 'id' ]][ 0 ] * $expected_vprasanja [ $row1 [ 'id' ]][ 1 ]; // dejanski
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] += $expected_vprasanja [ $row1 [ 'id' ]][ 0 ]; // bruto - z vsemi vprasanji
if ( $expected_vprasanja [ $row1 [ 'id' ]][ 1 ] > $verjetnost [ $row [ 'vrstni_red' ]])
$verjetnost [ $row [ 'vrstni_red' ]] = $expected_vprasanja [ $row1 [ 'id' ]][ 1 ];
}
$expected_time [ $row [ 'vrstni_red' ]][ 0 ] += GlobalMisc :: getMisc ( 'timing_stran' ) * $verjetnost [ $row [ 'vrstni_red' ]]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
$expected_time [ $row [ 'vrstni_red' ]][ 1 ] += GlobalMisc :: getMisc ( 'timing_stran' );
}
}
/* -- Predvideni casi */
// statusi
SurveyStatusCasi :: Init ( $this -> anketa );
$izbranStatusCasi = SurveyStatusCasi :: getCurentProfileId ();
$statusArray = SurveyStatusCasi :: getStatusArray ( $izbranStatusCasi );
$status = '' ;
foreach ( $statusArray AS $key => $val ) {
if ( $key == 'statusnull' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '-1' ;
if ( $key == 'status0' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '0' ;
if ( $key == 'status1' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '1' ;
if ( $key == 'status2' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '2' ;
if ( $key == 'status3' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '3' ;
if ( $key == 'status4' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '4' ;
if ( $key == 'status5' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '5' ;
if ( $key == 'status6' && $val == 1 ) $status .= ( $status != '' ? ',' : '' ) . '6' ;
if ( $key == 'statuslurker' && $val == 1 ) $lurker = " " ; else $lurker = " AND lurker='0' " ;
}
// preberemo vse timestampe za strani v anketi
$sql = sisplet_query ( " SELECT ug.usr_id, UNIX_TIMESTAMP(ug.time_edit) AS time_edit_u, g.vrstni_red FROM srv_user_grupa " . $this -> db_table . " ug, srv_grupa g, srv_user u WHERE ug.usr_id=u.id AND u.last_status IN ( $status ) $lurker AND ug.gru_id=g.id AND g.ank_id=' $this->anketa ' ORDER BY usr_id, gru_id " );
if ( ! $sql ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
if ( mysqli_num_rows ( $sql ) == 0 ) {
if ( $samo_izracunaj_skupini_cas == 1 ) {
return null ;
} else {
echo '<div style="padding: 5px;" class="clr">' . $lang [ 'srv_analiza_no_entry' ] . '</div>' ;
}
}
$user_grupa = array ();
while ( $row = mysqli_fetch_array ( $sql )) {
$user_grupa [ $row [ 'usr_id' ]][ $row [ 'vrstni_red' ]] = $row [ 'time_edit_u' ];
}
if ( mysqli_num_rows ( $sql ) == 0 ) {
die ();
}
// cache mysql-a
$usrs_id = array ();
foreach ( $user_grupa AS $usr_id => $val ) {
$usrs_id [] = $usr_id ;
}
$cache_row = array ();
2020-12-07 09:43:59 +01:00
$sql_c = sisplet_query ( " SELECT id, recnum, time_insert, UNIX_TIMESTAMP(time_insert) AS time_insert_u FROM srv_user WHERE id IN ( " . implode ( ',' , $usrs_id ) . " ) " );
2020-08-14 13:36:36 +02:00
if ( ! $sql_c ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
while ( $row_c = mysqli_fetch_array ( $sql_c )) {
$cache_row [ $row_c [ 'id' ] ] = $row_c ;
}
$cache_row1 = array ();
2020-12-07 09:43:59 +01:00
$sql1_c = sisplet_query ( " SELECT usr_id, time_edit, UNIX_TIMESTAMP(time_edit) AS time_edit_u FROM srv_user_grupa " . $this -> db_table . " WHERE usr_id IN ( " . implode ( ',' , $usrs_id ) . " ) AND gru_id = '0' " );
2020-08-14 13:36:36 +02:00
if ( ! $sql1_c ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
while ( $row1_c = mysqli_fetch_array ( $sql1_c )) {
$cache_row1 [ $row1_c [ 'usr_id' ] ] = $row1_c ;
}
// izracunamo razlike v casih, da dobimo za vsakega userja koliko casa je bil na posamezni strani
$casi = array ();
foreach ( $user_grupa AS $usr_id => $val ) {
//$sql = sisplet_query("SELECT recnum, time_insert, UNIX_TIMESTAMP(time_insert) AS time_insert_u FROM srv_user WHERE id = '$usr_id'");
//$row = mysqli_fetch_array($sql);
$row = $cache_row [ $usr_id ];
//$sql1 = sisplet_query("SELECT time_edit, UNIX_TIMESTAMP(time_edit) AS time_edit_u FROM srv_user_grupa".$this->db_table." WHERE usr_id = '$usr_id' AND gru_id = '0'");
//$row1 = mysqli_fetch_array($sql1);
$row1 = $cache_row1 [ $usr_id ];
//echo $row1['time_edit'].' ('.($row1['time_edit_u'] - strtotime($row1['time_edit'])).') - '.$row['time_insert'].' ('.($row['time_insert_u'] - strtotime($row['time_insert'])).')<br>';
$prev = ( $row1 [ 'time_edit' ] != '' ? $row1 [ 'time_edit_u' ] : $row [ 'time_insert_u' ]);
// nagovor
//if ($row1['time_edit'] != '') $casi[0][$usr_id] = $this->diff($row1['time_edit'], $row['time_insert']);
if ( $row1 [ 'time_edit' ] != '' ) $casi [ 0 ][ $usr_id ] = abs ( $row1 [ 'time_edit_u' ] - $row [ 'time_insert_u' ]);
if ( $row [ 'recnum' ] > 0 ) { // zapisi brez recnuma ne pridejo v poštev, ker nimajo pravih časov
foreach ( $val AS $vrstni_red => $time_edit ) {
//$casi[$vrstni_red][$usr_id] = $this->diff($time_edit, $prev);
$casi [ $vrstni_red ][ $usr_id ] = abs ( $time_edit - $prev );
$prev = $time_edit ;
}
}
}
// porezemo zgornjih in spodnjih 5% casov vsake strani
//if (isset($_GET['truncate'])) $truncate = ((int)$_GET['truncate'])/100; else $truncate = 0.05;
$spodnja = $rezanje_meja_sp / 100 ;
$zgornja = $rezanje_meja_zg / 100 ;
// REZANJE
foreach ( $casi AS $vrstni_red => $val1 ) {
asort ( $casi [ $vrstni_red ]);
$len = count ( $casi [ $vrstni_red ]);
$odrezi_sp = ( int ) round ( $len * $spodnja , 0 );
$odrezi_zg = ( int ) round ( $len * $zgornja , 0 );
$i = 1 ;
foreach ( $casi [ $vrstni_red ] AS $key => $val2 ) {
if ( $rezanje == 0 ) { // rezanje po zgornji in spodnji meji
if ( $i <= $odrezi_sp || $i > $len - $odrezi_zg ) {
unset ( $casi [ $vrstni_red ][ $key ]);
}
} else { // rezanje glede na 10% in 200% predvidenih vrednosti
if ( $val2 < $expected_time [ $vrstni_red ][ 0 ] * $rezanje_predvidena_sp / 100 || $val2 > $expected_time [ $vrstni_red ][ 0 ] * $rezanje_predvidena_zg / 100 ) {
unset ( $casi [ $vrstni_red ][ $key ]);
}
}
$i ++ ;
}
}
//foreach ($casi AS $key => $val) { echo $key.': '; foreach ($val AS $k => $v) { echo $v.', '; } echo '<br>'; }
// izracunamo povprecne case
$sql = sisplet_query ( " SELECT MAX(vrstni_red) AS max FROM srv_grupa WHERE ank_id = ' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
$count = array ();
$count_bruto = array ();
$povprecni_casi = array ();
$povprecni_casi_bruto = array ();
$max_time = 0 ;
for ( $i = 0 ; $i <= $row [ 'max' ]; $i ++ ) $povprecni_casi [ $i ] = 0 ;
foreach ( $casi AS $vrstni_red => $val ) {
// pogledamo za preskocene strani
$preskocene = array ();
if ( $rezanje_preskocene == 0 ) {
$sqlp = sisplet_query ( " SELECT ug.usr_id FROM srv_user_grupa " . $this -> db_table . " ug, srv_grupa g WHERE g.id=ug.gru_id AND g.vrstni_red=' $vrstni_red ' AND ug.preskocena='1' " );
while ( $rowp = mysqli_fetch_array ( $sqlp )) {
array_push ( $preskocene , $rowp [ 'usr_id' ]);
}
}
foreach ( $casi [ $vrstni_red ] AS $usr_id => $time ) {
if ( ! in_array ( $usr_id , $preskocene )) {
$povprecni_casi_bruto [ $vrstni_red ] += $time ; // bruto so kao brez upoštevanja strani ki so se preskocile (0s, 1s)
$count_bruto [ $vrstni_red ] ++ ; // to je dejansko trajanje strani, ce uporabnik pride nanjo
}
if ( ! in_array ( $usr_id , $preskocene ) || $rezanje_preskocene == 1 ) {
$povprecni_casi [ $vrstni_red ] += $time ; // neto je kao povprecno trajanje strani in uposteva tudi 0s, 1s ce se je preskocilo
$count [ $vrstni_red ] ++ ; // ta cas pride potem dejansko krajsi od bruto casa
}
if ( $time > $max_time ) $max_time = $time ;
}
}
foreach ( $povprecni_casi AS $vrstni_red => $time ) {
if ( $count [ $vrstni_red ] > 0 )
$povprecni_casi [ $vrstni_red ] = $time / $count [ $vrstni_red ];
}
foreach ( $povprecni_casi_bruto AS $vrstni_red => $time ) {
if ( $count_bruto [ $vrstni_red ] > 0 )
$povprecni_casi_bruto [ $vrstni_red ] = $time / $count_bruto [ $vrstni_red ];
}
$max = 0 ;
$total = 0 ;
$total_predvideni = 0 ;
foreach ( $povprecni_casi AS $key => $val ) {
if ( $val > $max ) $max = $val ;
$total += $val ;
}
/* foreach ( $povprecni_casi AS $key => $val ) {
if ( $val > $max ) $max = $val ;
//$total += $val;
} */
if ( $_GET [ 'predvideni' ] == 1 ) {
if ( $rezanje_preskocene == 1 ) {
foreach ( $expected_time AS $key => $val ) {
if ( $val [ 0 ] > $max ) $max = $val [ 0 ];
$total_predvideni += $val [ 0 ];
}
} else {
foreach ( $expected_time AS $key => $val ) {
if ( $val [ 1 ] > $max ) $max = $val [ 1 ];
$total_predvideni += $val [ 1 ];
}
}
}
if ( $max == 0 ) return ;
if ( $samo_izracunaj_skupini_cas == 1 )
return ( bcdiv ( $total , 60 , 0 ) > 0 ? bcdiv ( $total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $total , 60 ), 0 ) . 's' ;
// izpis
2022-03-09 18:36:32 +01:00
$skupni_cas = ( bcdiv ( $total , 60 , 0 ) > 0 ? bcdiv ( $total , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $total , 60 ), 0 ) . 's' ;
$predviden_cas = ( bcdiv ( $total_predvideni , 60 , 0 ) > 0 ? bcdiv ( $total_predvideni , 60 , 0 ) . 'min ' : '' ) . '' . round ( bcmod ( $total_predvideni , 60 ), 0 );
echo '<fieldset><legend>' . $lang [ 'srv_total_trajanje' ] . '</legend>' ;
echo '<p class="semi-bold">' . $lang [ 'srv_dejansko_trajanje_real' ] . ':</p>' ;
echo '<p>' . $skupni_cas . '</p>' ;
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_dejanski_casi' ] . '</legend>' ;
2022-03-09 18:36:32 +01:00
echo '<p class="bottom16"><input type="checkbox" name="predvideni" id="predvideni" value="1" onclick="vnos_redirect(\'index.php?anketa=' . $this -> anketa . '&a=testiranje&m=cas&predvideni=' . ( $_GET [ 'predvideni' ] == 1 ? '0' : '1' ) . '&pages=' . $_GET [ 'pages' ] . '&prikazi01=' . $_GET [ 'prikazi01' ] . '\');" ' . ( $_GET [ 'predvideni' ] == 1 ? 'checked' : '' ) . ' /><label for="predvideni">' . $lang [ 'srv_vkljuci_predvidene' ] . '</label></p>' ;
echo '<table>' ;
echo '<tr>' ;
echo '<th>' . $lang [ 'srv_casi_po_straneh_stran' ] . '</th>' ;
echo '<th colspan="2">' . $lang [ 'srv_neto_v_cas' ];
if ( $_GET [ 'predvideni' ] == 1 ) {
echo ' / ' . $lang [ 'srv_testiranje_predvidenicas_1' ];
}
echo '</th>' ;
echo '<th>' . $lang [ 'srv_stevilo_enot' ] . '</th>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
foreach ( $povprecni_casi AS $vrstni_red => $time ) {
$sql = sisplet_query ( " SELECT naslov FROM srv_grupa WHERE vrstni_red=' $vrstni_red ' AND ank_id = ' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
$bruto = $povprecni_casi_bruto [ $vrstni_red ];
echo '<tr>' ;
2022-03-09 18:36:32 +01:00
echo '<td>' . ( $row [ 'naslov' ] != '' ? $row [ 'naslov' ] : $lang [ 'srv_intro_label' ]) . '</td>' ;
echo '<td class="right time">' . ( $time < 60 ? round ( $time , 1 ) . 's ' : round ( $time / 60 , 1 ) . 'min ' );
if ( $_GET [ 'predvideni' ] == 1 ) {
if ( $rezanje_preskocene == 1 )
$time = $expected_time [ $vrstni_red ][ 0 ];
else
$time = $expected_time [ $vrstni_red ][ 1 ];
echo '<span class="gray"> / ' . ( $time < 60 ? round ( $time , 1 ) . 's ' : round ( $time / 60 , 1 ) . 'min ' ) . '</span>' ;
}
2020-08-14 13:36:36 +02:00
echo '</td>' ;
2022-03-09 18:36:32 +01:00
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
echo '<div class="graph_full" style="width: ' . ( $time / $max * 85 ) . '%"></div>' ;
2020-08-14 13:36:36 +02:00
if ( $_GET [ 'predvideni' ] == 1 ) {
if ( $rezanje_preskocene == 1 )
$time = $expected_time [ $vrstni_red ][ 0 ];
else
$time = $expected_time [ $vrstni_red ][ 1 ];
2022-03-09 18:36:32 +01:00
echo '<div class="graph_' . ( $rezanje_preskocene == 1 ? 'empty' : 'red' ) . '" style="width: ' . ( $time / $max * 85 ) . '%"></div>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-09 18:36:32 +01:00
echo '</div>' ;
echo '</td>' ;
echo '<td class="right">' . $count [ $vrstni_red ] . '</td>' ;
echo '</tr>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-09 18:36:32 +01:00
echo '<tr class="semi-bold"><td>' . $lang [ 'srv_anl_suma1' ] . '<td class="right time">' . $skupni_cas ;
if ( $_GET [ 'predvideni' ] == 1 ) {
if ( $rezanje_preskocene == 1 )
$time = $expected_time [ $vrstni_red ][ 0 ];
else
$time = $expected_time [ $vrstni_red ][ 1 ];
echo '<span class="gray"> / ' . $predviden_cas . '</span>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-10 00:11:17 +01:00
echo '</td><td></td><td></td>' ;
2022-03-09 18:36:32 +01:00
echo '</td></tr>' ;
echo '</table>' ;
echo '<div class="tabela_trajanje_legenda">' ;
echo '<div class="graph_full legend"></div><span class="legend"> ' . $lang [ 'srv_neto_t_cas' ] . '</span>' ;
if ( $_GET [ 'predvideni' ] == 1 )
echo '<div class="graph_empty legend"></div><span class="legend"> ' . $lang [ 'srv_testiranje_predvidenicas_1' ] . '</span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
if ( $max_time > 1000 && $admin_type > 0 ) return ; // pridejo prevelike tabele
if ( $_GET [ 'prikazi01' ] == 1 )
$t_min = 0 ;
else
$t_min = 2 ;
// izpis histograma casov za vsako stran
2022-03-09 18:36:32 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_frekvencna_porazdelitev' ] . '</legend>' ;
2022-03-09 22:45:47 +01:00
echo '<div class="setting_holder bottom16">' ;
2022-03-09 18:36:32 +01:00
echo '<div class="setting_item">' ;
echo '<input type="checkbox" name="pages" id="pages" value="1" onclick="vnos_redirect(\'index.php?anketa=' . $this -> anketa . '&a=testiranje&m=cas&predvideni=' . $_GET [ 'predvideni' ] . '&prikazi01=' . $_GET [ 'prikazi01' ] . '&pages=' . ( $_GET [ 'pages' ] == 1 ? '0' : '1' ) . '\');" ' . ( $_GET [ 'pages' ] == 1 ? 'checked' : '' ) . ' /><label for="pages">' . $lang [ 'srv_show_pages' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $rezanje_preskocene == 1 ) {
2022-03-09 18:36:32 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo ' <input type="checkbox" name="prikazi01" id="prikazi01" value="1" onclick="vnos_redirect(\'index.php?anketa=' . $this -> anketa . '&a=testiranje&m=cas&predvideni=' . $_GET [ 'predvideni' ] . '&pages=' . $_GET [ 'pages' ] . '&prikazi01=' . ( $_GET [ 'prikazi01' ] == 1 ? '0' : '1' ) . '\');" ' . ( $_GET [ 'prikazi01' ] == 1 ? 'checked' : '' ) . ' /><label for="prikazi01">' . $lang [ 'srv_prikazi01' ] . '</label>' ;
2022-03-09 18:36:32 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-09 18:36:32 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// zdruzimo vse case po straneh na en graf
if ( $_GET [ 'pages' ] != '1' ) {
$casi2 = array ();
$casi2 [ 0 ] = array ();
foreach ( $casi AS $key => $val ) {
foreach ( $val AS $k => $v ) {
if ( isset ( $casi2 [ 0 ][ $k ]))
$casi2 [ 0 ][ $k ] += $v ;
else
$casi2 [ 0 ][ $k ] = $v ;
//array_push($casi2[0], $v);
}
}
$casi = $casi2 ;
$max_time = 0 ;
foreach ( $casi [ 0 ] AS $k => $v )
if ( $v > $max_time ) $max_time = $v ;
}
$minute = true ;
if ( $minute ) { // minute
foreach ( $casi AS $k => $page ) {
foreach ( $page AS $key => $val ) {
$casi [ $k ][ $key ] = ( int ) round ( $val / 60 , 0 );
}
}
$max_time = ( int ) round ( $max_time / 60 , 0 );
}
foreach ( $casi AS $key => $val ) {
if ( $_GET [ 'pages' ] == '1' ) {
$sql = sisplet_query ( " SELECT naslov FROM srv_grupa WHERE vrstni_red=' $key ' AND ank_id=' $this->anketa ' " );
$row = mysqli_fetch_array ( $sql );
2022-03-09 22:45:47 +01:00
echo '<p class="bold blue bottom16">' . ( $row [ 'naslov' ] != '' ? $row [ 'naslov' ] : $lang [ 'srv_intro_label' ]) . '</p>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-09 22:45:47 +01:00
echo '<table id="casi_histogram"><tr>' ;
2020-08-14 13:36:36 +02:00
$histogram = array ();
for ( $t = 0 ; $t <= $max_time ; $t ++ ) $histogram [ $t ] = 0 ;
foreach ( $val AS $k => $v ) {
if ( $v >= $t_min ) $histogram [ $v ] ++ ;
}
$max_stran = 0 ;
$max_stran_time = 0 ;
foreach ( $histogram AS $k => $v ) {
if ( $v > $max_stran ) $max_stran = $v ;
if ( $v > 0 ) $max_stran_time = $k ;
}
if ( $max_stran != 0 ) {
for ( $t = $t_min ; $t <= $max_time ; $t ++ ) {
2022-03-09 22:45:47 +01:00
echo '<td class="histogram">' ;
2020-08-14 13:36:36 +02:00
2022-03-09 22:45:47 +01:00
echo '<div class="histogram" style="height: ' . ( $histogram [ $t ] / $max_stran * 150 ) . 'px;" title="' . $t . ( $minute ? 'min' : 's' ) . ': ' . $histogram [ $t ] . '"></div>' ;
2020-08-14 13:36:36 +02:00
echo '</td>' ;
}
}
echo '</tr><tr>' ;
if ( $max_time <= 20 ) {
for ( $t = $t_min ; $t <= $max_time ; $t ++ ) {
2022-03-09 22:45:47 +01:00
echo '<td class="histogram_time">' . $t . ( $minute ? 'min' : 's' ) . '</td>' ;
2020-08-14 13:36:36 +02:00
}
} else {
if ( $t_min == 0 )
2022-03-09 22:45:47 +01:00
echo '<td class="histogram_time" colspan="10">0' . ( $minute ? 'min' : 's' ) . '</td>' ;
2020-08-14 13:36:36 +02:00
else
2022-03-09 22:45:47 +01:00
echo '<td class="histogram_time" colspan="8">2' . ( $minute ? 'min' : 's' ) . '</td>' ;
2020-08-14 13:36:36 +02:00
for ( $t = 10 ; $t <= $max_time ; $t += 10 ) {
2022-03-09 22:45:47 +01:00
echo '<td class="histogram_time" colspan="10">' . $t . '</td>' ;
2020-08-14 13:36:36 +02:00
}
}
echo '</tr></table>' ;
}
echo '</fieldset>' ;
}
/**
* opcije za rezanje
*/
function show_rezanje_casi () {
global $lang ;
global $global_user_id ;
SurveyUserSetting :: getInstance () -> Init ( $this -> anketa , $global_user_id );
$rezanje = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje' ); if ( $rezanje == '' ) $rezanje = 0 ;
$rezanje_meja_sp = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_meja_sp' ); if ( $rezanje_meja_sp == '' ) $rezanje_meja_sp = 5 ;
$rezanje_meja_zg = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_meja_zg' ); if ( $rezanje_meja_zg == '' ) $rezanje_meja_zg = 5 ;
$rezanje_predvidena_sp = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_predvidena_sp' ); if ( $rezanje_predvidena_sp == '' ) $rezanje_predvidena_sp = 10 ;
$rezanje_predvidena_zg = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_predvidena_zg' ); if ( $rezanje_predvidena_zg == '' ) $rezanje_predvidena_zg = 200 ;
$rezanje_preskocene = SurveyUserSetting :: getInstance () -> getSettings ( 'rezanje_preskocene' ); if ( $rezanje_preskocene == '' ) $rezanje_preskocene = 1 ;
echo '<p><input type="radio" name="rezanje" value="0"' . ( $rezanje == 0 ? ' checked' : '' ) . '> ' . $lang [ 'srv_rezanje_0' ] . '</p>' ;
echo '<p> ' . $lang [ 'srv_rezanje_meja_sp' ] . ': <select name="rezanje_meja_sp">' ;
echo '<option value="0"' . ( $rezanje_meja_sp == 0 ? ' selected' : '' ) . '>0%</option>' ;
echo '<option value="1"' . ( $rezanje_meja_sp == 1 ? ' selected' : '' ) . '>1%</option>' ;
echo '<option value="3"' . ( $rezanje_meja_sp == 3 ? ' selected' : '' ) . '>3%</option>' ;
echo '<option value="5"' . ( $rezanje_meja_sp == 5 ? ' selected' : '' ) . '>5%</option>' ;
echo '<option value="10"' . ( $rezanje_meja_sp == 10 ? ' selected' : '' ) . '>10%</option>' ;
echo '<option value="20"' . ( $rezanje_meja_sp == 20 ? ' selected' : '' ) . '>20%</option>' ;
echo '</select></p>' ;
echo '<p> ' . $lang [ 'srv_rezanje_meja_zg' ] . ': <select name="rezanje_meja_zg">' ;
echo '<option value="0"' . ( $rezanje_meja_zg == 0 ? ' selected' : '' ) . '>0%</option>' ;
echo '<option value="1"' . ( $rezanje_meja_zg == 1 ? ' selected' : '' ) . '>1%</option>' ;
echo '<option value="3"' . ( $rezanje_meja_zg == 3 ? ' selected' : '' ) . '>3%</option>' ;
echo '<option value="5"' . ( $rezanje_meja_zg == 5 ? ' selected' : '' ) . '>5%</option>' ;
echo '<option value="10"' . ( $rezanje_meja_zg == 10 ? ' selected' : '' ) . '>10%</option>' ;
echo '<option value="20"' . ( $rezanje_meja_zg == 20 ? ' selected' : '' ) . '>20%</option>' ;
echo '</select></p>' ;
echo '<p><input type="radio" name="rezanje" value="1"' . ( $rezanje == 1 ? ' checked' : '' ) . '> ' . $lang [ 'srv_rezanje_1' ] . '</p>' ;
echo '<p> ' . $lang [ 'srv_rezanje_meja_sp' ] . ': <select name="rezanje_predvidena_sp">' ;
echo '<option value="0"' . ( $rezanje_predvidena_sp == 0 ? ' selected' : '' ) . '>0%</option>' ;
echo '<option value="1"' . ( $rezanje_predvidena_sp == 1 ? ' selected' : '' ) . '>1%</option>' ;
echo '<option value="3"' . ( $rezanje_predvidena_sp == 3 ? ' selected' : '' ) . '>3%</option>' ;
echo '<option value="5"' . ( $rezanje_predvidena_sp == 5 ? ' selected' : '' ) . '>5%</option>' ;
echo '<option value="10"' . ( $rezanje_predvidena_sp == 10 ? ' selected' : '' ) . '>10%</option>' ;
echo '<option value="20"' . ( $rezanje_predvidena_sp == 20 ? ' selected' : '' ) . '>20%</option>' ;
echo '</select> ' . $lang [ 'srv_rezanje_predvidenega' ] . '</p>' ;
echo '<p> ' . $lang [ 'srv_rezanje_meja_zg' ] . ': <select name="rezanje_predvidena_zg">' ;
echo '<option value="100"' . ( $rezanje_predvidena_zg == 100 ? ' selected' : '' ) . '>100%</option>' ;
echo '<option value="150"' . ( $rezanje_predvidena_zg == 150 ? ' selected' : '' ) . '>150%</option>' ;
echo '<option value="200"' . ( $rezanje_predvidena_zg == 200 ? ' selected' : '' ) . '>200%</option>' ;
echo '<option value="300"' . ( $rezanje_predvidena_zg == 300 ? ' selected' : '' ) . '>300%</option>' ;
echo '<option value="500"' . ( $rezanje_predvidena_zg == 500 ? ' selected' : '' ) . '>500%</option>' ;
echo '<option value="1000"' . ( $rezanje_predvidena_zg == 1000 ? ' selected' : '' ) . '>1000%</option>' ;
echo '</select> ' . $lang [ 'srv_rezanje_predvidenega' ] . '</p>' ;
echo '<p> </p>' ;
echo '<p><input type="checkbox" name="rezanje_preskocene" value="1"' . ( $rezanje_preskocene == 1 ? ' checked' : '' ) . ' onchange="javascript: if (this.checked == 1) { $(\'#preskocene_txt\').hide(); } else { $(\'#preskocene_txt\').show(); }"> ' . $lang [ 'srv_rezanje_preskocene' ] . '</p>' ;
echo '<p id="preskocene_txt" ' . ( $rezanje_preskocene == 1 ? 'style="display:none"' : '' ) . '>' . $lang [ 'srv_rezanje_preskocene_txt' ] . '</p>' ;
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="statusCasiAction(\'run_rezanje\'); return false;"><span>' . $lang [ 'srv_save_run_profile' ] . '</span></a></span></span>' ;
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="statusCasiAction(\'cancle\'); return false;"><span>' . $lang [ 'srv_close_profile' ] . '</span></a></span></span>' ;
}
/**
* shrani nastavitve
*
*/
function save_rezanje_casi () {
global $global_user_id ;
SurveyUserSetting :: getInstance () -> Init ( $this -> anketa , $global_user_id );
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje' , $_POST [ 'rezanje' ]);
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje_meja_sp' , $_POST [ 'rezanje_meja_sp' ]);
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje_meja_zg' , $_POST [ 'rezanje_meja_zg' ]);
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje_predvidena_sp' , $_POST [ 'rezanje_predvidena_sp' ]);
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje_predvidena_zg' , $_POST [ 'rezanje_predvidena_zg' ]);
SurveyUserSetting :: getInstance () -> saveSettings ( 'rezanje_preskocene' , $_POST [ 'rezanje_preskocene' ]);
}
function testiranje_komentarji_links ( $comment_count ){
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
if ( $_GET [ 'a' ] == 'komentarji_anketa' ){
// Gumb nazaj
echo '<div class="switch_button ' . ( $_GET [ 'a' ] == A_KOMENTARJI ? ' active' : '' ) . '">' ;
echo '<a href="index.php?anketa=' . $this -> anketa . '&a=' . A_KOMENTARJI . '" title="' . $lang [ 'srv_testiranje_komentarji_title' ] . '">' . $lang [ 'srv_q_comments_back' ] . '</a>' ;
echo '</div>' ;
echo '<span class="bold"> (' ;
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 )
echo '<span class="orange">' ;
echo $comment_count [ 'question' ][ 'unresolved' ];
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 )
echo '</span>' ;
echo '/' . $comment_count [ 'question' ][ 'all' ];
echo ')</span>' ;
}
else {
echo '<span id="comment_question_note">' ;
echo $lang [ 'srv_komentarji_imate' ] . ' ' ;
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 ) echo '<span class="red">' ;
echo $this -> string_format (( int ) $comment_count [ 'question' ][ 'unresolved' ], 'srv_cnt_komentarji' );
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 ) echo '</span>' ;
echo ' ' . $lang [ 'srv_komentarji_odskupno' ] . ' ' ;
echo $this -> string_format (( int ) $comment_count [ 'question' ][ 'all' ], 'srv_cnt_komentar_na_vprs' );
echo '</span>' ;
// Gumb splosni komentarji
echo '<div class="switch_button ' . ( $_GET [ 'a' ] == A_KOMENTARJI_ANKETA ? ' active' : '' ) . '">' ;
echo '<a href="index.php?anketa=' . $this -> anketa . '&a=' . A_KOMENTARJI_ANKETA . '" title="' . $lang [ 'srv_testiranje_komentarji_anketa_title' ] . '">' . $lang [ 'srv_testiranje_komentarji_anketa_title' ] . '</a>' ;
echo '</div>' ;
echo '<span class="bold"> (' ;
if ( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ] > 0 )
echo '<span class="orange">' ;
echo ( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ]);
if ( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ] > 0 )
echo '</span>' ;
echo '/' . ( $comment_count [ 'survey_resp' ][ 'all' ] + $comment_count [ 'survey_admin' ][ 'all' ]);
echo ')</span>' ;
}
}
function string_format ( $cnt , $lang_root ) {
global $lang ;
$txt = '' ;
//if ($cnt > 0) $txt .= '<span class="red">';
if ( isset ( $lang [ $lang_root . '_' . $cnt ])) {
$txt .= $cnt . ' ' . $lang [ $lang_root . '_' . $cnt ];
} else {
$txt .= $cnt . ' ' . $lang [ $lang_root . '_more' ];
}
//if ($cnt > 0) $txt .= '</span>';
return $txt ;
}
/**
* izpise komentarje na anketo - stara ki se ne uporablja
*
*/
function testiranje_komentarji_anketa_old () {
global $lang ;
global $site_url ;
global $admin_type ;
global $global_user_id ;
$rowa = SurveyInfo :: getInstance () -> getSurveyRow ();
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$sortpostorder = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'sortpostorder' );
$f = new Forum ;
$sql = sisplet_query ( " SELECT * FROM post WHERE tid=' $rowa[thread] ' " );
echo '<div style="padding:0 20px">' ;
echo '<p><b>' . $lang [ 'srv_admin_s_comments' ] . '</b></p>' ;
if ( mysqli_num_rows ( $sql ) > 0 ) {
$rows = mysqli_num_rows ( $sql );
if ( $rows > 0 ) echo '<img src="img_0/' . ( $sortpostorder == 1 ? 'up' : 'down' ) . '.gif" style="float:right" title="' . ( $sortpostorder == 1 ? $lang [ 'forum_desc' ] : $lang [ 'forum_asc' ]) . '" />' ;
}
$i = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
if (( $i != 0 && $sortpostorder == 0 ) || ( $i < $rows - 1 && $sortpostorder == 1 )) {
if ( $row [ 'ocena' ] == 0 ) echo '<span style="color:black">' ;
elseif ( $row [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $row [ 'ocena' ] == 2 ) echo '<span style="color:lightgray">' ;
elseif ( $row [ 'ocena' ] == 3 ) echo '<span style="color:lightgray">' ;
else echo '<span>' ;
echo '<b>' . $f -> user ( $row [ 'uid' ]) . '</b> (' . $f -> datetime1 ( $row [ 'time' ]) . '):' ;
echo '<br/>' . $row [ 'vsebina' ] . '<hr>' ;
echo '</span>' ;
}
$i ++ ;
}
echo '</div>' ;
}
/**
* izpise komentarje na anketo
*
*/
function testiranje_komentarji_anketa () {
global $lang ;
global $site_url ;
global $admin_type ;
global $global_user_id ;
$b = new Branching ( $this -> anketa );
$f = new Forum ;
$d = new Dostop ();
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$sortpostorder = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'sortpostorder' );
$commentmarks = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'commentmarks' );
$survey_comment = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment' );
$survey_comment_resp = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'survey_comment_resp' );
$comment_count = $this -> testiranje_komentarji_count ();
$rowa = SurveyInfo :: getInstance () -> getSurveyRow ();
2022-03-31 21:38:03 +02:00
echo '<div id="comment_question_note">' ;
2022-04-01 01:45:51 +02:00
2020-08-14 13:36:36 +02:00
echo $lang [ 'srv_komentarji_imate' ] . ' ' ;
if (( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ]) > 0 ) echo '<span class="red">' ;
echo $this -> string_format (( int )( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ]), 'srv_cnt_komentarji' );
if (( $comment_count [ 'survey_resp' ][ 'unresolved' ] + $comment_count [ 'survey_admin' ][ 'unresolved' ]) > 0 ) echo '</span>' ;
echo ' ' . $lang [ 'srv_komentarji_odskupno' ] . ' ' ;
2021-10-14 10:59:10 +02:00
echo $this -> string_format (( int )( $comment_count [ 'survey_resp' ][ 'all' ] + $comment_count [ 'survey_admin' ][ 'all' ]), 'srv_cnt_komentarji_survey_od' );
2022-03-31 21:38:03 +02:00
echo '</div>' ;
2022-04-01 01:45:51 +02:00
2020-08-14 13:36:36 +02:00
2022-03-31 21:38:03 +02:00
/* - ZAČASNO ZAKOMENTIRAN TOOLTIP ( prekriva vsebino za redizajn ) @ TG
2020-08-14 13:36:36 +02:00
echo ' <span class="tooltip clr spaceLeft">' ;
echo ' (' . SurveyInfo :: getSurveyLink () . '&preview=on&testdata=on' . $preview_options . ') ' ;
echo '<span class="expanded-tooltip bottom light" style="left: -20px;">' ;
echo '<b>' . $lang [ 'srv_survey_testdata2' ] . ':</b> ' . $lang [ 'srv_testdata_text' ] . '' ;
echo '<p>' . $lang [ 'srv_preview_testdata_longtext' ] . '</p>' ;
echo '<span class="arrow"></span>' ;
echo '</span>' ; // expanded-tooltip bottom
2022-03-31 21:38:03 +02:00
echo '</span>' ; // tooltip */
2022-04-01 01:45:51 +02:00
echo '<div class="testni_vnos">' ;
echo '<a href="' . SurveyInfo :: getSurveyLink () . '&preview=on&testdata=on' . $preview_options . '" target="_blank"><span class="faicon monitor link-right"></span> ' . $lang [ 'srv_survey_testdata' ] . '</a>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
# VV: privzeto naj bodo samo nerešeni komentarji
if ( ! isset ( $_GET [ 'only_unresolved' ])) {
$_GET [ 'only_unresolved' ] = 1 ;
}
# samo nerešeni komentarji
if ( $commentmarks == 0 ) {
2022-04-01 01:45:51 +02:00
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa=' . $this -> anketa . '&a=komentarji_anketa&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" ' . ( $_GET [ 'only_unresolved' ] == 1 ? 'checked' : '' ) . ' />' ;
echo '<label for="only_unresolved">' . $lang [ 'srv_comments_unresolved' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
} else {
echo $lang [ 'move_show' ] . ': <select id="only_unresolved" name="" onchange="window.location = \'index.php?anketa=' . $this -> anketa . ' & a = komentarji_anketa & only_unresolved = \ ' + $ ( \ ' #only_unresolved\').val(); " >
< option value = " 0 " '.($_GET[' only_unresolved ']==0?' selected = " selected " ':' ').' > '.$lang[' all2 '].' </ option >
< option value = " 1 " '.($_GET[' only_unresolved ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_comments_unresolved '].' </ option >
< option value = " 2 " '.($_GET[' only_unresolved ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 3 " '.($_GET[' only_unresolved ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 4 " '.($_GET[' only_unresolved ']==4?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 5 " '.($_GET[' only_unresolved ']==5?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
}
2022-04-01 01:45:51 +02:00
//echo ' '.Help::display('srv_comments_only_unresolved');
2020-08-14 13:36:36 +02:00
$only_unresolved = " " ;
switch ( $_GET [ 'only_unresolved' ]){
case 1 :
$only_unresolved = " AND ocena <= '1' " ;
break ;
case 2 :
$only_unresolved = " AND ocena = '0' " ;
break ;
case 3 :
$only_unresolved = " AND ocena = '1' " ;
break ;
case 4 :
$only_unresolved = " AND ocena = '2' " ;
break ;
case 5 :
$only_unresolved = " AND ocena = '3' " ;
break ;
default :
break ;
}
2022-04-01 01:45:51 +02:00
echo '<div class="komentarji_anketa_holder">' ;
2020-08-14 13:36:36 +02:00
// Splosni komentarji urednikov - levo
echo '<div class="komentarji_anketa komentarji_ured">' ;
2022-04-01 01:45:51 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_comments_anketa_ured' ] . ' (' . $comment_count [ 'survey_admin' ][ 'unresolved' ] . '/' . $comment_count [ 'survey_admin' ][ 'all' ] . ')</legend>' ;
2020-08-14 13:36:36 +02:00
$sql = sisplet_query ( " SELECT * FROM post WHERE tid=' $rowa[thread] ' " . $only_unresolved . " " );
$rows = ( mysqli_num_rows ( $sql ) == 0 ) ? 0 : mysqli_num_rows ( $sql ) - 1 ;
if ( $rows > 0 ){
$i = 0 ;
while ( $row = mysqli_fetch_array ( $sql )) {
if (( $i != 0 && $sortpostorder == 0 ) || ( $i < $rows && $sortpostorder == 1 )) {
2022-04-01 01:45:51 +02:00
/* if ( $row [ 'ocena' ] == 0 ) echo '<span style="color:black">' ;
2020-08-14 13:36:36 +02:00
elseif ( $row [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $row [ 'ocena' ] == 2 ) echo '<span style="color:#999999">' ;
elseif ( $row [ 'ocena' ] == 3 ) echo '<span style="color:#999999">' ;
2022-04-01 01:45:51 +02:00
else echo '<span>' ; */
2020-08-14 13:36:36 +02:00
2022-04-01 01:45:51 +02:00
echo '<div class="comment_box">' ;
echo '<div class="by">' ;
echo $lang [ 'srv_comments_user' ] . '<span class="user">' . $f -> user ( $row [ 'uid' ]) . '</span>' . $lang [ 'srv_comments_user2' ];
echo '</div>' ;
$datetime = strtotime ( $row [ 'time' ]);
$datetime = date ( " d.m.Y G:i " , $datetime );
echo '<div class="date">' ;
echo $datetime ;
echo '</div>' ;
echo '<div class="content">' ;
echo $row [ 'vsebina' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-04-29 04:14:11 +02:00
echo '<div class="bottom_options">' ;
2020-08-14 13:36:36 +02:00
if ( $commentmarks == 1 ) {
echo ' <select name="ocena' . $row [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . ' \ ' }, function () { window . location . reload ();}); " >
< option value = " 0 " '.($row[' ocena ']==0?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 1 " '.($row[' ocena ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 2 " '.($row[' ocena ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 3 " '.($row[' ocena ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
} else {
2022-04-01 01:45:51 +02:00
/*// Checkbox za " Koncano "
2020-08-14 13:36:36 +02:00
echo '<input type="checkbox" name="ocena_' . $row [ 'id' ] . '" id="ocena_' . $row [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});" value="2" ' . ( $row [ 'ocena' ] >= 2 ? ' checked' : '' ) . ' />' ;
2022-04-01 01:45:51 +02:00
echo '<label for="ocena_' . $row [ 'id' ] . '">' . $lang [ 'srv_done' ] . '</label>' ; */
if ( $row [ 'ocena' ] == 0 ) {
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>' ;
echo $lang [ 'srv_comments_archive' ] . '</p>' ;
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>' . $lang [ 'srv_comments_archived' ] . '</p>' ;
2022-04-29 04:14:11 +02:00
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>' ;
echo $lang [ 'srv_comments_unarchive' ] . '</p>' ;
2022-04-01 01:45:51 +02:00
}
2020-08-14 13:36:36 +02:00
}
echo '</div>' ;
2022-04-01 01:45:51 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
$i ++ ;
2022-04-01 01:45:51 +02:00
}
2020-08-14 13:36:36 +02:00
}
// Nimamo komentarja
else {
// Ce so komentarji aktivirani
if ( $survey_comment != '' ){
2022-04-29 01:38:57 +02:00
echo '<p class="bottom16">' . $lang [ 'srv_no_comments_solved' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-04-29 01:38:57 +02:00
echo '<p class="bottom16">' . $lang [ 'srv_no_comments' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
}
2022-04-01 01:45:51 +02:00
2020-08-14 13:36:36 +02:00
// Dodajanje novega komentarja
2022-04-29 01:38:57 +02:00
echo '<div id="comment_toggle_0_4" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_4\')">' ;
echo '<span class="faicon link-right comments"></span>' ;
echo $lang [ 'srv_add_comment_toggle' ];
echo '</div>' ;
echo '<div class="comment_wrapper" id="comment_wrapper_0_4">' ;
2022-04-01 01:45:51 +02:00
echo '<div class="new_comment" id="survey_comment_0_4">' ;
2020-08-14 13:36:36 +02:00
$ba = new BranchingAjax ( $this -> anketa );
$ba -> add_comment_field ( 0 , '1' , '4' , false );
2022-04-01 01:45:51 +02:00
echo '</div>' ;
2022-04-29 01:38:57 +02:00
echo '</div>' ;
2022-04-01 01:45:51 +02:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
// Splosni komentarji respondentov - desno
echo '<div class="komentarji_anketa komentarji_resp">' ;
2022-04-01 01:45:51 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_comments_anketa_resp' ] . ' (' . $comment_count [ 'survey_resp' ][ 'unresolved' ] . '/' . $comment_count [ 'survey_resp' ][ 'all' ] . ')</legend>' ;
2020-08-14 13:36:36 +02:00
$sql = sisplet_query ( " SELECT * FROM srv_comment_resp WHERE ank_id=' $this->anketa ' " . $only_unresolved . " ORDER BY comment_time $orderby , id $orderby " );
if ( mysqli_num_rows ( $sql ) > 0 ) {
while ( $row = mysqli_fetch_array ( $sql )) {
2022-04-01 01:45:51 +02:00
echo '<div class="comment_box">' ;
2020-08-14 13:36:36 +02:00
2022-04-01 01:45:51 +02:00
/* if ( $row [ 'ocena' ] == 0 ) echo '<span style="color:black">' ;
2020-08-14 13:36:36 +02:00
elseif ( $row [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $row [ 'ocena' ] == 2 ) echo '<span style="color:#999999">' ;
elseif ( $row [ 'ocena' ] == 3 ) echo '<span style="color:#999999">' ;
2022-04-01 01:45:51 +02:00
else echo '<span>' ; */
2020-08-14 13:36:36 +02:00
$datetime = strtotime ( $row [ 'comment_time' ]);
2022-04-01 01:45:51 +02:00
$datetime = date ( " d.m.Y G:i " , $datetime );
2020-08-14 13:36:36 +02:00
if ( $row [ 'usr_id' ] == 0 ){
2022-04-29 04:14:11 +02:00
echo '<div class="by">' ;
echo 'Respondent ' . $lang [ 'srv_comments_user2' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
else {
$sqlU = sisplet_query ( " SELECT name FROM users WHERE id=' $row[usr_id] ' " );
$rowU = mysqli_fetch_array ( $sqlU );
$user = $rowU [ 'name' ];
2022-04-01 01:45:51 +02:00
2022-04-29 04:14:11 +02:00
echo '<div class="by">' ;
echo $lang [ 'srv_comments_user' ] . '<span class="user">' . $user . '</span>' . $lang [ 'srv_comments_user2' ];
echo '</div>' ;
}
2022-04-01 01:45:51 +02:00
echo '<div class="date">' ;
echo $datetime ;
echo '</div>' ;
echo '<div class="content">' ;
echo $row [ 'comment' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-04-29 04:14:11 +02:00
echo '<div class="bottom_options">' ;
2020-08-14 13:36:36 +02:00
if ( $commentmarks == 1 ) {
echo ' <select name="ocena' . $row [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: this.value, id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . ' \ ' }, function () { window . location . reload ();}); " >
< option value = " 0 " '.($row[' ocena ']==0?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 1 " '.($row[' ocena ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 2 " '.($row[' ocena ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 3 " '.($row[' ocena ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
} else {
2022-04-01 01:45:51 +02:00
/*// Checkbox za " Koncano "
2020-08-14 13:36:36 +02:00
echo '<input type="checkbox" name="ocena_' . $row [ 'id' ] . '" id="ocena_' . $row [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (this.checked?\'2\':\'0\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});" value="2" ' . ( $row [ 'ocena' ] >= 2 ? ' checked' : '' ) . ' />' ;
2022-04-01 01:45:51 +02:00
echo '<label for="ocena_' . $row [ 'id' ] . '">' . $lang [ 'srv_done' ] . '</label>' ; */
if ( $row [ 'ocena' ] == 0 ) {
2022-04-29 04:14:11 +02:00
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (\'2\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>' ;
2022-04-01 01:45:51 +02:00
echo $lang [ 'srv_comments_archive' ] . '</p>' ;
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>' . $lang [ 'srv_comments_archived' ] . '</p>' ;
2022-04-29 04:14:11 +02:00
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (\'0\'), id: \'' . $row [ 'id' ] . '\', anketa: \'' . $rowa [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>' ;
echo $lang [ 'srv_comments_unarchive' ] . '</p>' ;
2022-04-01 01:45:51 +02:00
}
2020-08-14 13:36:36 +02:00
}
echo '</div>' ;
2022-04-01 01:45:51 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
// Nimamo komentarja
else {
// Ce so komentarji aktivirani
if ( $survey_comment_resp != '' ){
2022-04-29 01:38:57 +02:00
echo '<p class="bottom16">' . $lang [ 'srv_no_comments_solved' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-04-29 01:38:57 +02:00
echo '<p class="bottom16">' . $lang [ 'srv_no_comments' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
}
}
// Dodajanje novega komentarja
2022-04-29 01:38:57 +02:00
echo '<div id="comment_toggle_0_5" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'0_5\')">' ;
echo '<span class="faicon link-right comments"></span>' ;
echo $lang [ 'srv_add_comment_toggle' ];
echo '</div>' ;
echo '<div class="comment_wrapper" id="comment_wrapper_0_5">' ;
2022-04-01 01:45:51 +02:00
echo '<div class="new_comment" id="survey_comment_0_5">' ;
2020-08-14 13:36:36 +02:00
$ba = new BranchingAjax ( $this -> anketa );
2022-04-29 04:14:11 +02:00
$ba -> add_comment_field ( 0 , '4' , '5' , false );
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-04-01 01:45:51 +02:00
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-04-01 01:45:51 +02:00
echo '</fieldset>' ;
echo '</div>' ;
echo '</div>' ; // div.komentarji_anketa_holder
2020-08-14 13:36:36 +02:00
}
function testiranje_komentarji_komentarji_na_anketo ( $return = true ) {
$rowi = SurveyInfo :: getInstance () -> getSurveyRow ();
#komentarji na anketo
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM post WHERE tid=' " . $rowi [ 'thread' ] . " ' AND parent > 0 " ;
$sqlta = sisplet_query ( $strta );
list ( $rowta ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM post WHERE tid=' " . $rowi [ 'thread' ] . " ' AND parent > 0 AND ocena <= 1 " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtu ) = mysqli_fetch_row ( $sqltu );
if ( $return )
return '(<span class="lightRed">' . ( int ) $rowtu . '</span>/' . ( int ) $rowta . ')' ;
else
return ( int ) $rowtu ;
}
public function testiranje_komentarji_count () {
$comment_count = array ();
$rowi = SurveyInfo :: getInstance () -> getSurveyRow ();
// KOMENTARJI NA ANKETO - UREDNIK
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM post WHERE tid=' " . $rowi [ 'thread' ] . " ' AND parent > 0 " ;
$sqlta = sisplet_query ( $strta );
list ( $rowta ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM post WHERE tid=' " . $rowi [ 'thread' ] . " ' AND parent > 0 AND ocena <= 1 " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtu ) = mysqli_fetch_row ( $sqltu );
//(int)$rowtu.'/'.(int)$rowta;
$comment_count [ 'survey_admin' ][ 'all' ] = ( int ) $rowta ;
$comment_count [ 'survey_admin' ][ 'unresolved' ] = ( int ) $rowtu ;
// KOMENTARJI NA ANKETO - RESPONDENT
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM srv_comment_resp WHERE ank_id=' " . $this -> anketa . " ' " ;
$sqlta = sisplet_query ( $strta );
list ( $rowta ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM srv_comment_resp WHERE ank_id=' " . $this -> anketa . " ' AND ocena <= 1 " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtu ) = mysqli_fetch_row ( $sqltu );
//(int)$rowtu.'/'.(int)$rowta;
$comment_count [ 'survey_resp' ][ 'all' ] = ( int ) $rowta ;
$comment_count [ 'survey_resp' ][ 'unresolved' ] = ( int ) $rowtu ;
// KOMENTARJI NA VPRASANJE
# naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
$spremenljivke = Cache :: cache_all_srv_spremenljivka ( $this -> anketa , true );
$spr_id = array ();
$threads = array ();
if ( is_array ( $spremenljivke ) && count ( $spremenljivke ) > 0 ) {
foreach ( $spremenljivke as $id => $value ) {
$spr_id [] = $id ;
if (( int ) $value [ 'thread' ] > 0 ) {
$threads [] = $value [ 'thread' ];
}
}
}
if ( count ( $spr_id ) > 0 ) {
#preštejemo komentarje uporabnikov na vprašanja
# srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
$strqr = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $spr_id ) . " ) " ;
$sqlqr = sisplet_query ( $strqr );
list ( $rowqr ) = mysqli_fetch_row ( $sqlqr );
#končani komentarji respondentov
#text2 = 2 => končan
#text2 = 3 => nerelevantno
$strqrf = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $spr_id ) . " ) AND text2 IN (2,3) " ;
$sqlqrf = sisplet_query ( $strqrf );
list ( $rowqrf ) = mysqli_fetch_row ( $sqlqrf );
# preštejemo
if ( count ( $threads ) > 0 ) {
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads ) . " ) AND parent > 0 " ;
$sqlta = sisplet_query ( $strta );
list ( $rowtqa ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads ) . " ) AND parent > 0 AND ocena IN (2,3) " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtqu ) = mysqli_fetch_row ( $sqltu );
}
}
#vsi
//$all = (int)((int)$rowqr + (int)$rowtqa);
#nerešeni
//$unresolved = $all - (int)((int)$rowqrf + (int)$rowtqu);
$comment_count [ 'question' ][ 'all' ] = ( int )(( int ) $rowqr + ( int ) $rowtqa );
$comment_count [ 'question' ][ 'unresolved' ] = $comment_count [ 'question' ][ 'all' ] - ( int )(( int ) $rowqrf + ( int ) $rowtqu );
// KOMENTARJI NA IF ALI BLOK
# naenkrat preberemo vse ife in bloke, da ne delamo queryja vsakic posebej
$ifi = Cache :: cache_all_srv_if ( $this -> anketa , true );
$if_id = array ();
$threads_if = array ();
if ( is_array ( $ifi ) && count ( $ifi ) > 0 ) {
foreach ( $ifi as $id => $value ) {
$if_id [] = $id ;
if (( int ) $value [ 'thread' ] > 0 ) {
$threads_if [] = $value [ 'thread' ];
}
}
}
if ( count ( $if_id ) > 0 ) {
#preštejemo komentarje uporabnikov na vprašanja
# srv_data_text where if_id = 0 AND vre_id IN (id-ji spremenljivk)
$strqr = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $if_id ) . " ) " ;
$sqlqr = sisplet_query ( $strqr );
list ( $rowqr_if ) = mysqli_fetch_row ( $sqlqr );
#končani komentarji respondentov
#text2 = 2 => končan
#text2 = 3 => nerelevantno
$strqrf = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $if_id ) . " ) AND text2 IN (2,3) " ;
$sqlqrf = sisplet_query ( $strqrf );
list ( $rowqrf_if ) = mysqli_fetch_row ( $sqlqrf );
# preštejemo
if ( count ( $threads_if ) > 0 ) {
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads_if ) . " ) AND parent > 0 " ;
$sqlta = sisplet_query ( $strta );
list ( $rowtqa_if ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads_if ) . " ) AND parent > 0 AND ocena IN (2,3) " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtqu_if ) = mysqli_fetch_row ( $sqltu );
}
}
$comment_count [ 'question' ][ 'all' ] += ( int )(( int ) $rowqr_if + ( int ) $rowtqa_if );
$comment_count [ 'question' ][ 'unresolved' ] += (( int )(( int ) $rowqr_if + ( int ) $rowtqa_if )) - (( int )(( int ) $rowqrf_if + ( int ) $rowtqu_if ));
return $comment_count ;
}
/**
* $return pove a vrne text ( true ) ali samo številko ( false )
*/
function testiranje_komentarji_komentarji_na_vprasanje ( $return = true ) {
# naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
$spremenljivke = Cache :: cache_all_srv_spremenljivka ( $this -> anketa , true );
$spr_id = array ();
$threads = array ();
if ( is_array ( $spremenljivke ) && count ( $spremenljivke ) > 0 ) {
foreach ( $spremenljivke as $id => $value ) {
$spr_id [] = $id ;
if (( int ) $value [ 'thread' ] > 0 ) {
$threads [] = $value [ 'thread' ];
}
}
}
if ( count ( $spr_id ) > 0 ) {
#preštejemo komentarje uporabnikov na vprašanja
# srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
$strqr = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $spr_id ) . " ) " ;
$sqlqr = sisplet_query ( $strqr );
list ( $rowqr ) = mysqli_fetch_row ( $sqlqr );
#končani komentarji respondentov
#text2 = 2 => končan
#text2 = 3 => nerelevantno
$strqrf = " SELECT count(*) FROM srv_data_text " . $this -> db_table . " WHERE spr_id=0 AND vre_id IN ( " . implode ( ',' , $spr_id ) . " ) AND text2 IN (2,3) " ;
$sqlqrf = sisplet_query ( $strqrf );
list ( $rowqrf ) = mysqli_fetch_row ( $sqlqrf );
# preštejemo
if ( count ( $threads ) > 0 ) {
# vsi komentarji na anketo
$strta = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads ) . " ) AND parent > 0 " ;
$sqlta = sisplet_query ( $strta );
list ( $rowtqa ) = mysqli_fetch_row ( $sqlta );
# nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = " SELECT count(*) FROM post WHERE tid IN ( " . implode ( ',' , $threads ) . " ) AND parent > 0 AND ocena IN (2,3) " ;
$sqltu = sisplet_query ( $strtu );
list ( $rowtqu ) = mysqli_fetch_row ( $sqltu );
}
}
#vsi
$all = ( int )(( int ) $rowqr + ( int ) $rowtqa );
# nerešeni
$unresolved = $all - ( int )(( int ) $rowqrf + ( int ) $rowtqu );
if ( $return )
// '(<span class="lightRed">'.$unresolved.'</span>/'.$all.')';
return $unresolved ;
else
return $unresolved ;
}
/**
* izpise vprasanja , ki imajo komentarje in poleg tudi razprte komentarje
*
*/
function testiranje_komentarji () {
global $lang ;
global $site_url ;
global $admin_type ;
global $global_user_id ;
$lang_admin = $lang ;
//$sa = new SurveyAdmin(1, $this->anketa);
include_once ( '../../main/survey/app/global_function.php' );
new \App\Controllers\SurveyController ( true );
save ( 'forceShowSpremenljivka' , true );
$f = new Forum ;
$c = 0 ;
$lang = $lang_admin ;
$b = new Branching ( $this -> anketa );
$d = new Dostop ();
$rowi = SurveyInfo :: getInstance () -> getSurveyRow ();
SurveySetting :: getInstance () -> Init ( $this -> anketa );
$question_resp_comment_viewadminonly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_resp_comment_viewadminonly' );
$question_comment_viewadminonly = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment_viewadminonly' );
$question_comment_viewauthor = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_comment_viewauthor' );
$sortpostorder = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'sortpostorder' );
$question_note_view = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'question_note_view' );
$addfieldposition = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'addfieldposition' );
$commentmarks = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'commentmarks' );
$commentmarks_who = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'commentmarks_who' );
$question_comment_viewadminonly = ( $question_comment_viewadminonly == '' ) ? 4 : $question_comment_viewadminonly ;
$question_resp_comment_viewadminonly = ( $question_resp_comment_viewadminonly == '' ) ? 4 : $question_resp_comment_viewadminonly ;;
$comment_count = $this -> testiranje_komentarji_count ();
2022-03-31 21:38:03 +02:00
echo '<div id="comment_question_note">' ;
2020-08-14 13:36:36 +02:00
echo $lang [ 'srv_komentarji_imate' ] . ' ' ;
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 ) echo '<span class="red">' ;
echo $this -> string_format (( int ) $comment_count [ 'question' ][ 'unresolved' ], 'srv_cnt_komentarji' );
if ( $comment_count [ 'question' ][ 'unresolved' ] > 0 ) echo '</span>' ;
echo ' ' . $lang [ 'srv_komentarji_odskupno' ] . ' ' ;
2021-10-14 10:59:10 +02:00
echo $this -> string_format (( int ) $comment_count [ 'question' ][ 'all' ], 'srv_cnt_komentar_na_vprs_od' );
2020-08-14 13:36:36 +02:00
2022-03-31 21:38:03 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-31 21:38:03 +02:00
/* - ZAČASNO ZAKOMENTIRAN TOOLTIP ( prekriva vsebino za redizajn ) @ TGecho ' <span class="tooltip clr spaceLeft">' ;
2020-08-14 13:36:36 +02:00
echo '<span class="expanded-tooltip bottom light" style="left: -20px;">' ;
echo '<b>' . $lang [ 'srv_survey_testdata2' ] . ':</b> ' . $lang [ 'srv_testdata_text' ] . '' ;
echo '<p>' . $lang [ 'srv_preview_testdata_longtext' ] . '</p>' ;
echo '<span class="arrow"></span>' ;
echo '</span>' ; // expanded-tooltip bottom
2022-03-31 21:38:03 +02:00
echo '</span>' ; // tooltip */
2020-08-14 13:36:36 +02:00
2022-04-01 01:45:51 +02:00
echo '<div class="testni_vnos">' ;
2022-04-01 03:29:10 +02:00
echo '<a href="' . SurveyInfo :: getSurveyLink () . '&preview=on&testdata=on' . $preview_options . '" target="_blank"><span class="faicon link-right monitor"></span>' . $lang [ 'srv_survey_testdata' ] . '</a>' ;
2022-04-01 01:45:51 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
# VV: privzeto naj bodo samo nerešeni komentarji
if ( ! isset ( $_GET [ 'only_unresolved' ])) {
$_GET [ 'only_unresolved' ] = 1 ;
}
$sqlf1 = sisplet_query ( " SELECT p.id FROM post p WHERE p.tid=' $rowi[thread] ' AND p.ocena='5' " );
while ( $rowf1 = mysqli_fetch_array ( $sqlf1 )) {
$s = sisplet_query ( " SELECT * FROM views WHERE pid=' $rowf1[id] ' AND uid=' $global_user_id ' " );
if ( mysqli_num_rows ( $s ) == 0 )
$show_survey_comment = 1 ;
}
2022-04-29 04:32:06 +02:00
// vsa vprasanja
echo '<div class="comment_checkboxes_wrap">' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="all_questions" onchange="window.location = \'index.php?anketa=' . $this -> anketa . '&a=komentarji' . ( isset ( $_GET [ 'only_unresolved' ]) ? '&only_unresolved=' . $_GET [ 'only_unresolved' ] : '' ) . '&all_questions=\'+$(\'#all_questions:checked\').val()" value="1" ' . ( $_GET [ 'all_questions' ] == 1 ? 'checked' : '' ) . ' />' ;
echo '<label for="all_questions">' . $lang [ 'srv_all_questions' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
# samo nerešeni komentarji
if ( $commentmarks == 0 ) {
2022-04-01 03:29:10 +02:00
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa=' . $this -> anketa . '&a=komentarji' . ( isset ( $_GET [ 'all_questions' ]) ? '&all_questions=' . $_GET [ 'all_questions' ] : '' ) . '&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" ' . ( $_GET [ 'only_unresolved' ] == 1 ? 'checked' : '' ) . ' />' ;
echo '<label for="only_unresolved">' . $lang [ 'srv_comments_unresolved' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
} else {
echo $lang [ 'move_show' ] . ': <select id="only_unresolved" name="" onchange="window.location = \'index.php?anketa=' . $this -> anketa . ' & a = komentarji & only_unresolved = \ ' + $ ( \ ' #only_unresolved\').val(); " >
< option value = " 0 " '.($_GET[' only_unresolved ']==0?' selected = " selected " ':' ').' > '.$lang[' all2 '].' </ option >
< option value = " 1 " '.($_GET[' only_unresolved ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_comments_unresolved '].' </ option >
< option value = " 2 " '.($_GET[' only_unresolved ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 3 " '.($_GET[' only_unresolved ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 4 " '.($_GET[' only_unresolved ']==4?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 5 " '.($_GET[' only_unresolved ']==5?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
}
2022-04-29 04:32:06 +02:00
echo '</div>' ;
2022-04-01 03:29:10 +02:00
// echo ' '.Help::display('srv_comments_only_unresolved').'</span>';
2020-08-14 13:36:36 +02:00
// Nov nacin kjer se sprehodimo cez branching, ker imamo lahko tudi komentarje na ife in bloke
Common :: getInstance () -> Init ( $this -> anketa );
$branching_array = Common :: getBranchingOrder ();
if ( count ( $branching_array ) > 0 ) {
$view = 1 ;
$b = new Branching ( $this -> anketa );
2022-04-01 03:29:10 +02:00
echo '<ul>' ;
2020-08-14 13:36:36 +02:00
foreach ( $branching_array AS $element ){
// Gre za if ali blok
if ( $element [ 'if_id' ] > 0 ){
$if_id = $element [ 'if_id' ];
$sql1 = sisplet_query ( " SELECT * FROM srv_if WHERE id = ' $if_id ' " );
$row1 = mysqli_fetch_array ( $sql1 );
$orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
$tid = $row1 [ 'thread' ];
$only_unresolved = " " ;
$only_unresolved2 = " " ;
if ( $_GET [ 'only_unresolved' ] == 1 ) $only_unresolved = " AND ocena <= 1 " ;
if ( $_GET [ 'only_unresolved' ] == 1 ) $only_unresolved2 = " AND text2 <= 1 " ;
if ( $_GET [ 'only_unresolved' ] == 2 ) $only_unresolved = " AND ocena = 0 " ;
if ( $_GET [ 'only_unresolved' ] == 2 ) $only_unresolved2 = " AND text2 = 0 " ;
if ( $_GET [ 'only_unresolved' ] == 3 ) $only_unresolved = " AND ocena = 1 " ;
if ( $_GET [ 'only_unresolved' ] == 3 ) $only_unresolved2 = " AND text2 = 1 " ;
if ( $_GET [ 'only_unresolved' ] == 4 ) $only_unresolved = " AND ocena = 2 " ;
if ( $_GET [ 'only_unresolved' ] == 4 ) $only_unresolved2 = " AND text2 = 2 " ;
if ( $_GET [ 'only_unresolved' ] == 5 ) $only_unresolved = " AND ocena = 3 " ;
if ( $_GET [ 'only_unresolved' ] == 5 ) $only_unresolved2 = " AND text2 = 3 " ;
$tema_vsebuje = substr ( $lang [ 'srv_forum_intro' ], 0 , 10 ); // da ne prikazujemo 1. default sporocila
if ( $admin_type <= $question_comment_viewadminonly ) { // vidi vse komentarje
$sqlt = sisplet_query ( " SELECT * FROM post WHERE vsebina NOT LIKE '% { $tema_vsebuje } %' AND tid=' $tid ' $only_unresolved ORDER BY time $orderby , id $orderby " );
} elseif ( $question_comment_viewauthor == 1 ) { // vidi samo svoje komentarje
$sqlt = sisplet_query ( " SELECT * FROM post WHERE vsebina NOT LIKE '% { $tema_vsebuje } %' AND tid=' $tid ' $only_unresolved AND uid=' $global_user_id ' ORDER BY time $orderby , id $orderby " );
} else { // ne vidi nobenih komentarjev
$sqlt = sisplet_query ( " SELECT * FROM post WHERE 1=0 " );
}
if (( $_GET [ 'all_questions' ] == '1' ) OR ( mysqli_num_rows ( $sqlt ) > 0 )) {
$c ++ ;
echo '<li id="branching_' . $if_id . '" class="spr">' ;
echo '<div class="spremenljivka_content">' ;
// Blok
if ( $row1 [ 'tip' ] == 1 ){
echo '<div class="spremenljivka_settings" style="font-size:14px; padding:0 0 0 10px;">' ;
echo '<span class="conditions_display"><strong class="clr_bl">BLOCK</strong> <span class="colorblock">(' . $row1 [ 'number' ] . ')</span>' ;
echo '</div>' ;
}
// If
else {
echo '<div class="spremenljivka_settings" style="font-size:14px; padding:4px 0 0 10px;">' ;
$b -> conditions_display ( $if_id );
echo '</div>' ;
}
echo '</div>' ;
echo '</li>' ;
2022-04-01 03:29:10 +02:00
echo '<div class="question_comment_holder">' ;
2020-08-14 13:36:36 +02:00
if ( $addfieldposition == 1 ) {
echo '<div id="survey_comment_' . $if_id . '_' . '4' . '" style="display:none"></div>' ;
echo '<p><a href="#" onclick="$(\'#comment_field_' . $if_id . '\').toggle(); return false;">' . $lang [ 'srv_comments_add_comment' ] . '</a></p>' ;
echo '<p id="comment_field_' . $if_id . '" style="display:none">' ;
$ba = new BranchingAjax ( $this -> anketa );
$ba -> add_comment_field ( $if_id , '1' , '4' , false );
echo '</p>' ;
}
// komentarji na vprasanje
if ( $row1 [ 'thread' ] > 0 ) {
if ( mysqli_num_rows ( $sqlt ) > 0 ) {
echo '<p class="red"><b>' . $lang [ 'srv_admin_comment' ] . '</b>' ;
//$rowss = mysqli_num_rows($sql);
//if ($rowss > 0)
echo '<img src="img_0/' . ( $sortpostorder == 1 ? 'up' : 'down' ) . '.gif" style="float:right" title="' . ( $sortpostorder == 1 ? $lang [ 'forum_desc' ] : $lang [ 'forum_asc' ]) . '" />' ;
echo '</p>' ;
$i = 0 ;
while ( $rowt = mysqli_fetch_array ( $sqlt )) {
if ( $_GET [ 'only_unresolved' ] == 1 ) {
if ( $rowt [ 'ocena' ] == 0 ) echo '<span style="color:black">' ;
elseif ( $rowt [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $rowt [ 'ocena' ] == 2 ) echo '<span style="color:#999999">' ;
elseif ( $rowt [ 'ocena' ] == 3 ) echo '<span style="color:#999999">' ;
else echo '<span>' ;
} else {
if ( $rowt [ 'ocena' ] == 0 ) echo '<span style="color:#990000">' ;
elseif ( $rowt [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $rowt [ 'ocena' ] == 2 ) echo '<span style="color:black">' ;
elseif ( $rowt [ 'ocena' ] == 3 ) echo '<span style="color:black">' ;
else echo '<span>' ;
}
echo '<b>' . $f -> user ( $rowt [ 'uid' ]) . '</b> (' . $f -> datetime1 ( $rowt [ 'time' ]) . '):' ;
if ( $admin_type <= 1 || $rowi [ 'insert_uid' ] == $global_user_id || $commentmarks_who == 0 ) {
echo '<div style="float:right; text-align:right">' ;
if ( $commentmarks == 1 ) {
echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . ' \ ' }, function () { window . location . reload ();}); " >
< option value = " 0 " '.($rowt[' ocena ']==0?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 1 " '.($rowt[' ocena ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 2 " '.($rowt[' ocena ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 3 " '.($rowt[' ocena ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
} else {
echo '<input type="checkbox" name="ocena_' . $rowt [ 'id' ] . '" id="ocena_' . $rowt [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . '\'}, function () {window.location.reload();});" value="2" ' . ( $rowt [ 'ocena' ] >= 2 ? ' checked' : '' ) . ' /><label for="ocena_' . $rowt [ 'id' ] . '">' . $lang [ 'srv_done' ] . '</label>' ;
}
echo ' <br /><a href="javascript:comment_on_comment(\'' . $rowt [ 'id' ] . '\');">' . $lang [ 'srv_comment_comment' ] . '</a>' ;
echo '</div>' ;
}
echo '<br/>' . $rowt [ 'vsebina' ] . '<span id="comment_on_comment_' . $rowt [ 'id' ] . '"></span><hr>' ;
echo '</span>' ;
}
}
}
if ( $addfieldposition == '' || $addfieldposition == 0 ) {
echo '<div id="survey_comment_' . $spr_id . '_' . '4' . '" style="display:none"></div>' ;
echo '<p><a href="#" onclick="$(\'#comment_field_' . $spr_id . '\').toggle(); return false;">' . $lang [ 'srv_comments_add_comment' ] . '</a></p>' ;
echo '<p id="comment_field_' . $spr_id . '" style="display:none">' ;
$ba = new BranchingAjax ( $this -> anketa );
$ba -> add_comment_field ( $spr_id , '1' , '4' , false );
echo '</p>' ;
}
echo '</div>' ;
echo '</div>' ;
}
}
// Gre za navadno vprasanje
else {
$spr_id = $element [ 'spr_id' ];
2022-03-31 17:35:40 +02:00
$sql1 = sisplet_query ( " SELECT tip, thread, note FROM srv_spremenljivka WHERE id = ' $spr_id ' " );
2020-08-14 13:36:36 +02:00
$row1 = mysqli_fetch_array ( $sql1 );
$orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
$tid = $row1 [ 'thread' ];
$only_unresolved = " " ;
$only_unresolved2 = " " ;
if ( $_GET [ 'only_unresolved' ] == 1 ) $only_unresolved = " AND ocena <= 1 " ;
if ( $_GET [ 'only_unresolved' ] == 1 ) $only_unresolved2 = " AND text2 <= 1 " ;
if ( $_GET [ 'only_unresolved' ] == 2 ) $only_unresolved = " AND ocena = 0 " ;
if ( $_GET [ 'only_unresolved' ] == 2 ) $only_unresolved2 = " AND text2 = 0 " ;
if ( $_GET [ 'only_unresolved' ] == 3 ) $only_unresolved = " AND ocena = 1 " ;
if ( $_GET [ 'only_unresolved' ] == 3 ) $only_unresolved2 = " AND text2 = 1 " ;
if ( $_GET [ 'only_unresolved' ] == 4 ) $only_unresolved = " AND ocena = 2 " ;
if ( $_GET [ 'only_unresolved' ] == 4 ) $only_unresolved2 = " AND text2 = 2 " ;
if ( $_GET [ 'only_unresolved' ] == 5 ) $only_unresolved = " AND ocena = 3 " ;
if ( $_GET [ 'only_unresolved' ] == 5 ) $only_unresolved2 = " AND text2 = 3 " ;
$tema_vsebuje = substr ( $lang [ 'srv_forum_intro' ], 0 , 10 ); // da ne prikazujemo 1. default sporocila
if ( $admin_type <= $question_comment_viewadminonly ) { // vidi vse komentarje
$sqlt = sisplet_query ( " SELECT * FROM post WHERE vsebina NOT LIKE '% { $tema_vsebuje } %' AND tid=' $tid ' $only_unresolved ORDER BY time $orderby , id $orderby " );
} elseif ( $question_comment_viewauthor == 1 ) { // vidi samo svoje komentarje
$sqlt = sisplet_query ( " SELECT * FROM post WHERE vsebina NOT LIKE '% { $tema_vsebuje } %' AND tid=' $tid ' $only_unresolved AND uid=' $global_user_id ' ORDER BY time $orderby , id $orderby " );
} else { // ne vidi nobenih komentarjev
$sqlt = sisplet_query ( " SELECT * FROM post WHERE 1=0 " );
}
$sql2 = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_text " . $this -> db_table . " WHERE spr_id='0' AND vre_id=' $spr_id ' $only_unresolved2 " );
$row2 = mysqli_fetch_array ( $sql2 );
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
if ( ( $_GET [ 'all_questions' ] == '1' ) OR ( mysqli_num_rows ( $sqlt ) > 0 || $row2 [ 'count' ] > 0 || $row1 [ 'note' ] != '' ) ) {
$c ++ ;
2022-03-31 17:35:40 +02:00
echo '<li id="branching_' . $spr_id . '" class="spr spr_tip_' . $row1 [ 'tip' ] . '">' ;
2020-08-14 13:36:36 +02:00
$b -> vprasanje ( $spr_id );
echo '</li>' ;
if ( $admin_type <= $question_note_view || $question_note_view == '' ) {
if ( $row1 [ 'note' ] != '' ) {
echo '<div style="float:left; width:100%; margin-left: 1%">' ;
echo '<p class="red"><b><a href="#" class="gray" onclick="$(\'.note-' . $spr_id . ', .pl, .mn\').toggle(); return false;"><span class="pl">+</span><span class="mn" style="display:none">-</span> ' . $lang [ 'srv_note' ] . '</a></b></p>' ;
echo '<p class="note-' . $spr_id . ' displayNone">' . nl2br ( $row1 [ 'note' ]) . '</p>' ;
echo '</div>' ;
}
}
2022-04-01 03:29:10 +02:00
echo '<div class="question_comment_holder">' ;
2020-08-14 13:36:36 +02:00
if ( $addfieldposition == 1 ) {
echo '<div id="survey_comment_' . $spr_id . '_' . '4' . '" style="display:none"></div>' ;
echo '<p><a href="#" onclick="$(\'#comment_field_' . $spr_id . '\').toggle(); return false;">' . $lang [ 'srv_comments_add_comment' ] . '</a></p>' ;
echo '<p id="comment_field_' . $spr_id . '" style="display:none">' ;
$ba = new BranchingAjax ( $this -> anketa );
$ba -> add_comment_field ( $spr_id , '1' , '4' , false );
echo '</p>' ;
}
2022-04-01 03:29:10 +02:00
echo '<div class="question_comment editor">' ;
// komentarji urednikov
2020-08-14 13:36:36 +02:00
if ( $row1 [ 'thread' ] > 0 ) {
if ( mysqli_num_rows ( $sqlt ) > 0 ) {
2022-04-01 03:29:10 +02:00
echo '<div class="comment_type">' ;
echo $lang [ 'srv_admin_comment' ] . ':' ;
2020-08-14 13:36:36 +02:00
2022-04-01 03:29:10 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$i = 0 ;
while ( $rowt = mysqli_fetch_array ( $sqlt )) {
2022-04-01 03:29:10 +02:00
/* if ( $_GET [ 'only_unresolved' ] == 1 ) {
2020-08-14 13:36:36 +02:00
if ( $rowt [ 'ocena' ] == 0 ) echo '<span style="color:black">' ;
elseif ( $rowt [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $rowt [ 'ocena' ] == 2 ) echo '<span style="color:#999999">' ;
elseif ( $rowt [ 'ocena' ] == 3 ) echo '<span style="color:#999999">' ;
else echo '<span>' ;
} else {
if ( $rowt [ 'ocena' ] == 0 ) echo '<span style="color:#990000">' ;
elseif ( $rowt [ 'ocena' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $rowt [ 'ocena' ] == 2 ) echo '<span style="color:black">' ;
elseif ( $rowt [ 'ocena' ] == 3 ) echo '<span style="color:black">' ;
else echo '<span>' ;
2022-04-01 03:29:10 +02:00
} */
echo '<div class="comment_box">' ;
echo '<div class="by">' ;
echo $lang [ 'srv_comments_user' ] . '<span class="user">' . $f -> user ( $rowt [ 'uid' ]) . '</span>' . $lang [ 'srv_comments_user2' ];
echo '</div>' ;
$datetime = strtotime ( $rowt [ 'time' ]);
$datetime = date ( " d.m.Y G:i " , $datetime );
echo '<div class="date">' ;
echo $datetime ;
echo '</div>' ;
echo '<div class="content">' ;
echo $rowt [ 'vsebina' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $admin_type <= 1 || $rowi [ 'insert_uid' ] == $global_user_id || $commentmarks_who == 0 ) {
2022-04-01 03:29:10 +02:00
echo '<div class="bottom_options">' ;
2020-08-14 13:36:36 +02:00
if ( $commentmarks == 1 ) {
echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . ' \ ' }, function () { window . location . reload ();}); " >
< option value = " 0 " '.($rowt[' ocena ']==0?' selected = " selected " ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 1 " '.($rowt[' ocena ']==1?' selected = " selected " ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 2 " '.($rowt[' ocena ']==2?' selected = " selected " ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 3 " '.($rowt[' ocena ']==3?' selected = " selected " ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
} else {
2022-04-01 03:29:10 +02:00
2022-04-29 04:14:11 +02:00
if ( $rowt [ 'ocena' ] == 0 ) {
2022-04-29 03:46:15 +02:00
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>' ;
2022-04-01 03:29:10 +02:00
echo $lang [ 'srv_comments_archive' ] . '</p>' ;
2022-04-29 04:14:11 +02:00
echo '<div class="reply_to" onClick="$(\'#comment_toggle_' . $spr_id . '_4\').toggle();">' ;
echo '<a href="javascript:comment_on_comment(\'' . $rowt [ 'id' ] . '\',\'' . $f -> user ( $rowt [ 'uid' ]) . '\',\'' . $datetime . '\',\'' . $spr_id . '\');"><span class="faicon fa-reply link-right"></span>' . $lang [ 'srv_comment_comment' ] . '</a>' ;
echo '</div>' ;
2022-04-01 03:29:10 +02:00
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>' . $lang [ 'srv_comments_archived' ] . '</p>' ;
2022-04-29 04:14:11 +02:00
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>' ;
echo $lang [ 'srv_comments_unarchive' ] . '</p>' ;
2022-04-01 03:29:10 +02:00
}
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
2022-04-01 03:29:10 +02:00
echo '</div>' ;
echo '<div class="reply_to_text" id="comment_on_comment_' . $rowt [ 'id' ] . '">' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
if ( $addfieldposition == '' || $addfieldposition == 0 ) {
2022-04-29 03:46:15 +02:00
echo '<div id="comment_toggle_' . $spr_id . '_' . '4' . '" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\'' . $spr_id . '_' . '4' . '\')">' ;
echo '<span class="faicon link-right comments"></span>' ;
echo $lang [ 'srv_add_comment_toggle' ];
echo '</div>' ;
echo '<div class="comment_wrapper" id="comment_wrapper_' . $spr_id . '_' . '4' . '">' ;
2022-04-01 03:29:10 +02:00
echo '<div class="new_comment" id="survey_comment_' . $spr_id . '_' . '4' . '">' ;
2020-08-14 13:36:36 +02:00
$ba = new BranchingAjax ( $this -> anketa );
$ba -> add_comment_field ( $spr_id , '1' , '4' , false );
2022-04-01 03:29:10 +02:00
echo '</div>' ;
2022-04-29 03:46:15 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-04-01 03:29:10 +02:00
echo '<div class="question_comment resp">' ;
2020-08-14 13:36:36 +02:00
// komentarji respondentov
if ( $row2 [ 'count' ] > 0 ) {
if ( $admin_type <= $question_resp_comment_viewadminonly ) {
2022-04-01 03:29:10 +02:00
echo '<div class="comment_type">' ;
echo $lang [ 'srv_repondent_comment' ] . ':' ;
2020-08-14 13:36:36 +02:00
2022-04-01 03:29:10 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( $_GET [ 'only_unresolved' ] == 1 ) $only_unresolved = " AND d.text2 <= 1 " ; else $only_unresolved = " " ;
$sqlt = sisplet_query ( " SELECT * FROM srv_data_text " . $this -> db_table . " WHERE spr_id='0' AND vre_id=' $spr_id ' $only_unresolved2 ORDER BY id ASC " );
if ( ! $sqlt ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
while ( $rowt = mysqli_fetch_array ( $sqlt )) {
2022-04-01 03:29:10 +02:00
echo '<div class="comment_box">' ;
/* if ( $rowt [ 'text2' ] == 0 ) echo '<span style="color:black">' ;
2020-08-14 13:36:36 +02:00
elseif ( $rowt [ 'text2' ] == 1 ) echo '<span style="color:darkgreen">' ;
elseif ( $rowt [ 'text2' ] == 2 ) echo '<span style="color:#999999">' ;
elseif ( $rowt [ 'text2' ] == 3 ) echo '<span style="color:#999999">' ;
2022-04-01 03:29:10 +02:00
else echo '<span>' ; */
2020-08-14 13:36:36 +02:00
// Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja
$sqlTime = sisplet_query ( " SELECT time_edit FROM srv_user WHERE id=' " . $rowt [ 'usr_id' ] . " ' " );
if ( mysqli_num_rows ( $sqlTime ) > 0 ){
$rowTime = mysqli_fetch_array ( $sqlTime );
2022-04-29 03:46:15 +02:00
echo '<div class="by">' ;
echo 'Respondent ' . $lang [ 'srv_comments_user2' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( strpos ( $rowt [ 'text' ], '__DATE__' ) !== false ) {
$rowt [ 'text' ] = str_replace ( '__DATE__' , $f -> datetime1 ( $rowTime [ 'time_edit' ]), $rowt [ 'text' ]);
2022-04-01 03:29:10 +02:00
echo '<div class="content">' ;
echo nl2br ( $rowt [ 'text' ]);
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-04-01 03:29:10 +02:00
$datetime = strtotime ( $rowTime [ 'time_edit' ]);
$datetime = date ( " d.m.Y G:i " , $datetime );
echo '<div class="date">' ;
echo $datetime ;
echo '</div>' ;
echo '<div class="content">' ;
echo nl2br ( $rowt [ 'text' ]);
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
else {
if ( strpos ( $rowt [ 'text' ], '__DATE__' ) !== false ) {
$rowt [ 'text' ] = str_replace ( '__DATE__' , '' , $rowt [ 'text' ]);
2022-04-01 03:29:10 +02:00
echo '<div class="content">' ;
echo nl2br ( $rowt [ 'text' ]);
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-04-01 03:29:10 +02:00
echo '<div class="content">' ;
echo nl2br ( $rowt [ 'text' ]);
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
2022-04-01 03:29:10 +02:00
if ( $admin_type <= 1 || $rowi [ 'insert_uid' ] == $global_user_id || $commentmarks_who == 0 ) {
echo '<div class="bottom_options">' ;
if ( $commentmarks == 1 ) {
echo ' <select name="ocena' . $rowt [ 'id' ] . '" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: this.value, id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . ' \ ' }, function () { window . location . reload ();}); " >
< option value = " 0 " '.($rowt[' text2 ']==0?' selected ':' ').' > '.$lang[' srv_undecided '].' </ option >
< option value = " 1 " '.($rowt[' text2 ']==1?' selected ':' ').' > '.$lang[' srv_todo '].' </ option >
< option value = " 2 " '.($rowt[' text2 ']==2?' selected ':' ').' > '.$lang[' srv_done '].' </ option >
< option value = " 3 " '.($rowt[' text2 ']==3?' selected ':' ').' > '.$lang[' srv_not_relevant '].' </ option >
</ select > ' ;
} else {
2022-04-29 04:14:11 +02:00
if ( $rowt [ 'text2' ] == 0 ) {
2022-04-01 03:29:10 +02:00
echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'2\'), id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>' ;
echo $lang [ 'srv_comments_archive' ] . '</p>' ;
}
else {
echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>' . $lang [ 'srv_comments_archived' ] . '</p>' ;
2022-04-29 04:14:11 +02:00
echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'0\'), id: \'' . $rowt [ 'id' ] . '\', anketa: \'' . $rowi [ 'id' ] . '\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>' ;
echo $lang [ 'srv_comments_unarchive' ] . '</p>' ;
2022-04-01 03:29:10 +02:00
}
}
echo '</div>' ;
}
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
echo '</div>' ;
}
2022-04-29 04:32:06 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
echo '</div>' ;
2022-04-29 04:32:06 +02:00
echo '</div>' ; #div.question_comment_holder
2020-08-14 13:36:36 +02:00
}
}
2022-04-01 03:29:10 +02:00
2020-08-14 13:36:36 +02:00
}
2022-04-01 03:29:10 +02:00
echo '</ul>' ;
2020-08-14 13:36:36 +02:00
if ( $c == 0 ) {
2022-04-29 01:38:57 +02:00
echo '<div>' ;
echo $lang [ 'srv_no_comments_solved' ];
2020-08-14 13:36:36 +02:00
#echo '<a href="index.php?anketa='.$this->anketa.'&a=urejanje">'.$lang['srv_settings_komentarji'].'</a>';
echo '</div>' ;
}
}
else {
2022-04-29 01:38:57 +02:00
echo '<div>' ;
echo $lang [ 'srv_no_comments' ];
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
echo '</div>' ; // branching
echo '<div id="vprasanje_float_editing"></div>' ;
}
/**
* odsteje dva datuma , $d1 - D2
*
*/
function diff ( $d1 , $d2 ) {
//echo $d1.' '.$d2;
$d1 = ( is_string ( $d1 ) ? strtotime ( $d1 ) : $d1 );
$d2 = ( is_string ( $d2 ) ? strtotime ( $d2 ) : $d2 );
//echo ' ('.$d1.' '.$d2.')<br>';
$diff_secs = abs ( $d1 - $d2 );
return $diff_secs ;
}
private $usr_id ;
/**
* vnese izbrano stevilo testnih podatkov
*
*/
function testiranje_testnipodatki () {
global $lang ;
if ( $_POST [ 'stevilo_vnosov' ] > 0 ) {
// Nastavitev da vstavljamo samo veljavne vnose
$only_valid = isset ( $_POST [ 'only_valid' ]) ? $_POST [ 'only_valid' ] : 0 ;
if ( session_id () == '' ) { session_start ();}
$_SESSION [ 'progressBar' ][ $this -> anketa ][ 'status' ] = 'ok' ;
$_SESSION [ 'progressBar' ][ $this -> anketa ][ 'total' ] = ( int ) $_POST [ 'stevilo_vnosov' ];
$_SESSION [ 'progressBar' ][ $this -> anketa ][ 'current' ] = 0 ;
session_commit ();
SurveyInfo :: getInstance () -> SurveyInit ( $this -> anketa );
$rowa = SurveyInfo :: getInstance () -> getSurveyRow ();
if ( $rowa [ 'survey_type' ] < 2 ) return ; // samo za anketo na več straneh in branching...
$sql = sisplet_query ( " SELECT MAX(recnum) AS recnum FROM srv_user WHERE ank_id = ' $this->anketa ' AND preview='0' " );
$row = mysqli_fetch_array ( $sql );
$recnum = $row [ 'recnum' ] + 1 ;
//$sql = sisplet_query("SELECT s.id, s.tip, s.size, s.ranking_k, s.design FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.visible='1' ORDER BY g.vrstni_red, s.vrstni_red");
$sql = sisplet_query ( " SELECT s.id, s.tip, s.size, s.ranking_k, s.design, s.cela FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id=' $this->anketa ' AND s.visible='1' ORDER BY g.vrstni_red, s.vrstni_red " );
# zabeležimo id-je za arhiv testnih vnosov
$arrayTestni = array ();
for ( $i = 1 ; $i <= $_POST [ 'stevilo_vnosov' ]; $i ++ ) {
session_start ();
$_SESSION [ 'progressBar' ][ $this -> anketa ][ 'current' ] = $i ;
session_commit ();
// izberemo random hash, ki se ni v bazi (to more bit, ker je index na fieldu cookie)
do {
$rand = md5 ( mt_rand ( 1 , mt_getrandmax ()) . '@' . $_SERVER [ 'REMOTE_ADDR' ]);
$sql1 = sisplet_query ( " SELECT id FROM srv_user WHERE cookie = ' $rand ' " );
} while ( mysqli_num_rows ( $sql1 ) > 0 );
$sql2 = sisplet_query ( " INSERT INTO srv_user (ank_id, preview, testdata, cookie, user_id, ip, time_insert, recnum, referer, last_status, lurker) VALUES (' $this->anketa ', '0', '2', ' $rand ', '0', ' $_SERVER[REMOTE_ADDR] ', NOW(), ' $recnum ', ' $_SERVER[HTTP_REFERER] ', '6', '0') " );
if ( ! $sql2 ) echo mysqli_error ( $GLOBALS [ 'connect_db' ]);
$this -> usr_id = mysqli_insert_id ( $GLOBALS [ 'connect_db' ]);
// Survey v zanki vsakič kreiramo znova zaradi IFov !!!
include_once ( '../../main/survey/app/global_function.php' );
new \App\Controllers\SurveyController ( true );
save ( 'usr_id' , $this -> usr_id );
$s = \App\Controllers\CheckController :: getInstance ();
$arrayTestni [] = $this -> usr_id ;
mysqli_data_seek ( $sql , 0 );
while ( $row = mysqli_fetch_array ( $sql )) {
$srv_data_vrednost = " " ;
$srv_data_grid = " " ;
$srv_data_checkgrid = " " ;
$srv_data_text = " " ;
$srv_data_textgrid = " " ;
$srv_data_rating = " " ;
$srv_data_map = " " ;
$srv_data_heatmap = " " ;
if ( $row [ 'tip' ] != 5 ) {
// radio ali select
if ( ( $row [ 'tip' ] == 1 || $row [ 'tip' ] == 3 ) ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id=' $row[id] ' " );
// Ce imamo samo veljavne vedno oznacimo enega
if ( $only_valid == 1 )
$rand = rand ( 1 , mysqli_num_rows ( $sql1 ));
else
$rand = rand ( 0 , mysqli_num_rows ( $sql1 ));
if ( $rand > 0 ) {
for ( $j = 1 ; $j <= $rand ; $j ++ )
$row1 = mysqli_fetch_array ( $sql1 );
$vrednost = $row1 [ 'id' ];
} else {
$vrednost = 0 ;
}
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
if ( $vrednost > 0 ) {
$srv_data_vrednost .= " (' $row[id] ', ' $vrednost ', ' $this->usr_id '), " ;
if ( $row1 [ 'other' ] == 1 )
$srv_data_text .= " (' $row[id] ', ' $vrednost ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
// checkbox
} elseif ( $row [ 'tip' ] == 2 ) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
unset ( $vrednost );
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id=' $row[id] ' " );
$randX = 0 ;
if ( $only_valid == 1 )
$randX = rand ( 1 , mysqli_num_rows ( $sql1 ));
$j = 1 ;
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$rand = rand ( - 1 , 1 );
if ( $rand > 0 ){
$vrednost [ $row1 [ 'id' ]] = $row1 [ 'id' ];
}
// Ce imamo samo veljavne vedno oznacimo enega
if ( $randX == $j && $only_valid == 1 ){
$vrednost [ $row1 [ 'id' ]] = $row1 [ 'id' ];
}
$j ++ ;
}
if ( $vrednost ) {
foreach ( $vrednost AS $key => $val ) {
if ( $val > 0 ) {
$srv_data_vrednost .= " (' $row[id] ', ' $val ', ' $this->usr_id '), " ;
if ( $row1 [ 'other' ] == 1 )
$srv_data_text .= " (' $row[id] ', ' $val ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
}
}
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
// multigrid
} elseif ( $row [ 'tip' ] == 6 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id=' $row[id] ' " );
// Ce imamo samo veljavne vedno oznacimo enega
if ( $only_valid == 1 )
$rand = rand ( 1 , mysqli_num_rows ( $sql2 ));
else
$rand = rand ( 0 , mysqli_num_rows ( $sql2 ));
if ( $rand > 0 ) {
for ( $j = 1 ; $j <= $rand ; $j ++ )
$row2 = mysqli_fetch_array ( $sql2 );
$grid_id = $row2 [ 'id' ];
} else {
$grid_id = 0 ;
}
if ( $grid_id > 0 ) {
$srv_data_grid .= " (' $row[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id '), " ;
}
if ( $row1 [ 'other' ] == 1 && $grid_id > 0 )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
// multicheckbox
} elseif ( $row [ 'tip' ] == 16 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $row[id] ' ORDER BY vrstni_red " );
$randX = 0 ;
if ( $only_valid == 1 )
$randX = rand ( 1 , mysqli_num_rows ( $sql2 ));
$j = 1 ;
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$rand = rand ( - 1 , 1 );
if ( $rand > 0 ) {
$grid_id = $row2 [ 'id' ];
} else {
$grid_id = 0 ;
}
// Ce imamo samo veljavne vedno oznacimo enega
if ( $randX == $j && $only_valid == 1 ){
$grid_id = $row2 [ 'id' ];
}
$j ++ ;
if ( $grid_id > 0 ) {
$srv_data_checkgrid .= " (' $row[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id '), " ;
}
if ( $row1 [ 'other' ] == 1 && $grid_id > 0 )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
// multitext
elseif ( $row [ 'tip' ] == 19 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $row[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$value = $this -> randomString ();
else
$value = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$grid_id = $row2 [ 'id' ];
if ( $value != '' ) {
$srv_data_textgrid .= " (' $row[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id ', ' $value '), " ;
}
// vsebino text polja vnesemo v vsakem primeru
if ( $row1 [ 'other' ] == 1 && $value != '' )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
//Lokacija
elseif ( $row [ 'tip' ] == 26 ){
//choose location
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " , 'array' );
//so vrednosti, se pravi je choose
if ( $sql1 ){
foreach ( $sql1 as $row1 ){
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomString ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$srv_data_map .= " ( " . $this -> usr_id . " , ' $row[id] ', ' $row1[id] ', " . $this -> anketa . " , '', '', '', ' " .
( $vrednost != '' ? $vrednost : '-1' ) . " ', ''), " ;
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
//niso vrednosti, se pravi je moja ali multi lokacija
else {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$make_input = ( $only_valid == 1 ? true : rand ( 0 , 1 ) == 0 );
if ( $make_input ){
$lat = floatval ( mt_rand ( 454000 , 466500 ) / 10000 );
$lng = floatval ( mt_rand ( 136000 , 163900 ) / 10000 );
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomString ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$srv_data_map .= " ( " . $this -> usr_id . " , ' $row[id] ', ' $row1[id] ', " . $this -> anketa . " , ' $lat ', ' $lng ', '[N/A]', ' " .
( $vrednost != '' ? $vrednost : '-1' ) . " ', ''), " ;
}
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
//Heatmap
elseif ( $row [ 'tip' ] == 27 ){
//choose location
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " , 'array' );
//so vrednosti, se pravi je choose
if ( $sql1 ){
foreach ( $sql1 as $row1 ){
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomString ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$srv_data_heatmap .= " ( " . $this -> usr_id . " , ' $row[id] ', ' $row1[id] ', " . $this -> anketa . " , '', '', '', ' " .
( $vrednost != '' ? $vrednost : '-1' ) . " ', ''), " ;
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
//niso vrednosti, se pravi je moja ali multi lokacija
else {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$make_input = ( $only_valid == 1 ? true : rand ( 0 , 1 ) == 0 );
if ( $make_input ){
$lat = floatval ( mt_rand ( 454000 , 466500 ) / 10000 );
$lng = floatval ( mt_rand ( 136000 , 163900 ) / 10000 );
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomString ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$srv_data_heatmap .= " ( " . $this -> usr_id . " , ' $row[id] ', ' $row1[id] ', " . $this -> anketa . " , ' $lat ', ' $lng ', '[N/A]', ' " .
( $vrednost != '' ? $vrednost : '-1' ) . " ', ''), " ;
}
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
// multinumber
elseif ( $row [ 'tip' ] == 20 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $row[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$value = $this -> randomNumber ();
else
$value = rand ( 0 , 1 ) == 0 ? $this -> randomNumber () : '' ;
$grid_id = $row2 [ 'id' ];
if ( $value != '' ) {
$srv_data_textgrid .= " (' $row[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id ', ' $value '), " ;
}
// vsebino text polja vnesemo v vsakem primeru
if ( $row1 [ 'other' ] == 1 && $value != '' )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
// textbox
elseif ( $row [ 'tip' ] == 4 ) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
if ( $vrednost != '' )
$srv_data_text .= " (' $row[id] ', '', ' $vrednost ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
// textbox*
elseif ( $row [ 'tip' ] == 21 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomString ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
if ( $vrednost != '' )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' $vrednost ', '', ' $this->usr_id '), " ;
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
// number
elseif ( $row [ 'tip' ] == 7 ) {
####### za ureditev avtomatskega vnosa glede na dolzino stevila
if ( $row [ 'ranking_k' ] == 0 ){ //ce je stevilo
$newLength = $row [ 'cela' ];
} elseif ( $row [ 'ranking_k' ] == 1 ){ //ce je drsnik
$rowParams = Cache :: srv_spremenljivka ( $row [ 'id' ]);
$spremenljivkaParams = new enkaParameters ( $rowParams [ 'params' ]);
$slider_MaxNumLabel = ( $spremenljivkaParams -> get ( 'slider_MaxNumLabel' ) ? $spremenljivkaParams -> get ( 'slider_MaxNumLabel' ) : 100 );
$newLength = strlen (( string ) $slider_MaxNumLabel ) - 1 ;
}
####### za ureditev avtomatskega vnosa glede na dolzino stevila - konec
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
$ij = 1 ;
unset ( $vrednost );
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 ){
//if ($row['size'] >= 1) $vrednost[0] = $this->randomNumber();
if ( $row [ 'size' ] >= 1 ) $vrednost [ 0 ] = $this -> randomNumber ( $newLength );
//if ($row['size'] >= 2) $vrednost[1] = $this->randomNumber();
if ( $row [ 'size' ] >= 2 ) $vrednost [ 1 ] = $this -> randomNumber ( $newLength );
}
elseif ( rand ( 0 , 1 ) == 0 ) {
//if ($row['size'] >= 1) $vrednost[0] = $this->randomNumber();
if ( $row [ 'size' ] >= 1 ) $vrednost [ 0 ] = $this -> randomNumber ( $newLength );
//if ($row['size'] >= 2) $vrednost[1] = $this->randomNumber();
if ( $row [ 'size' ] >= 2 ) $vrednost [ 1 ] = $this -> randomNumber ( $newLength );
}
if ( isset ( $vrednost )){
$text = '' ;
$text2 = '' ;
foreach ( $vrednost AS $key => $val ) {
if ( $ij == 1 ){
if ( $val != '' )
$text = $val ;
}
else {
if ( $val != '' )
$text2 = $val ;
}
$ij ++ ;
}
$srv_data_text .= " (' $row[id] ', '', ' $text ', ' $text2 ', ' $this->usr_id '), " ;
}
}
else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
// compute
elseif ( $row [ 'tip' ] == 22 ) {
if ( true ){
$val = $s -> checkCalculation ( - $row [ 'id' ]); // za spremenljivke je v srv_calculation, v cnd_id zapisan id spremenljivke kot minus (plus je za kalkulacije v ifih)
if ( $val != '' )
$srv_data_text .= " (' $row[id] ', '', ' $val ', '', ' $this->usr_id '), " ;
}
}
// 8_datum
elseif ( $row [ 'tip' ] == 8 ) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$vrednost = $this -> randomDate ();
else
$vrednost = rand ( 0 , 1 ) == 0 ? $this -> randomDate () : '' ;
if ( $vrednost != '' )
$srv_data_text .= " (' $row[id] ', '', ' $vrednost ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
// ranking
elseif ( $row [ 'tip' ] == 17 ) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
//cifre
if ( $row [ 'design' ] == 1 or true ){ // tukaj se pac vse generira tukaj
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' AND vrstni_red>0 ORDER BY vrstni_red " );
$rows = mysqli_num_rows ( $sql1 );
if ( $row [ 'ranking_k' ] > 0 ) $rows = $row [ 'ranking_k' ];
unset ( $array );
// Ce imamo samo veljavne imamo vedno vrednosti
if ( $only_valid == 1 ){
if ( rand ( 0 , 1 ) == 0 ) $rows = floor ( $rows / 2 );
$array = range ( 1 , $rows );
shuffle ( $array );
}
elseif ( rand ( 0 , 1 ) == 0 ) {
if ( rand ( 0 , 1 ) == 0 ) $rows = floor ( $rows / 2 );
$array = range ( 1 , $rows );
shuffle ( $array );
}
while ( $row1 = mysqli_fetch_array ( $sql1 )){
if ( count ( $array ) > 0 ) {
$vrednost = array_pop ( $array );
if ( $vrednost != '' )
$srv_data_rating .= " (' $row[id] ', ' $row1[id] ', ' $this->usr_id ', ' $vrednost '), " ;
}
}
}
//n==k (sortable)
else if ( $row [ 'design' ] == 2 ){
}
//n>k
else if ( $row [ 'design' ] == 0 ){
}
}
else
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
// vsota
elseif ( $row [ 'tip' ] == 18 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' AND vrstni_red>0 ORDER BY vrstni_red " );
while ( $row1 = mysqli_fetch_array ( $sql1 )){
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )){
unset ( $vrednost );
// Ce imamo samo veljavne imamo vedno vrednosti
if ( $only_valid == 1 )
$vrednost = $this -> randomNumber ();
elseif ( rand ( 0 , 1 ) == 0 )
$vrednost = $this -> randomNumber ();
if ( isset ( $vrednost )) {
if ( $vrednost != '' )
$srv_data_text .= " (' $row[id] ', ' $row1[id] ', ' $vrednost ', '', ' $this->usr_id '), " ;
}
}
else
$srv_data_vrednost .= " (' $row[id] ', '-2', ' $this->usr_id '), " ;
}
}
// Kombinirana tabela
elseif ( $row [ 'tip' ] == 24 ){
// Loop cez podtabele kombinirane dabele
$sqlC = sisplet_query ( " SELECT s.id, s.tip FROM srv_grid_multiple m, srv_spremenljivka s WHERE m.parent=' $row[id] ' AND m.spr_id=s.id ORDER BY m.vrstni_red " );
while ( $rowC = mysqli_fetch_array ( $sqlC )) {
// multigrid
if ( $rowC [ 'tip' ] == 6 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $rowC[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
if ( $s -> checkSpremenljivka ( $rowC [ 'id' ], $isTestData = true )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id=' $rowC[id] ' " );
// Ce imamo samo veljavne vedno oznacimo enega
if ( $only_valid == 1 )
$rand = rand ( 1 , mysqli_num_rows ( $sql2 ));
else
$rand = rand ( 0 , mysqli_num_rows ( $sql2 ));
if ( $rand > 0 ) {
for ( $j = 1 ; $j <= $rand ; $j ++ )
$row2 = mysqli_fetch_array ( $sql2 );
$grid_id = $row2 [ 'id' ];
} else {
$grid_id = 0 ;
}
if ( $grid_id > 0 ) {
$srv_data_grid .= " (' $rowC[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id '), " ;
}
if ( $row1 [ 'other' ] == 1 && $grid_id > 0 )
$srv_data_text .= " (' $rowC[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $rowC[id] ', '-2', ' $this->usr_id '), " ;
}
}
// multicheckbox
} elseif ( $rowC [ 'tip' ] == 16 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $rowC[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $rowC[id] ' ORDER BY vrstni_red " );
$randX = 0 ;
if ( $only_valid == 1 )
$randX = rand ( 1 , mysqli_num_rows ( $sql2 ));
$j = 1 ;
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $rowC [ 'id' ], $isTestData = true )) {
$rand = rand ( - 1 , 1 );
if ( $rand > 0 ) {
$grid_id = $row2 [ 'id' ];
} else {
$grid_id = 0 ;
}
// Ce imamo samo veljavne vedno oznacimo enega
if ( $randX == $j && $only_valid == 1 ){
$grid_id = $row2 [ 'id' ];
}
$j ++ ;
if ( $grid_id > 0 ) {
$srv_data_checkgrid .= " (' $rowC[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id '), " ;
}
if ( $row1 [ 'other' ] == 1 && $grid_id > 0 )
$srv_data_text .= " (' $rowC[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
} else {
$srv_data_vrednost .= " (' $rowC[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
// multitext
elseif ( $rowC [ 'tip' ] == 19 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $rowC[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $rowC[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $row [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$value = $this -> randomString ();
else
$value = rand ( 0 , 1 ) == 0 ? $this -> randomString () : '' ;
$grid_id = $row2 [ 'id' ];
if ( $value != '' ) {
$srv_data_textgrid .= " (' $rowC[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id ', ' $value '), " ;
}
// vsebino text polja vnesemo v vsakem primeru
if ( $row1 [ 'other' ] == 1 && $value != '' )
$srv_data_text .= " (' $rowC[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
else {
$srv_data_vrednost .= " (' $rowC[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
// multinumber
elseif ( $rowC [ 'tip' ] == 20 ) {
$sql1 = sisplet_query ( " SELECT id, other FROM srv_vrednost WHERE spr_id = ' $rowC[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $rowC[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
if ( $s -> checkSpremenljivka ( $rowC [ 'id' ], $isTestData = true )) {
// Ce imamo samo veljavne imamo vedno vrednost
if ( $only_valid == 1 )
$value = $this -> randomNumber ();
else
$value = rand ( 0 , 1 ) == 0 ? $this -> randomNumber () : '' ;
$grid_id = $row2 [ 'id' ];
if ( $value != '' ) {
$srv_data_textgrid .= " (' $rowC[id] ', ' $row1[id] ', ' $this->usr_id ', ' $grid_id ', ' $value '), " ;
}
// vsebino text polja vnesemo v vsakem primeru
if ( $row1 [ 'other' ] == 1 && $value != '' )
$srv_data_text .= " (' $rowC[id] ', ' $row1[id] ', ' " . $this -> randomString () . " ', '', ' $this->usr_id '), " ;
}
else {
$srv_data_vrednost .= " (' $rowC[id] ', '-2', ' $this->usr_id '), " ;
}
}
}
}
}
}
}
// vprasanja shranjujemo sproti, zaradi IFov !!!
// odrezemo zadnjo vejico, ker smo jo dodajali kar povsod
$srv_data_grid = substr ( $srv_data_grid , 0 , - 1 );
$srv_data_vrednost = substr ( $srv_data_vrednost , 0 , - 1 );
$srv_data_text = substr ( $srv_data_text , 0 , - 1 );
$srv_data_checkgrid = substr ( $srv_data_checkgrid , 0 , - 1 );
$srv_data_textgrid = substr ( $srv_data_textgrid , 0 , - 1 );
$srv_data_rating = substr ( $srv_data_rating , 0 , - 1 );
$srv_data_map = substr ( $srv_data_map , 0 , - 1 );
$srv_data_heatmap = substr ( $srv_data_heatmap , 0 , - 1 );
if ( $srv_data_grid != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_grid " . $this -> db_table . " (spr_id, vre_id, usr_id, grd_id) VALUES $srv_data_grid " ); if ( ! $sq ) echo 'err011: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_vrednost != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_vrednost " . $this -> db_table . " (spr_id, vre_id, usr_id) VALUES $srv_data_vrednost " ); if ( ! $sq ) echo 'err012: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_text != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_text " . $this -> db_table . " (spr_id, vre_id, text, text2, usr_id) VALUES $srv_data_text " ); if ( ! $sq ) echo 'err013: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_checkgrid != '' ){ $sq = sisplet_query ( " INSERT INTO srv_data_checkgrid " . $this -> db_table . " (spr_id, vre_id, usr_id, grd_id) VALUES $srv_data_checkgrid " ); if ( ! $sq ) echo 'err014: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_textgrid != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_textgrid " . $this -> db_table . " (spr_id, vre_id, usr_id, grd_id, text) VALUES $srv_data_textgrid " ); if ( ! $sq ) echo 'err015: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_rating != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_rating (spr_id, vre_id, usr_id, vrstni_red) VALUES $srv_data_rating " ); if ( ! $sq ) echo 'err016: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_map != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_map (usr_id, spr_id, vre_id, ank_id, lat, lng, address, text, vrstni_red) VALUES $srv_data_map " ); if ( ! $sq ) echo 'err016: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
if ( $srv_data_heatmap != '' ) { $sq = sisplet_query ( " INSERT INTO srv_data_heatmap (usr_id, spr_id, vre_id, ank_id, lat, lng, address, text, vrstni_red) VALUES $srv_data_heatmap " ); if ( ! $sq ) echo 'err017: ' . mysqli_error ( $GLOBALS [ 'connect_db' ]); }
}
$recnum ++ ;
}
# zabeležimo kdaj so bili dodani testni vnosi
if ( count ( $arrayTestni )) {
global $global_user_id ;
$ins_date = date ( " Y-m-d H:m:s " );
$insert_qry = " INSERT INTO srv_testdata_archive (ank_id, add_date, add_uid, usr_id) VALUES " ;
$prefix = '' ;
foreach ( $arrayTestni AS $at_user_id ) {
$insert_qry .= $prefix . " (' " . $this -> anketa . " ', ' $ins_date ', ' $global_user_id ', ' $at_user_id ') " ;
$prefix = ', ' ;
}
sisplet_query ( $insert_qry );
}
if ( session_id () == '' ) { session_start ();}
$_SESSION [ 'progressBar' ][ $this -> anketa ][ 'status' ] = 'end' ;
session_commit ();
unset ( $_SESSION [ 'progressBar' ][ $this -> anketa ]); // ce getCollectTimer ne prebere vec 'end' (se prehitro refresha), se tukaj odstranimo sejo
header ( " Location: index.php?anketa= $this->anketa &a=testiranje&m=testnipodatki " );
} elseif ( $_GET [ 'delete_testdata' ] == 1 || $_GET [ 'delete_autogen_testdata' ] == 1 ) {
if ( $_GET [ 'delete_autogen_testdata' ] == 1 )
sisplet_query ( " DELETE FROM srv_user WHERE ank_id=' $this->anketa ' AND testdata='2' " );
else
sisplet_query ( " DELETE FROM srv_user WHERE ank_id=' $this->anketa ' AND (testdata='1' OR testdata='2') " );
#datoteki z podatki moramo zgenerirati na novo
sisplet_query ( " UPDATE srv_data_files SET head_file_time='0000-00-00', data_file_time='0000-00-00' WHERE sid=' $this->anketa ' " );
sisplet_query ( " COMMIT " );
header ( " Location: " . $_SERVER [ 'HTTP_REFERER' ]);
// izpis podatkov
} else {
$sql = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_user WHERE ank_id=' $this->anketa ' AND (testdata='1' OR testdata='2') " );
$row = mysqli_fetch_array ( $sql );
$total_rows = $row [ 'count' ];
echo '<form name="" action="ajax.php?anketa=' . $this -> anketa . '&a=testiranje&m=testnipodatki" method="post" onsubmit="init_progressBar(true);">' ;
2022-04-01 06:02:12 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_testiranje_vnosi' ] . '</legend>' ;
echo '<p class="bottom16">' . $lang [ 'srv_testni_nagovor' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo $lang [ 'srv_stevilo_vnosov' ] . ':' ;
echo '<div class="max_wrap">' ;
echo '<input class="text large" type="text" name="stevilo_vnosov" value="1" onkeyup="max_stevilo_vnosov();">' ;
echo '<span class="gray">(max 1000)</span>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
echo '<input type="hidden" name="only_valid" id="only_valid_0" value="0" />' ;
2022-04-01 06:02:12 +02:00
echo '<input type="checkbox" name="only_valid" id="only_valid_1" value="1">' ;
echo '<label for="only_valid_1">' . $lang [ 'srv_testni_samo_veljavni' ] . '</label>' ;
echo '</div>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium blue" type="submit">' . $lang [ 'srv_dodaj_vnose' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
2022-04-01 06:02:12 +02:00
echo '<p class="bottom16">' . $lang [ 'srv_testni_nakonec' ] . '</p>' ;
echo '<a class="noline" href="#" onClick="delete_test_data();"><span class="faicon trash empty link-right"></span>' . $lang [ 'srv_delete_testdata' ] . '</a> (' . $total_rows . ')' ;
2020-08-14 13:36:36 +02:00
if ( $total_rows > 0 ) {
$prevpage = 0 ;
$sql = sisplet_query ( " SELECT s.id, s.gru_id, s.tip, s.naslov, g.naslov AS pagename FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND s.visible='1' AND g.ank_id=' $this->anketa ' ORDER BY g.vrstni_red, s.vrstni_red " );
while ( $row = mysqli_fetch_array ( $sql )) {
// labela in compute ne upostevamo
if ( $row [ 'tip' ] != 5 && $row [ 'tip' ] != 22 ) {
if ( $prevpage == 0 || $row [ 'gru_id' ] != $prevpage ) {
if ( $prevpage > 0 ) {
echo '</table>' ;
echo '</fieldset>' ;
}
echo '<fieldset><legend>' . $row [ 'pagename' ] . '</legend>' ;
2022-04-01 06:02:12 +02:00
echo '<table>' ;
2020-08-14 13:36:36 +02:00
$prevpage = $row [ 'gru_id' ];
}
2022-04-01 06:02:12 +02:00
echo '<tr><td title="' . strip_tags ( $row [ 'naslov' ]) . '">' . skrajsaj ( strip_tags ( $row [ 'naslov' ]), 50 ) . '</td>' ;
2020-08-14 13:36:36 +02:00
// radio ali select, checkbox, textbox, textbox*, number, datum
if ( ( $row [ 'tip' ] == 1 || $row [ 'tip' ] == 3 || $row [ 'tip' ] == 2 || $row [ 'tip' ] == 4 || $row [ 'tip' ] == 21 || $row [ 'tip' ] == 7 || $row [ 'tip' ] == 8 ) ) {
$sqlc = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_vrednost " . $this -> db_table . " dv, srv_user u WHERE dv.usr_id=u.id AND (u.testdata='1' OR u.testdata='2') AND spr_id=' $row[id] ' AND vre_id='-2' " );
$rowc = mysqli_fetch_array ( $sqlc );
$p = round (( $total_rows - $rowc [ 'count' ]) / $total_rows * 100 , 2 );
// multigrid
} elseif ( $row [ 'tip' ] == 6 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sqlc = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_grid " . $this -> db_table . " dg, srv_user u WHERE dg.usr_id=u.id AND (u.testdata='1' OR u.testdata='2') AND spr_id=' $row[id] ' AND vre_id=' $row1[id] ' AND grd_id='-2' " );
$rowc = mysqli_fetch_array ( $sqlc );
$p = round (( $total_rows - $rowc [ 'count' ]) / $total_rows * 100 , 2 );
}
// multicheckbox
} elseif ( $row [ 'tip' ] == 16 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $row[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
$sqlc = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_checkgrid " . $this -> db_table . " cg, srv_user u WHERE cg.usr_id=u.id AND (u.testdata='1' OR u.testdata='2') AND spr_id=' $row[id] ' AND vre_id=' $row1[id] ' AND grd_id='-2' " );
$rowc = mysqli_fetch_array ( $sqlc );
$p = round (( $total_rows - $rowc [ 'count' ]) / $total_rows * 100 , 2 );
}
}
}
// multitext, multinumber
elseif ( $row [ 'tip' ] == 19 || $row [ 'tip' ] == 20 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' " );
while ( $row1 = mysqli_fetch_array ( $sql1 )) {
$sql2 = sisplet_query ( " SELECT id FROM srv_grid WHERE spr_id = ' $row[id] ' ORDER BY vrstni_red " );
while ( $row2 = mysqli_fetch_array ( $sql2 )) {
$sqlc = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_textgrid " . $this -> db_table . " tg, srv_user u WHERE tg.usr_id=u.id AND (u.testdata='1' OR u.testdata='2') AND spr_id=' $row[id] ' AND vre_id=' $row1[id] ' AND grd_id='0' AND text='-2' " );
$rowc = mysqli_fetch_array ( $sqlc );
$p = round (( $total_rows - $rowc [ 'count' ]) / $total_rows * 100 , 2 );
}
}
}
// ranking, vsota
elseif ( $row [ 'tip' ] == 17 || $row [ 'tip' ] == 18 ) {
$sql1 = sisplet_query ( " SELECT id FROM srv_vrednost WHERE spr_id = ' $row[id] ' AND vrstni_red>0 ORDER BY vrstni_red " );
while ( $row1 = mysqli_fetch_array ( $sql1 )){
$sqlc = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_data_text " . $this -> db_table . " dt, srv_user u WHERE dt.usr_id=u.id AND (u.testdata='1' OR u.testdata='2') AND spr_id=' $row[id] ' AND vre_id=' $row1[id] ' AND text='-2' " );
$rowc = mysqli_fetch_array ( $sqlc );
$p = round (( $total_rows - $rowc [ 'count' ]) / $total_rows * 100 , 2 );
}
}
2022-04-01 06:02:12 +02:00
echo '<td class="graph_cell">' ;
echo '<div class="graph_cell">' ;
echo ' <div class="graph_full" style="width: ' . ( $p * 0.7 ) . '%"></div>' ;
echo ' <span>' . $p . '% (' . ( $total_rows - $rowc [ 'count' ]) . ')</span>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</td>' ;
echo '</tr>' ;
}
}
echo '</table>' ;
echo '</fieldset>' ;
2022-04-01 06:02:12 +02:00
echo '</fieldset>' ;
2020-12-10 13:09:02 +01:00
}
2020-08-14 13:36:36 +02:00
}
}
/**
* zgenerira random string za vpis v tekstovno polje
*
*/
function randomString ( $length = 10 , $chars = 'abcdefghijklmnopqrstuvwxyz' ) {
// Length of character list
$chars_length = ( strlen ( $chars ) - 1 );
// Start our string
2020-12-07 09:43:59 +01:00
$string = $chars [ mt_rand ( 0 , $chars_length )];
2020-08-14 13:36:36 +02:00
// Generate random string
for ( $i = 1 ; $i < $length ; $i = strlen ( $string ))
{
// Grab a random character from our list
2020-12-07 09:43:59 +01:00
$r = $chars [ mt_rand ( 0 , $chars_length )];
2020-08-14 13:36:36 +02:00
// Make sure the same two characters don't appear next to each other
2020-12-07 09:43:59 +01:00
if ( $r != $string [ $i - 1 ]) $string .= $r ;
2020-08-14 13:36:36 +02:00
}
// Return the string
return $string ;
}
function randomNumber ( $length = 4 , $chars = '0123456789' ) {
return $this -> randomString ( $length , $chars );
}
function randomDate ( $startDate = '01.01.1950' , $endDate = '' ) {
if ( $endDate == '' ) $endDate = date ( " d.m.Y " );
$days = round (( strtotime ( $endDate ) - strtotime ( $startDate )) / ( 60 * 60 * 24 ));
$n = rand ( 0 , $days );
return date ( " d.m.Y " , strtotime ( " $startDate + $n days " ));
}
function displayBtnMailtoPreview ( $row ) {
global $lang ;
echo '<div class="floatLeft"><div class="buttonwrapper">' ;
2021-11-05 08:06:00 +01:00
echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="' . ( ( $row [ 'active' ] != 1 ) ? 'genericAlertPopup(\'srv_anketa_noactive2\'); ' : 'preview_mailto_email(); ' ) . 'return false;">' ;
2020-08-14 13:36:36 +02:00
echo '<span>' ;
//'<img src="icons/icons/accept.png" alt="" vartical-align="middle" />'
echo $lang [ 'srv_mailto_preview' ] . '</span></a></div></div>' ;
}
function DisplayNastavitveTrajanje () {
global $lang ;
global $site_url ;
# vsilimo refresh podatkov
SurveyInfo :: getInstance () -> resetSurveyData ();
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
$starts = date ( 'd.m.Y' , strtotime ( $row [ 'starts' ]));
$_expire = explode ( '-' , $row [ 'expire' ]);
$expire = $_expire [ 2 ] . '.' . $_expire [ 1 ] . '.' . $_expire [ 0 ];
2021-11-30 01:27:23 +01:00
echo '<fieldset>' ;
2022-05-03 08:41:01 +02:00
echo '<legend>' . $lang [ 'srv_activate_duration_2' ] . '</legend>' ;
2021-12-15 12:36:12 +01:00
echo '<div class="setting_holder" id="start">' ;
2021-11-30 01:27:23 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_activate_duration_manual_from' ] . '</span>' ;
2021-12-09 00:07:01 +01:00
echo '<div class="icon_holder">' ;
echo '<input id="startsManual1" type="text" class="large" readonly="true" name="durationStarts" value="' . $starts . '" autocomplete="off"/>' ;
2021-11-30 01:27:23 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-15 12:36:12 +01:00
echo '<div class="setting_holder" id="expire">' ;
2021-11-30 01:27:23 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_activate_duration_manual_to' ] . '</span>' ;
2021-12-09 00:07:01 +01:00
echo '<div class="icon_holder">' ;
2021-12-15 12:36:12 +01:00
echo '<input id="expireManual1" type="text" class="large ' . ( $row [ 'expire' ] == PERMANENT_DATE ? ' disabled' : '' ) . '" readonly="true" name="durationExpire" value="' . $expire . '" autocomplete="off"/>' ;
2021-11-30 01:27:23 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-30 01:27:23 +01:00
echo '<div class="setting_holder">' ;
2020-08-14 13:36:36 +02:00
echo '<input id="expirePermanent" type="checkbox" name="expirePermanent" value="1"' . ( $row [ 'expire' ] == PERMANENT_DATE ? ' checked="checked"' : '' ) . ' autocomplete="off" onchange="setExpirePermanent();"/>' ;
2021-11-30 01:27:23 +01:00
echo '<label for="expirePermanent">' . $lang [ 'srv_trajna_anketa' ] . '</label>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2021-11-30 01:27:23 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
echo '
2021-12-09 00:07:01 +01:00
< script type = " text/javascript " >
2020-08-14 13:36:36 +02:00
$ ( document ) . ready ( function () {
2021-12-09 00:07:01 +01:00
datepicker ( " #startsManual1 " );
2021-12-15 12:36:12 +01:00
datepicker ( " #expireManual1 " ); ' ;
if ( $row [ 'expire' ] == PERMANENT_DATE )
2021-12-15 13:27:11 +01:00
echo '$("#expire").find(".ui-datepicker-trigger").addClass("disabled");' ;
2021-12-15 12:36:12 +01:00
echo ' });
2021-12-09 00:07:01 +01:00
</ script > ' ;
2020-08-14 13:36:36 +02:00
}
function DisplayNastavitveMaxGlasov () {
global $lang ;
global $site_url ;
global $site_path ;
global $admin_type ;
global $global_user_id ;
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
//Nastavitev max stevila glasov
echo '<fieldset>' ;
echo '<legend>' . $lang [ 'srv_vote_quotas' ] . ' ' . Help :: display ( 'srv_activity_quotas' ) . '</legend>' ;
2021-12-15 13:27:11 +01:00
echo '<div class="setting_holder ' . ( $row [ 'vote_limit' ] == 0 ? 'bottom0' : '' ) . '" id="vote_limit">' ;
2020-08-14 13:36:36 +02:00
2021-11-30 01:27:23 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_vote_quotas_2' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vote_limit" value="0" id="vote_limit_0"' . ( $row [ 'vote_limit' ] == 0 ? ' checked="checked"' : '' ) . ' onClick="voteCountStatus(0)" />' ;
echo '<label for="vote_limit_0">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vote_limit" value="1" id="vote_limit_1"' . ( $row [ 'vote_limit' ] == 1 ? ' checked="checked"' : '' ) . ' onClick="voteCountStatus(1)" />' ;
echo '<label for="vote_limit_1">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="vote_limit" value="2" id="vote_limit_2"' . ( $row [ 'vote_limit' ] == 2 ? ' checked="checked"' : '' ) . ' onClick="voteCountStatus(2)" />' ;
echo '<label for="vote_limit_2">' . $lang [ 'srv_data_only_valid' ] . ' (status 5, 6) ' . Help :: display ( 'srv_activity_quotas_valid' ) . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-11-30 01:27:23 +01:00
echo '</div>' ;
2021-12-15 13:27:11 +01:00
// Opozorilo, da je limit odgovorov presezen
echo '<div id="vote_limit_warning" class="' . ( $row [ 'vote_limit' ] == 0 ? 'displayNone' : '' ) . '">' ;
2021-11-30 01:27:23 +01:00
echo '<div class="setting_holder">' ;
2021-12-15 14:26:53 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_vote_count' ] . ':</span>' ;
2021-12-15 13:48:45 +01:00
echo '<input type="text" class="large" id="vote_count" name="vote_count" value="' . $row [ 'vote_count' ] . '"/></label>' ;
2021-11-30 01:27:23 +01:00
echo '</div>' ;
2021-12-15 13:27:11 +01:00
echo '<p class="top16">' . $lang [ 'srv_survey_voteLimit_warning' ] . ':</p>' ;
2020-08-14 13:36:36 +02:00
$srv_survey_non_active_voteLimit = SurveySetting :: getInstance () -> getSurveyMiscSetting ( 'srvlang_srv_survey_non_active_voteLimit' );
if ( $srv_survey_non_active_voteLimit == '' ) $srv_survey_non_active_voteLimit = $lang [ 'srv_survey_non_active_voteLimit' ];
2021-12-15 13:27:11 +01:00
echo '<p><span class="italic">' . $srv_survey_non_active_voteLimit . ' </span><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this -> anketa . '&a=jezik"><span class="faicon edit"></span></a><p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
/**
* Uporabnik ( administrator , manager ) lahko dodajata nove uporabnike in jim dodelita dostop
*/
public function dodajNovegaUporabnika (){
global $admin_type ;
global $lang ;
2020-12-10 13:09:02 +01:00
// admini lahko dodajajo uporabnike, ki jih nato managirajo
if ( $admin_type != 0 )
2020-08-14 13:36:36 +02:00
return '' ;
2020-12-10 13:09:02 +01:00
echo '<div id="dodajanjeNovega">' ;
2020-08-14 13:36:36 +02:00
2020-12-10 13:09:02 +01:00
echo '<form class="manager_add_user" name="admin_add_user" action="ajax.php?t=dostop&a=add_new_user" method="post">' ;
2020-08-14 13:36:36 +02:00
echo '<h3><b>' . $lang [ 'srv_users_add_new_title' ] . '</b></h3>' ;
2020-12-10 13:09:02 +01:00
2020-08-14 13:36:36 +02:00
echo '<p><label for="email">' . $lang [ 'email' ] . ':</label><input type="email" id="email" name="email"> ' . ( ! empty ( $_GET [ 'add' ]) && $_GET [ 'error' ] == 'email' ? '<span class="red">' . $lang [ 'srv_added_false' ] . '</span>' : '' ) . '</p>' ;
echo '<p><label for="name">' . $lang [ 'name' ] . ':</label><input type="text" id="name" name="name"></p>' ;
echo '<p><label for="surname">' . $lang [ 'surname' ] . ':</label><input type="text" id="surname" name="surname"></p>' ;
echo '<p><label for="password">' . $lang [ 'password' ] . ':</label><input type="password" id="password" name="password"> ' . ( ! empty ( $_GET [ 'add' ]) && $_GET [ 'error' ] == 'pass' ? '<span class="red">' . $lang [ 'pass_doesnt_match' ] . '</span>' : '' ) . '</p>' ;
echo '<p><label for="password2">' . $lang [ 'again' ] . ':</label><input type="password" id="password2" name="password2"></p>' ;
echo '<p><label for="jezik">' . $lang [ 'lang' ] . ' :</ label >
< select id = " jezik " name = " jezik " >
< option value = " 1 " selected > '.$lang[' srv_diagnostics_filter_lang_slo '].' </ option >
< option value = " 2 " > '.$lang[' srv_diagnostics_filter_lang_ang '].' </ option >
</ select >
</ p > ' ;
2020-12-10 13:09:02 +01:00
//echo '<p><button type="submit">'.$lang['add'].'</button></p>';
echo '<p><div class="buttonwrapper floatLeft">' ;
echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.admin_add_user.submit();">' . $lang [ 'create' ] . '</a>' ;
echo '</div></p>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
echo '</div>' ;
}
/**
* Uporabnik ( administrator , manager ) lahko dodajata nove uporabnike in jim dodelita dostop
*/
public function dodeljeniUporabniki (){
global $admin_type ;
global $lang ;
global $global_user_id ;
// managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
if ( ! ( $admin_type == 1 || $admin_type == 0 ) )
return '' ;
2022-04-28 23:41:35 +02:00
echo '<p class="bottom16 caps semi-bold">' . $lang [ 'srv_users_add_assigned' ] . '</p>' ;
2021-01-25 09:03:17 +01:00
// Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
2021-09-29 10:37:17 +02:00
if ( false && isVirtual () && $admin_type == 1 ){
2020-12-10 13:09:02 +01:00
// Limit st. dodeljenih uporabnikov
$managed_accounts_limit = 5 ;
// Prestejemo dodeljene uporabnike
$sql = sisplet_query ( " SELECT u.email
FROM srv_dostop_manage m , users u
WHERE m . manager = '".$global_user_id."' AND u . id = m . user AND u . email NOT LIKE ( 'D3LMD-%' ) AND u . email NOT LIKE ( 'UNSU8MD-%' )
" );
2020-08-14 13:36:36 +02:00
2020-12-10 13:09:02 +01:00
$managed_accounts_count = mysqli_num_rows ( $sql );
2020-08-14 13:36:36 +02:00
2021-01-04 11:46:32 +01:00
2022-04-28 23:41:35 +02:00
echo '<p class="bold bottom16">' ;
echo $lang [ 'srv_users_add_assigned_max_1' ] . ' <span class="red bold">' . $managed_accounts_limit . '</span> ' . $lang [ 'srv_users_add_assigned_max_2' ] . '</p>' ;
2021-01-04 11:46:32 +01:00
2020-12-10 13:09:02 +01:00
// Manager na virtualkah ima omejitev koliko uporabnikov lahko pregleduje
if ( $managed_accounts_count >= $managed_accounts_limit ){
2022-04-28 23:41:35 +02:00
echo '<p>' ;
2021-01-04 11:46:32 +01:00
echo $lang [ 'srv_users_add_assigned_max_reached' ];
echo '</p>' ;
2020-12-10 13:09:02 +01:00
return ;
}
2021-01-04 11:46:32 +01:00
elseif ( $managed_accounts_count > 0 ){
2022-04-28 23:41:35 +02:00
echo '<p>' ;
echo $lang [ 'srv_users_add_assigned_current' ] . ' <span class="red bold">' . $managed_accounts_count . ' ' . $lang [ 'of' ] . ' ' . $managed_accounts_limit . '</span></p>' ;
2020-12-10 13:09:02 +01:00
}
}
echo '<div id="dodajanje">' ;
2022-04-28 23:41:35 +02:00
echo '<div id="dodajanje_horizontal">' ;
2020-12-10 13:09:02 +01:00
2021-01-25 09:03:17 +01:00
// Dodajanje novih uporabnikov - ustvari racun, doda uporabnika pod pregled in mu poslje mail
2022-04-28 23:41:35 +02:00
echo '<div id="dodajanje_left">' ;
2020-12-10 13:09:02 +01:00
echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">' ;
2022-04-28 23:41:35 +02:00
echo '<p class="semi-bold">' . $lang [ 'srv_users_add_assigned_title' ] . '</p>' ;
echo '<div class="add_user_fields_wrapper">' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'email' ] . ':</p>' ;
echo '<input type="email" class="text large" id="email" name="email"> ' . ( empty ( $_GET [ 'add' ]) && $_GET [ 'error' ] == 'email' ? '<span class="red">' . $lang [ 'srv_added_false' ] . '</span>' : '' );
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'name' ] . ':</p>' ;
echo '<input type="text" class="text large" id="name" name="name">' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'surname' ] . ':</p>' ;
echo '<input type="text" class="text large" id="surname" name="surname">' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'password' ] . ':</p>' ;
echo '<input type="password" class="text large" id="password" name="password"> ' . ( empty ( $_GET [ 'add' ]) && $_GET [ 'error' ] == 'pass' ? '<span class="red">' . $lang [ 'pass_doesnt_match' ] . '</span>' : '' );
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<p>' . $lang [ 'again' ] . ':</p>' ;
echo '<input type="password" class="text large" id="password2" name="password2">' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-04-28 23:41:35 +02:00
echo '</div>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium blue" onClick="document.manager_add_user.submit();">' . $lang [ 'create_add' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
2022-04-28 23:41:35 +02:00
echo '</div>' ; // #dodajaje_left
echo '<div id="dodajanje_right">' ;
2020-08-14 13:36:36 +02:00
// admini si lahko dodajajo ze obstojece uporabnike
if ( $admin_type == 0 ) {
2020-12-10 13:09:02 +01:00
echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">' ;
2022-04-28 23:41:35 +02:00
echo '<p class="bottom8 semi-bold">' . $lang [ 'srv_manager_add_user2' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<p class="bottom4">' . $lang [ 'srv_manager_add_user_label' ] . ':</p>' ;
echo '<select name="uid" class="js-obstojeci-uporabniki-admin-ajax drowpdown large" style="width: 460px;"></select>' ;
echo '</div>' ;
echo '<div class="button_holder">' ;
echo '<button class="medium blue" onCclick="document.admin_add_dostop.submit();">' . $lang [ 'add' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</form>' ;
}
// Managerji lahko dodajajo samo uporabnike z dolocenimi emaili (če jim domeno posebej nastavi admin)
// TODO: trenutno onemogočimo dodaja ostalih uporabnikov za managerje. Ko bo stvar vezana na domeno se jim bo omogočilo dodajanje samo domenskih
2020-12-10 13:09:02 +01:00
/* elseif ( false && $admin_type == 1 ){
2020-08-14 13:36:36 +02:00
UserSetting :: getInstance () -> Init ( $global_user_id );
$emails = UserSetting :: getInstance () -> getUserSetting ( 'manage_domain' );
echo '<br><form class="manager_add_user" action="ajax.php?t=dostop&a=admin_add_user" method="post">' ;
echo '<h3><b>' . sprintf ( $lang [ 'srv_manager_add_user3' ], $emails ) . '<br />' . $lang [ 'srv_manager_add_user4' ] . '</b></h3>' ;
echo '<p><input name="uemail" value="" style="width: 500px;" id="manager-email"><span id="manager-email-obvestilo"></span></p>' ;
echo '<p><button type="submit" id="manager-email-submit" style="display:none;">' . $lang [ 'add' ] . '</button></p>' ;
echo '</form>' ;
2020-12-10 13:09:02 +01:00
} */
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2022-04-28 23:41:35 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
/**
* Seznam vseh uporabnikov znotraj 1 ke
*/
2020-12-10 13:09:02 +01:00
public function allUsersList (){
2020-08-14 13:36:36 +02:00
global $lang ;
global $admin_type ;
2022-03-31 00:26:08 +02:00
echo '<table id="all_users_list" class="usersTable">' ;
2020-12-10 13:09:02 +01:00
echo '<thead><tr>' ;
2022-04-07 01:18:24 +02:00
echo '<th>' . $lang [ 'edit2' ] . '</th>' ;
2020-12-10 13:09:02 +01:00
echo '<th>' . $lang [ 'srv_survey_list_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'admin_type' ] . '</th>' ;
echo '<th>' . $lang [ 'lang' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_aai' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_survey_count' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_survey_archive_count' ] . '</th>' ;
2021-03-02 09:59:52 +01:00
echo '<th>' . $lang [ 'srv_manager_count' ] . '</th>' ;
2021-03-05 13:08:44 +01:00
echo '<th>' . $lang [ 'srv_manager_count_manager' ] . '</th>' ;
2020-12-10 13:09:02 +01:00
echo '<th>' . $lang [ 'users_gdpr_title' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_registred' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_last_login' ] . '</th>' ;
echo '</tr></thead>' ;
echo '</table>' ;
2022-03-31 00:26:08 +02:00
/*/ Dodajanje uporabnikov
2020-12-10 13:09:02 +01:00
echo '<div class="add_user">' ;
2020-08-14 13:36:36 +02:00
2020-12-10 13:09:02 +01:00
// Admin lahko doda novega uporabnika v sistem (brez pregleda)
if ( $admin_type == '0' ){
echo '<fieldset class="new_user"><legend>' . $lang [ 'srv_users_add_new' ] . '</legend>' ;
$this -> dodajNovegaUporabnika ();
echo '</fieldset>' ;
}
2020-08-14 13:36:36 +02:00
2022-03-31 00:26:08 +02:00
echo '</div>' ; */
2020-12-10 13:09:02 +01:00
}
/**
* Osnovni pregled uporabnikov za managerje in admine
*/
public function assignedUsersList (){
global $lang ;
global $admin_type ;
global $global_user_id ;
$sqlU = sisplet_query ( " SELECT name, surname, email FROM users WHERE id=' " . $global_user_id . " ' " );
$rowU = mysqli_fetch_array ( $sqlU );
2020-08-14 13:36:36 +02:00
2022-04-28 23:41:35 +02:00
// Dodajanje uporabnikov
echo '<div class="add_user">' ;
// Manager ali admin lahko doda novega uporabnika pod pregled
$this -> dodeljeniUporabniki ();
echo '</div>' ;
//PREGLED NAD UPORABNIKI - TABELA
2020-08-14 13:36:36 +02:00
2022-04-28 23:41:35 +02:00
// Naslov
/* echo '<h2 style="margin-bottom:30px;">' ;
2020-08-14 13:36:36 +02:00
2020-12-10 13:09:02 +01:00
if ( $admin_type == 0 )
echo $lang [ 'administrator' ];
elseif ( $admin_type == 1 )
echo $lang [ 'manager' ];
else
echo $lang [ 'user' ];
2020-08-14 13:36:36 +02:00
2020-12-10 13:09:02 +01:00
echo ': ' . $rowU [ 'name' ] . ' ' . $rowU [ 'surname' ] . ' (' . $rowU [ 'email' ] . ')' ;
echo ' <a href="#" onclick="edit_user(\'' . $global_user_id . '\'); return false;" title="Uredi"><i class="fa fa-pencil-alt link-moder"></i></a>' ;
2020-08-14 13:36:36 +02:00
2022-04-28 23:41:35 +02:00
echo '</h2>' ; */
2020-08-14 13:36:36 +02:00
2022-04-28 23:41:35 +02:00
echo '<p class="bottom16 caps semi-bold">' . $lang [ 'srv_users_assigned_title' ] . '</p>' ;
2020-12-10 13:09:02 +01:00
// Tabela
2022-03-31 00:26:08 +02:00
echo '<table id="my_users_list" class="usersTable">' ;
2020-12-10 13:09:02 +01:00
echo '<thead><tr>' ;
2022-04-28 23:41:35 +02:00
echo '<th>' . $lang [ 'edit2' ] . '</th>' ;
2020-12-10 13:09:02 +01:00
echo '<th>' . $lang [ 'srv_survey_list_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'admin_type' ] . '</th>' ;
echo '<th>' . $lang [ 'lang' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_aai' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_survey_count' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_survey_archive_count' ] . '</th>' ;
echo '<th>' . $lang [ 'users_gdpr_title' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_registred' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_last_login' ] . '</th>' ;
echo '</tr></thead>' ;
echo '</table>' ;
2020-08-14 13:36:36 +02:00
}
/**
* Seznam vseh izbrisanih uporabnikov znotraj 1 ke
*/
public function deletedUsersList (){
global $lang ;
2022-03-31 00:26:08 +02:00
echo '<table id="deleted_users_list" class="usersTable">' ;
2020-08-14 13:36:36 +02:00
echo '<thead><tr>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'admin_type' ] . '</th>' ;
echo '<th>' . $lang [ 'lang' ] . '</th>' ;
echo '<th>' . $lang [ 'registered' ] . '</th>' ;
echo '</tr></thead>' ;
echo '</table>' ;
}
/**
* Seznam vseh odjavljenih uporabnikov
* V bazi vsi uporabniki , ki so odjavljeni samo pridobijo status 0
*/
public function unsignedUsersList (){
global $lang ;
2022-03-31 00:26:08 +02:00
echo '<table id="unsigned_users_list" class="usersTable">' ;
2020-08-14 13:36:36 +02:00
echo '<thead><tr>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'admin_type' ] . '</th>' ;
echo '<th>' . $lang [ 'lang' ] . '</th>' ;
echo '<th>' . $lang [ 'registered' ] . '</th>' ;
echo '</tr></thead>' ;
echo '</table>' ;
}
/**
* Seznam vseh uporabnikov , ki so prejeli email in ga niso potrdili
*/
public function unconfirmedMailUsersList (){
global $lang ;
echo '<table id="unconfirmed_mail_user_list" class="dataTable">' ;
echo '<thead><tr>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_survey_list_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'admin_type' ] . '</th>' ;
echo '<th>' . $lang [ 'lang' ] . '</th>' ;
echo '<th>' . $lang [ 'registered' ] . '</th>' ;
echo '<th style="width: 90px;">' . $lang [ 'edit2' ] . '</th>' ;
echo '</tr></thead>' ;
echo '</table>' ;
}
/**
* Seznam uporabnikov , ki imajo dostop do SA modula
*/
public function SAuserListIndex (){
global $lang , $global_user_id , $admin_type ;
if ( $admin_type > 0 )
return false ;
$sql_uporabniki = sisplet_query ( " SELECT id, u.name, u.surname, u.email, d.ustanova, d.aai_email, DATE_FORMAT(d.created_at, '%d.%m.%Y - %H:%i') AS created_at, d.updated_at FROM srv_hierarhija_dostop AS d LEFT JOIN users AS u ON u.id=d.user_id ORDER BY u.name " , " obj " );
echo '<a href="#" onclick="dodeliSAdostopUporabniku()">Dodaj uporabniku SA dostop</a><br /><br />' ;
if ( empty ( $sql_uporabniki )){
echo $lang [ 'srv_hierarchy_users_access_no_data' ];
return false ;
}
if ( ! empty ( $sql_uporabniki -> name )) {
$uporabniki [ 0 ] = $sql_uporabniki ;
} else {
$uporabniki = $sql_uporabniki ;
}
echo '<table class="datatables" id="sa-users-table">' ;
echo '<tr>' ;
echo '<th class="text-left">' . $lang [ 'srv_hierarchy_users_name' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_hierarchy_users_email' ] . '</th>' ;
echo '<th>' . $lang [ 'srv_hierarchy_users_organization' ] . '</th>' ;
echo '<th class="text-right">' . $lang [ 'srv_hierarchy_users_created' ] . '</th>' ;
echo '<th></th>' ;
echo '</tr>' ;
foreach ( $uporabniki as $uporabnik ) {
echo '<tr>' ;
echo '<td class="text-left">' . $uporabnik -> name . ' ' . $uporabnik -> surname . '</td>' ;
echo '<td>' . $uporabnik -> email . '</td>' ;
echo '<td>' . $uporabnik -> ustanova . '</td>' ;
echo '<td class="text-right">' . $uporabnik -> created_at . '</td>' ;
echo '<td class="akcija">' ;
echo '<div>' ;
echo '<a href="#" onclick="preveriSAuporabnika(\'' . $uporabnik -> id . '\')">' . $lang [ 'srv_dataIcons_quick_view' ] . '</a>' ;
echo '<a href="#" onclick="urediSAuporabnika(\'' . $uporabnik -> id . '\')">' . $lang [ 'srv_recode_edit' ] . '</a>' ;
echo '<a href="#" onclick="izbrisiSAuporabnika(\'' . $uporabnik -> id . '\')">' . $lang [ 'srv_recode_remove' ] . '</a>' ;
echo '</div>' ;
echo '</td>' ;
echo '</tr>' ;
}
echo '</table>' ;
}
// Prikaz naprednih modulov - NOVO (v urejanje->nastavitve)
function showAdvancedModules (){
global $lang , $site_url , $global_user_id , $admin_type ;
# preberemo osnovne nastavitve
$row = SurveyInfo :: getInstance () -> getSurveyRow ();
# preberemo vklopljene module
$modules = SurveyInfo :: getSurveyModules ();
$disabled = '' ;
$css_disabled = '' ;
if ( isset ( $modules [ 'slideshow' ])){
$disabled = ' disabled="disabled"' ;
$css_disabled = ' gray' ;
}
if ( $_GET [ 'a' ] == 'uporabnost' ){
2022-04-14 18:06:01 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_uporabnost' ] . Help :: display ( 'srv_evalvacija_strani' ) . '</legend>' ;
2022-01-20 15:20:13 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vrsta_survey_note_4_3' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_uporabnost" name="uporabnost" value="1"' . ( isset ( $modules [ 'uporabnost' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'uporabnost\');" />' ;
echo '<label for="advanced_module_uporabnost">' . $lang [ 'srv_vrsta_survey_note_4_3a' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'uporabnost' ])){
$this -> uporabnost ();
}
echo '</div>' ;
}
elseif (( $_GET [ 'a' ] == A_HIERARHIJA_SUPERADMIN ) && Hierarhija\HierarhijaHelper :: preveriDostop ( $this -> anketa )){
// Blok za vklop in izklop hierarhije skrijemo, če je hierarhija aktivna
if ( ! SurveyInfo :: getInstance () -> checkSurveyModule ( 'hierarhija' )) {
echo '<fieldset><legend>' . $lang [ 'srv_hierarchy' ] . '</legend>' ;
echo '<i class="' . $css_disabled . '">' . $lang [ 'srv_hierarchy_description' ] . '</i>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_hierarhija" name="hierarhija" value="1"' . ( isset ( $modules [ 'hierarhija' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="preveriAnketoZaHierarhijo(' . $this -> anketa . ');" />' ;
echo $lang [ 'srv_hierarchy_on' ] . '</label>' ;
echo '<div id="hierarhija-opcije-vklopa">' ;
echo '<h4>' . $lang [ 'srv_hierarchy_intro_select_title' ] . ':</h4>' ;
echo '<div id="error"></div>' ;
echo '<label class="strong' . $css_disabled . '"><input type="radio" id="obstojeca-anketa" name="izberi-anketo" value="obstojeca" checked="checked"/>' . $lang [ 'srv_hierarchy_intro_option_current' ] . '</label>' ;
echo '<label class="strong' . $css_disabled . '"><input type="radio" id="prevzeta-anketa" name="izberi-anketo" onclick="pridobiKnjiznicoZaHierarhijo(\'privzeta\')" value="prevzeta" />' . $lang [ 'srv_hierarchy_intro_option_default' ] . ' <span id="hierarhija-prevzeta"></span></label>' ;
echo '<label class="strong' . $css_disabled . '"><input type="radio" name="izberi-anketo" value="knjiznica" onclick="pridobiKnjiznicoZaHierarhijo(\'vse\')"/>' . $lang [ 'srv_hierarchy_intro_option_library' ] . '</label>' ;
echo '<div id="hierarhija-knjiznica">' ;
echo '</div>' ;
echo '<span class="floatLeft spaceRight" style="padding:15px 0;"><div class="buttonwrapper">' ;
echo ' < a class = " ovalbutton ovalbutton_orange " href = " # " onclick = " potrdiIzbiroAnkete(); return false; " style = " padding-right: 5px;>
< span style = " color:#fff; " > Vklopi modul </ span >
</ a > ' ;
echo '</div></span>' ;
echo '</div>' ;
echo '</fieldset>' ;
echo '<div id="globalSettingsInner" style="padding-top: 15px;">' ;
echo '</div>' ;
} else {
$hierarhija = new \Hierarhija\Hierarhija ( $this -> anketa );
echo '<div id="hierarhija-container">' ;
echo '<div style="width:586px;">' ;
$hierarhija -> displayHierarhijaNavigationSuperAdmin ();
echo '</div>' ;
echo '<div id="globalSettingsInner" style="padding-top: 15px;">' ;
if ( $_GET [ 'm' ] == M_ADMIN_UREDI_SIFRANTE ){
$hierarhija -> hierarhijaSuperadminSifranti ();
} elseif ( $_GET [ 'm' ] == M_ADMIN_UVOZ_SIFRANTOV ){
$hierarhija -> hierarhijaSuperadminUvoz ();
} elseif ( $_GET [ 'm' ] == M_ADMIN_UPLOAD_LOGO ){
$hierarhija -> hierarhijaSuperadminUploadLogo ();
} elseif ( $_GET [ 'm' ] == M_ADMIN_IZVOZ_SIFRANTOV ){
$hierarhija -> izvozSifrantov ();
} elseif ( $_GET [ 'm' ] == M_ANALIZE ){
if ( $_GET [ 'r' ] == 'custom' ){
$HC = new \Hierarhija\HierarhijaPorocilaClass ( $this -> anketa );
$HC -> izvoz ();
} else {
$HA = new HierarhijaAnalysis ( $this -> anketa );
$HA -> Display ();
}
} elseif ( $_GET [ 'm' ] == M_HIERARHIJA_STATUS ){
if ( $_GET [ 'izvoz' ] == 'status' ){
// Izvoz tabele status
\Hierarhija\HierarhijaIzvoz :: getInstance ( $this -> anketa ) -> csvIzvozStatusa ();
} else {
$hierarhija -> statistikaHierjearhije ();
}
} elseif ( $_GET [ 'm' ] == M_ADMIN_AKTIVACIJA ){
$hierarhija -> aktivacijaHierarhijeInAnkete ();
} elseif ( $_GET [ 'm' ] == M_ADMIN_KOPIRANJE ){
$hierarhija -> kopiranjeHierarhijeInAnkete ();
} elseif ( $_GET [ 'm' ] == M_UREDI_UPORABNIKE && $_GET [ 'izvoz' ] == 1 ) {
// za vse ostalo je ure uredi uporabnike - M_UREDI_UPORABNIKE
\Hierarhija\HierarhijaIzvoz :: getInstance ( $this -> anketa ) -> csvIzvozVsehUporabnikov ();
} elseif ( $_GET [ 'm' ] == M_UREDI_UPORABNIKE && $_GET [ 'izvoz' ] == 'struktura-analiz' ) {
// za vse ostalo je uredi uporabnike - M_UREDI_UPORABNIKE
if ( ! empty ( $_GET [ 'n' ]) && $_GET [ 'n' ] == 1 ){
\Hierarhija\HierarhijaIzvoz :: getInstance ( $this -> anketa ) -> csvIzvozStruktureZaObdelavo ( false , true );
} else {
\Hierarhija\HierarhijaIzvoz :: getInstance ( $this -> anketa ) -> csvIzvozStruktureZaObdelavo ();
}
} else {
$hierarhija -> izberiDodajanjeUporabnikovNaHierarhijo ();
}
echo '</div>' ;
echo '</div>' ;
}
}
elseif ( $_GET [ 'a' ] == 'kviz' ){
echo '<fieldset><legend>' . $lang [ 'srv_kviz' ] . '</legend>' ;
2022-01-20 13:13:05 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vrsta_survey_note_6_4' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_quiz" name="quiz" value="1" ' . ( isset ( $modules [ 'quiz' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'quiz\');" />' ;
echo '<label for="advanced_module_quiz">' . $lang [ 'srv_vrsta_survey_note_6_4a' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'quiz' ])){
$sq = new SurveyQuiz ( $this -> anketa );
$sq -> displaySettings ();
}
echo '</div>' ;
}
2021-03-10 11:24:00 +01:00
elseif ( $_GET [ 'a' ] == 'voting' ){
2021-03-16 10:11:08 +01:00
// Ce so vabila ze vklopljena ne pustimo vklopa
2021-03-19 13:29:58 +01:00
if ( isset ( $modules [ 'voting' ]) || ( ! isset ( $modules [ 'voting' ]) && SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' ))){
2021-03-16 10:11:08 +01:00
$disabled = ' disabled="disabled"' ;
$css_disabled = ' gray' ;
}
2021-03-10 11:24:00 +01:00
echo '<fieldset><legend>' . $lang [ 'srv_voting' ] . '</legend>' ;
2021-04-27 10:24:39 +02:00
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_voting" name="voting" value="1" ' . ( isset ( $modules [ 'voting' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'voting\');" />' ;
2021-03-10 11:24:00 +01:00
echo $lang [ 'srv_vrsta_survey_type_18' ] . '</label>' ;
2021-04-27 10:24:39 +02:00
echo '<br><i>' . $lang [ 'srv_voting_info' ] . '</i>' ;
// Opozorilo, da so vabila ze vklopljena in zato modula ni mogoce vklopiti
if ( ! isset ( $modules [ 'voting' ]) && SurveyInfo :: getInstance () -> checkSurveyModule ( 'email' )){
echo '<br><br><i class="red bold">' . $lang [ 'srv_voting_info_error' ] . '</i><br>' ;
}
echo '</fieldset>' ;
2021-03-10 11:24:00 +01:00
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'voting' ])){
$sv = new SurveyVoting ( $this -> anketa );
$sv -> displaySettings ();
}
echo '</div>' ;
}
2020-08-14 13:36:36 +02:00
elseif ( $_GET [ 'a' ] == 'advanced_paradata' ){
echo '<fieldset><legend>' . $lang [ 'srv_advanced_paradata' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_advanced_paradata" name="advanced_paradata" value="1" ' . ( isset ( $modules [ 'advanced_paradata' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'advanced_paradata\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_16' ] . '</label>' ;
//echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_6_4'].'</i>';
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'advanced_paradata' ])){
$sap = new SurveyAdvancedParadata ( $this -> anketa );
$sap -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'json_survey_export' ){
echo '<fieldset><legend>' . $lang [ 'srv_json_survey_export' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_srv_json_survey_export" name="srv_json_survey_export" value="1" ' . ( isset ( $modules [ 'srv_json_survey_export' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'srv_json_survey_export\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_17' ] . '</label>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'srv_json_survey_export' ])){
$sjs = new SurveyJsonSurveyData ( $this -> anketa );
$sjs -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'slideshow' ){
echo '<fieldset><legend>' . $lang [ 'srv_slideshow_fieldset_label' ] . '</legend>' ;
echo '<label class="strong"><input type="checkbox" id="advanced_module_slideshow" name="slideshow" value="1" ' . ( isset ( $modules [ 'slideshow' ]) ? ' checked="checked"' : '' ) . ' onChange="toggleAdvancedModule(\'slideshow\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_9' ] . '</label>' ;
echo '<br/><i>' . $lang [ 'srv_vrsta_survey_note_9_2' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'slideshow' ])){
$ss = new SurveySlideshow ( $this -> anketa );
$ss -> ShowSlideshowSetings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'vnos' ) {
echo '<fieldset><legend>' . $lang [ 'srv_vnos' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_user_from_cms" name="user_from_cms" value="2" ' . (( $row [ 'user_from_cms' ] == 2 && $row [ 'cookie' ] == - 1 ) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'user_from_cms\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_5' ] . '</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_5_3' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( $row [ 'user_from_cms' ] == 2 && $row [ 'cookie' ] == - 1 ){
$this -> vnos ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_TELEPHONE ){
2022-04-07 19:01:52 +02:00
echo '<div class="phone_settings_top" id="globalSettingsInner">' ;
if ( isset ( $modules [ 'phone' ])){
$ST = new SurveyTelephone ( $this -> anketa );
$ST -> action ( $_GET [ 'm' ]);
}
echo '</div>' ;
2022-04-07 23:26:41 +02:00
$hide_tel_fieldset = '' ;
if ( $_GET [ 'm' ] == 'recipients_lists' ) {
$hide_tel_fieldset = 'displayNone' ;
}
2020-08-14 13:36:36 +02:00
// Ce je anketar ne vidi teh nastavitev
$isAnketar = Common :: isUserAnketar ( $this -> anketa , $global_user_id );
if ( ! $isAnketar ){
if ( isset ( $modules [ 'phone' ])){
$sqlT = sisplet_query ( " SELECT count(*) AS cnt FROM srv_invitations_recipients WHERE ank_id=' $this->anketa ' AND deleted='0' AND phone!='' " );
$rowT = mysqli_fetch_array ( $sqlT );
// Ce se nimamo nobene stevilke v bazi, pustimo da se lahko ugasne
if ( $rowT [ 'cnt' ] == 0 ){
2022-04-07 23:26:41 +02:00
echo '<fieldset class="' . $hide_tel_fieldset . '"><legend>' . $lang [ 'srv_vrsta_survey_type_7' ] . ' ' . Help :: display ( 'srv_telephone_help' ) . '</legend>' ;
2022-04-07 19:01:52 +02:00
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_phone" name="phone" value="1" ' . ( isset ( $modules [ 'phone' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'phone\');" />' ;
echo '<label for="advanced_module_phone" class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_type_7' ] . '</label>' ;
echo '</div>' ;
echo '<p class="top16 ' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_7_3' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
2022-04-07 23:26:41 +02:00
/* else {
2020-08-14 13:36:36 +02:00
echo '<span class="blue" style="font-size:14px; font-weight:600;">' . $lang [ 'srv_vrsta_survey_type_7' ] . '</span> ' . Help :: display ( 'srv_telephone_help' );
echo '<br />' ;
2022-04-07 23:26:41 +02:00
} */
2020-08-14 13:36:36 +02:00
}
else {
2022-04-07 23:26:41 +02:00
echo '<fieldset class="' . $hide_tel_fieldset . '"><legend>' . $lang [ 'srv_vrsta_survey_type_7' ] . ' ' . Help :: display ( 'srv_telephone_help' ) . '</legend>' ;
2022-04-07 19:01:52 +02:00
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_phone" name="phone" value="1" ' . ( isset ( $modules [ 'phone' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'phone\');" />' ;
echo '<label for="advanced_module_phone" class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_type_7' ] . '</label>' ;
echo '</div>' ;
echo '<p class="top16 ' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_7_3' ] . '</p>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
}
}
}
elseif ( $_GET [ 'a' ] == A_CHAT ){
global $site_path ;
echo '<fieldset><legend>' . $lang [ 'srv_vrsta_survey_type_14' ] . '</legend>' ;
2022-01-19 19:20:22 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vrsta_survey_note_14_1' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_chat" name="chat" value="1" ' . ( isset ( $modules [ 'chat' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'chat\');" />' ;
echo '<label for="advanced_module_chat">' . $lang [ 'srv_vrsta_survey_note_14_1b' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'chat' ])){
$sc = new SurveyChat ( $this -> anketa );
$sc -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_PANEL ){
global $site_path ;
echo '<fieldset><legend>' . $lang [ 'srv_vrsta_survey_type_15' ] . '</legend>' ;
2022-01-19 18:53:16 +01:00
echo '<p>' . $lang [ 'srv_vrsta_survey_note_15_1' ] . '</p>' ;
echo '<p class="top16 bottom16">' . $lang [ 'srv_vrsta_survey_note_15_1a' ] . '</p>' ;
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" id="advanced_module_panel" name="panel" value="1" ' . ( isset ( $modules [ 'panel' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'panel\');" />' ;
echo '<label for="advanced_module_panel">' . $lang [ 'srv_vrsta_survey_note_15_1b' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'panel' ])){
$sp = new SurveyPanel ( $this -> anketa );
$sp -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_FIELDWORK ){
global $site_path ;
// tole bom dopolnil po potrebi
//
// Ce je anketar ne vidi teh nastavitev
$isAnketar = Common :: isUserAnketar ( $this -> anketa , $global_user_id );
if ( ! $isAnketar ){
// tole bom dopo
}
echo '<div id="globalSettingsInner">' ;
$ST = new SurveyFieldwork ( $this -> anketa );
$ST -> action ( $_GET [ 'm' ]);
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_MAZA ){
global $site_path ;
echo '<fieldset><legend>' . $lang [ 'srv_maza' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_maza" name="maza" value="1" ' . ( isset ( $modules [ 'maza' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'maza\');maza_on_off();" />' ;
echo $lang [ 'srv_maza' ] . '</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_maza_note' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'maza' ])){
$MS = new MAZA ( $this -> anketa );
$MS -> display ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_WPN ){
global $site_path ;
echo '<fieldset><legend>' . $lang [ 'srv_wpn' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_wpn" name="wpn" value="1" ' . ( isset ( $modules [ 'wpn' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'wpn\');" />' ;
echo $lang [ 'srv_wpn' ] . '</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_wpn_note' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'wpn' ])){
$MS = new WPN ( $this -> anketa );
$MS -> display ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'social_network' ){
if ( $_GET [ 'm' ] == 'respondenti' || $_GET [ 'm' ] == " " ) {
echo '<fieldset><legend>' . $lang [ 'srv_vrsta_survey_type_8' ] . '</legend>' ;
2022-01-20 13:53:57 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_vrsta_survey_note_8_3' ] . '</p>' ;
echo '<div class="setting_holder bottom0">' ;
echo '<input type="checkbox" id="advanced_module_social_network" name="social_network" value="1" ' . ( isset ( $modules [ 'social_network' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'social_network\');" />' ;
echo '<label for="advanced_module_social_network">' . $lang [ 'srv_vrsta_survey_note_8_3a' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'social_network' ])){
$this -> SN_Settings ();
}
echo '</div>' ;
2022-01-20 13:53:57 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
}
}
elseif ( $_GET [ 'a' ] == A_360 ){
echo '<fieldset><legend>' . $lang [ 'srv_vrsta_survey_type_11' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_360_stopinj" name="360_stopinj" value="1" ' . ( isset ( $modules [ '360_stopinj' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'360_stopinj\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_11' ] . '</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_11_1' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ '360_stopinj' ])){
$S360 = new Survey360 ( $this -> anketa );
$S360 -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == A_360_1KA ){
echo '<fieldset><legend>' . $lang [ 'srv_vrsta_survey_type_12' ] . '</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_360_stopinj_1ka" name="360_stopinj_1ka" value="1" ' . ( isset ( $modules [ '360_stopinj_1ka' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'360_stopinj_1ka\');" />' ;
echo $lang [ 'srv_vrsta_survey_type_12' ] . '</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_12_1' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ '360_stopinj_1ka' ])){
$S360 = new Survey3601ka ( $this -> anketa );
$S360 -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli' ){
echo '<fieldset><legend>Evoli</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli" name="evoli" value="1" ' . ( isset ( $modules [ 'evoli' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli\');" />' ;
echo 'Evoli</label>' ;
echo '<br/><i class="' . $css_disabled . '">Napredna poročila Evoli</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli_teammeter' ){
echo '<fieldset><legend>Evoli team meter</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli_teammeter" name="evoli_teammeter" value="1" ' . ( isset ( $modules [ 'evoli_teammeter' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli_teammeter\');" />' ;
echo 'Evoli team meter</label>' ;
echo '<br /><i class="' . $css_disabled . '">Napredna poročila Evoli team meter</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ 'evoli_teammeter' ])){
$evoliTM = new SurveyTeamMeter ( $this -> anketa );
$evoliTM -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli_quality_climate' ){
echo '<fieldset><legend>Evoli quality climate</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli_quality_climate" name="evoli_quality_climate" value="1" ' . ( isset ( $modules [ 'evoli_quality_climate' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli_quality_climate\');" />' ;
echo 'Evoli quality climate</label>' ;
echo '<br /><i class="' . $css_disabled . '">Napredna poročila Evoli quality climate</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ 'evoli_quality_climate' ])){
$evoliTM = new SurveyTeamMeter ( $this -> anketa );
$evoliTM -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli_teamship_meter' ){
echo '<fieldset><legend>Evoli teamship meter</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli_teamship_meter" name="evoli_teamship_meter" value="1" ' . ( isset ( $modules [ 'evoli_teamship_meter' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli_teamship_meter\');" />' ;
echo 'Evoli teamship meter</label>' ;
echo '<br /><i class="' . $css_disabled . '">Napredna poročila Evoli teamship meter</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ 'evoli_teamship_meter' ])){
$evoliTM = new SurveyTeamMeter ( $this -> anketa );
$evoliTM -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli_organizational_employeeship_meter' ){
echo '<fieldset><legend>Evoli organizational employeeship meter</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli_organizational_employeeship_meter" name="evoli_organizational_employeeship_meter" value="1" ' . ( isset ( $modules [ 'evoli_organizational_employeeship_meter' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli_organizational_employeeship_meter\');" />' ;
echo 'Evoli organizational employeeship meter</label>' ;
echo '<br /><i class="' . $css_disabled . '">Napredna poročila Evoli organizational employeeship meter</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
// urejanje respondentov
if ( isset ( $modules [ 'evoli_organizational_employeeship_meter' ])){
$evoliTM = new SurveyTeamMeter ( $this -> anketa );
$evoliTM -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'evoli_employmeter' ){
echo '<fieldset><legend>Evoli employ meter</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_evoli_employmeter" name="evoli_employmeter" value="1" ' . ( isset ( $modules [ 'evoli_employmeter' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'evoli_employmeter\');" />' ;
echo 'Evoli employeeship meter</label>' ;
echo '<br /><i class="' . $css_disabled . '">Napredna poročila Evoli employeeship meter</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'mfdps' ){
echo '<fieldset><legend>MFDPŠ</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_mfdps" name="mfdps" value="1" ' . ( isset ( $modules [ 'mfdps' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'mfdps\');" />' ;
echo 'MFDPŠ</label>' ;
echo '<br/><i class="' . $css_disabled . '">Napredni izvozi MFDPŠ</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'borza' ){
echo '<fieldset><legend>Borza</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_borza" name="borza" value="1" ' . ( isset ( $modules [ 'borza' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'borza\');" />' ;
echo 'Borza</label>' ;
echo '<br/><i class="' . $css_disabled . '">Napredni izvozi Borza</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'mju' ){
echo '<fieldset><legend>MJU</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_mju" name="mju" value="1" ' . ( isset ( $modules [ 'mju' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'mju\');" />' ;
echo 'MJU</label>' ;
echo '<br/><i class="' . $css_disabled . '">Napredni izvozi MJU</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
if ( isset ( $modules [ 'mju' ])){
$sme = new SurveyMJUEnote ( $this -> anketa );
$sme -> displaySettings ();
}
echo '</div>' ;
}
elseif ( $_GET [ 'a' ] == 'excell_matrix' ){
echo '<fieldset><legend>Excelleration matrix</legend>' ;
echo '<label class="strong' . $css_disabled . '"><input type="checkbox" id="advanced_module_excell_matrix" name="excell_matrix" value="1" ' . ( isset ( $modules [ 'excell_matrix' ]) ? ' checked="checked"' : '' ) . $disabled . ' onChange="toggleAdvancedModule(\'excell_matrix\');" />' ;
echo 'Excelleration matrix</label>' ;
echo '<br/><i class="' . $css_disabled . '">' . $lang [ 'srv_vrsta_survey_note_16_1' ] . '</i>' ;
echo '</fieldset>' ;
echo '<br />' ;
echo '<div id="globalSettingsInner">' ;
echo '</div>' ;
}
}
function formatNumber ( $value , $digit = 0 , $form = null ) {
# Kako izpisujemo decimalke in tisočice
$default_seperators = array ( 0 => array ( 'decimal_point' => '.' , 'thousands' => ',' ),
1 => array ( 'decimal_point' => ',' , 'thousands' => '.' ));
if ( is_array ( $form ) && isset ( $form [ 'decimal_point' ]) && isset ( $form [ 'thousands' ])) {
$decimal_point = $form [ 'decimal_point' ];
$thousands = $form [ 'thousands' ];
} else {
$decimal_point = $default_seperators [ 'decimal_point' ];
$thousands = $default_seperators [ 'thousands' ];
}
if ( $value <> 0 && $value != null )
$result = round ( $value , $digit );
else
$result = " 0 " ;
$result = number_format ( $result , $digit , $decimal_point , $thousands );
return $result ;
}
function globalUserSettings () {
2021-12-22 16:42:29 +01:00
global $lang , $global_user_id , $admin_type , $site_url ;
$preklici_url = ltrim ( str_replace ( " &s=1 " , " " , $_SERVER [ 'REQUEST_URI' ]), " / " );
$preklici_url = " ' " . $site_url . $preklici_url . " ' " ;
2020-08-14 13:36:36 +02:00
# polovimo nastavitve uporabnika
UserSetting :: getInstance () -> Init ( $global_user_id );
# ali zaklepamo anketo ob aktivaciji
$lockSurvey = UserSetting :: getInstance () -> getUserSetting ( 'lockSurvey' );
# ali je anketa aktivna ob aktivaciji
$autoActiveSurvey = UserSetting :: getInstance () -> getUserSetting ( 'autoActiveSurvey' );
# ali imamo star napreden vmesnik za moje ankete
$advancedMySurveys = UserSetting :: getInstance () -> getUserSetting ( 'advancedMySurveys' );
# ali imamo gumb za enklik kreiranje ankete
$oneclickCreateMySurveys = UserSetting :: getInstance () -> getUserSetting ( 'oneclickCreateMySurveys' );
# ali so komentarji aktivirani ob kreaciji ankete
$activeComments = UserSetting :: getInstance () -> getUserSetting ( 'activeComments' );
# uvod ob aktivaciji
$showIntro = UserSetting :: getInstance () -> getUserSetting ( 'showIntro' );
# zakljucek ob aktivaciji
$showConcl = UserSetting :: getInstance () -> getUserSetting ( 'showConcl' );
# ime za respondente ob aktivaciji
$showSurveyTitle = UserSetting :: getInstance () -> getUserSetting ( 'showSurveyTitle' );
# Prikaži bližnico za jezik v statusni vrstici
$showLanguageShortcut = UserSetting :: getInstance () -> getUserSetting ( 'showLanguageShortcut' );
echo '<div id="anketa_edit">' ;
echo '<form name="settingsanketa" action="ajax.php?a=editanketasettings&m=global_user_settings" method="post" autocomplete="off">' . " \n \r " ;
//echo ' <input type="hidden" name="anketa" value="' . $this->anketa . '" />' . "\n\r";
//echo ' <input type="hidden" name="grupa" value="' . $this->grupa . '" />' . "\n\r";
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
echo '<fieldset><legend>' . $lang [ 'srv_interface_settings' ] . '</legend>' ;
// Jezik vmesnika
$sql = sisplet_query ( " SELECT lang FROM users WHERE id = ' $global_user_id ' " );
$row = mysqli_fetch_array ( $sql );
$lang_admin = $row [ 'lang' ];
2021-12-22 16:42:29 +01:00
echo '<div class="setting_holder">' ;
echo '<label for="language">' . $lang [ 'lang' ] . ':</label><select class="dropdown large" name="language" id="language">' ;
2020-08-14 13:36:36 +02:00
echo '<option value="1"' . ( $lang_admin == 1 ? ' selected' : '' ) . '>Slovenščina</option>' ;
echo '<option value="2"' . ( $lang_admin == 2 ? ' selected' : '' ) . '>English</option>' ;
echo '</select>' ;
2021-12-22 16:42:29 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-22 16:42:29 +01:00
echo '<div class="setting_holder">' ;
2021-12-22 19:10:49 +01:00
echo '<span class="setting_title">' . $lang [ 'srv_settings_interfaceshow' ] . ':</span>' ;
2022-05-02 08:25:18 +02:00
// Prikaži ikono za jezik v navigacijski vrstici ankete, desno zgoraj - TE NASTAVITVE NE UPOSTEVAMO VEC
/* echo '<div class="setting_item">' ;
2021-12-22 16:42:29 +01:00
echo '<input name="showLanguageShortcut" type="hidden" value="0">' ;
echo '<input id="showLanguageShortcut" name="showLanguageShortcut" type="checkbox" value="1" ' . ( $showLanguageShortcut == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="showLanguageShortcut">' . $lang [ 'srv_settings_language_shortcut' ] . '</label>' ;
2022-05-02 08:25:18 +02:00
echo '</div>' ; */
2020-08-14 13:36:36 +02:00
// Opcija enklik ustvarjanja ankete (v mojih anketah)
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="oneclickCreateMySurveys" type="hidden" value="0">' ;
2021-12-22 16:42:29 +01:00
echo '<input id="oneclickCreateMySurveys" name="oneclickCreateMySurveys" type="checkbox" value="1" ' . ( $oneclickCreateMySurveys == 1 ? ' checked="checked"' : '' ) . '>' ;
2022-04-14 18:06:01 +02:00
echo '<label for="oneclickCreateMySurveys">' . $lang [ 'srv_settings_oneClickCreate' ] . Help :: display ( 'srv_nastavitve_enklik' ) . '</label>' ;
2021-12-22 16:42:29 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-22 19:10:49 +01:00
// Možnost prikaza SA ikone pri vseh anketah
2020-08-14 13:36:36 +02:00
if ( $admin_type < 3 ) {
$showSAicon = UserSetting :: getInstance () -> getUserSetting ( 'showSAicon' );
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2021-12-22 16:42:29 +01:00
echo '<input name="showSAicon" type="hidden" value="0">' ;
echo '<input id="showSAicon" name="showSAicon" type="checkbox" value="1" ' . ( $showSAicon == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="showSAicon">' . $lang [ 'srv_settings_showSAicon' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-22 19:10:49 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '<fieldset><legend>' . $lang [ 'srv_survey_settings' ] . '</legend>' ;
2021-12-22 16:42:29 +01:00
2021-12-22 19:10:49 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_settings_oncreation' ] . ':</span>' ;
2020-08-14 13:36:36 +02:00
// Aktivna anketa ob aktivaciji - TO PUSTIMO SAMO ADMINOM ZARADI GDPR OPOZORILA OB AKTIVACIJI
if ( $admin_type == '0' ){
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="autoActiveSurvey" type="hidden" value="0">' ;
2021-12-22 16:42:29 +01:00
echo '<input id="autoActiveSurvey" name="autoActiveSurvey" type="checkbox" value="1" ' . ( $autoActiveSurvey == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="autoActiveSurvey">' . $lang [ 'srv_settings_autoActiveSurvey' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// Komentarji aktivirani ob kreaciji ankete
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="activeComments" type="hidden" value="0">' ;
2021-12-22 16:42:29 +01:00
echo '<input id="activeComments" name="activeComments" type="checkbox" value="1" ' . ( $activeComments == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="activeComments">' . $lang [ 'srv_settings_activeComments' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Uvod ob aktivaciji prikazan
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="showIntro" type="hidden" value="0">' ;
2021-12-22 16:42:29 +01:00
echo '<input id="showIntro" name="showIntro" type="checkbox" value="1" ' . ( $showIntro == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="showIntro">' . $lang [ 'srv_create_show_intro' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Zakljucek ob aktivaciji prikazan
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="showConcl" type="hidden" value="0">' ;
2021-12-22 16:42:29 +01:00
echo '<input id="showConcl" name="showConcl" type="checkbox" value="1" ' . ( $showConcl == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="showConcl">' . $lang [ 'srv_create_show_concl' ] . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Ime ob aktivaciji prikazano za respondente
2021-12-22 19:10:49 +01:00
echo '<div class="setting_item">' ;
2020-08-14 13:36:36 +02:00
echo '<input name="showSurveyTitle" type="hidden" value="0">' ;
2022-05-02 08:25:18 +02:00
echo '<input id="showSurveyTitle" name="showSurveyTitle" type="checkbox" value="1" ' . ( $showSurveyTitle == 1 ? ' checked="checked"' : '' ) . '>' ;
echo '<label for="showSurveyTitle">' . $lang [ 'srv_create_show_title' ] . '</label>' ;
2021-12-22 16:42:29 +01:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-12-22 19:10:49 +01:00
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_settings_onactivation' ] . ':</span>' ;
// Zaklep urejanja ob aktivaciji
echo '<div class="setting_item">' ;
echo '<input name="lockSurvey" type="hidden" value="0">' ;
echo '<input name="lockSurvey" id="lockSurvey" type="checkbox" value="1" ' . ( $lockSurvey == 1 ? ' checked="checked"' : '' ) . '>' ;
2022-04-14 18:06:01 +02:00
echo '<label for="lockSurvey">' . $lang [ 'srv_lock_survey_when_activate' ] . Help :: display ( 'srv_nastavitve_zakleni' ) . '</label>' ;
2021-12-22 19:10:49 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
echo '</form>' ;
// API avtentikacija
2022-04-14 18:06:01 +02:00
echo '<fieldset><legend>' . $lang [ 'srv_api' ] . Help :: display ( 'srv_nastavitve_API' ) . '</legend>' ;
2021-12-22 16:42:29 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_api_auth' ] . ':</p>' ;
echo '<div class="button_holder bottom16">' ;
echo '<button type="button" class="medium white-black" onClick="generate_API_key(); return false;">' . $lang [ 'srv_api_auth2' ] . '</button>' ;
echo '</div>' ;
2021-05-25 10:00:19 +02:00
echo $lang [ 'additional_info_api' ];
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
// save gumb
2021-12-22 16:42:29 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="document.settingsanketa.submit();">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// div za prikaz uspešnosti shranjevanja
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2020-08-14 13:36:36 +02:00
}
echo '</div>' ;
}
function globalUserMyProfile () {
2021-09-29 10:37:17 +02:00
global $lang , $global_user_id , $admin_type , $site_domain , $site_url ;
2020-08-14 13:36:36 +02:00
// podatki prijavljenega uporabnika
$sql = sisplet_query ( " SELECT id, name, surname, email, type, gdpr_agree, last_login FROM users WHERE id = ' $global_user_id ' " );
$row = mysqli_fetch_array ( $sql );
echo '<div id="anketa_edit">' ;
echo ' <form name="settingsanketa" id="form_profile_user_settings" action="ajax.php?a=editanketasettings&m=global_user_myProfile" method="post" autocomplete="off">' . " \n \r " ;
echo ' <input type="hidden" name="location" value="' . $_GET [ 'a' ] . '" />' . " \n \r " ;
echo ' <input type="hidden" name="submited" value="1" />' . " \n \r " ;
2021-12-29 01:23:24 +01:00
echo '<fieldset><legend>' . $lang [ 'edit_data' ] . '</legend>' ;
//Prijavljeni kot, status, zadnja prijava, aktivni paket
2022-01-26 12:04:16 +01:00
echo '<div id="user_info_segment" class="bottom0">' ;
2021-12-29 01:23:24 +01:00
2020-08-14 13:36:36 +02:00
if ( $row [ 'type' ] == '0' )
$type = $lang [ 'admin_admin' ];
elseif ( $row [ 'type' ] == '1' )
$type = $lang [ 'admin_manager' ];
else
$type = $lang [ 'admin_narocnik' ];
2021-12-29 01:23:24 +01:00
echo '<div class="user_info text">' ;
echo '<div class="setting_holder">' . $lang [ 'logged_in_as' ] . ':</div>' ;
echo '<div class="setting_holder">' . $lang [ 'your_status' ] . ':</div>' ;
echo '<div class="setting_holder">' . $lang [ 'srv_last_login' ] . ':</div>' ;
if ( AppSettings :: getInstance () -> getSetting ( 'app_settings-commercial_packages' ) === true )
echo '<div class="setting_holder">' . $lang [ 'srv_access_package' ] . ':</div>' ;
echo '</div>' ;
echo '<div class="user_info data bold">' ;
echo '<div class="setting_holder">' . $row [ 'name' ] . ' ' . $row [ 'surname' ] . '</div>' ;
echo '<div class="setting_holder">' . $type . '</div>' ;
echo '<div class="setting_holder">' . date ( 'j.n.Y' , strtotime ( $row [ 'last_login' ])) . ' ' . $lang [ 'ob' ] . ' ' . date ( 'H:i' , strtotime ( $row [ 'last_login' ])) . '</div>' ;
// Trenutni paket funkcionalnosti
2021-09-29 10:37:17 +02:00
if ( AppSettings :: getInstance () -> getSetting ( 'app_settings-commercial_packages' ) === true ){
2020-08-14 13:36:36 +02:00
$sqlA = sisplet_query ( " SELECT ua.time_activate, ua.time_expire, uap.id AS package_id, uap.name AS package_name
FROM user_access ua , user_access_paket uap
WHERE ua . usr_id = '$global_user_id' AND uap . id = ua . package_id
" );
$drupal_url = ( $lang [ 'id' ] == '2' ) ? $site_url . 'd/en/' : $site_url . 'd/' ;
2022-01-06 09:43:40 +01:00
2022-01-05 22:44:56 +01:00
2020-08-14 13:36:36 +02:00
// Ni nobenega paketa
2021-12-29 01:23:24 +01:00
if ( mysqli_num_rows ( $sqlA ) == 0 ){
2022-01-03 15:30:44 +01:00
$package_string = $lang [ 'paket_opis_1ka' ] . ' (' . $lang [ 'srv_access_package_free' ] . ')</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\'' . $drupal_url . '' . $lang [ 'srv_narocila_buyurl' ] . '\';">' . $lang [ 'srv_narocila_buy' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
}
else {
$rowA = mysqli_fetch_array ( $sqlA );
2022-01-06 09:43:40 +01:00
$userAccess = UserAccess :: getInstance ( $global_user_id );
$package_name = $userAccess -> getPackageName ( $rowA [ 'package_id' ]);
2020-08-14 13:36:36 +02:00
// Ce ima paket 2 ali 3
2021-12-29 01:23:24 +01:00
if ( $rowA [ 'package_id' ] == '2' || $rowA [ 'package_id' ] == '3' ){
2020-08-14 13:36:36 +02:00
// Ce je paket ze potekel
2021-12-29 01:23:24 +01:00
if ( strtotime ( $rowA [ 'time_expire' ]) < time ()){
2020-08-14 13:36:36 +02:00
2022-01-04 01:47:46 +01:00
$package_string = '<span>' ;
2022-01-06 09:43:40 +01:00
$package_string .= $package_name ;
2020-08-14 13:36:36 +02:00
$package_string .= ' (' . $lang [ 'srv_access_package_expire' ] . ' ' . date ( " d.m.Y " , strtotime ( $rowA [ 'time_expire' ])) . ')' ;
$package_string .= '</span>' ;
2021-12-29 01:23:24 +01:00
2022-01-04 01:47:46 +01:00
$package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\'' . $drupal_url . 'izvedi-nakup/' . $rowA [ 'package_id' ] . '/podatki/\';">' . $lang [ 'srv_narocila_extend' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-01-06 09:43:40 +01:00
$package_string = $package_name ;
2020-08-14 13:36:36 +02:00
$package_string .= ' (' . $lang [ 'srv_access_package_valid' ] . ' ' . date ( " d.m.Y " , strtotime ( $rowA [ 'time_expire' ])) . ')' ;
2021-12-29 01:23:24 +01:00
$package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\'' . $drupal_url . 'izvedi-nakup/' . $rowA [ 'package_id' ] . '/podatki/\';">' . $lang [ 'srv_narocila_extend' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
}
}
else {
2022-01-06 09:43:40 +01:00
$package_string = $package_name ;
2020-08-14 13:36:36 +02:00
$package_string .= ' (' . $lang [ 'srv_access_package_free' ] . ')' ;
2021-12-29 01:23:24 +01:00
$package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\'' . $drupal_url . '' . $lang [ 'srv_narocila_buyurl' ] . '\';">' . $lang [ 'srv_narocila_buy' ] . '</button>' ;
2020-08-14 13:36:36 +02:00
}
}
2021-12-29 01:23:24 +01:00
echo '<div class="setting_holder">' . $package_string . '</div>' ;
2020-08-14 13:36:36 +02:00
}
2021-12-29 01:23:24 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-02-19 06:55:04 +01:00
// AAI nima moznosti spreminjanja imena, priimka, emaila, gesla...
2021-09-29 10:37:17 +02:00
if ( isAAI ()){
2021-02-19 06:55:04 +01:00
echo '<span class="italic">' . $lang [ 'srv_profil_aai_warning' ] . '</span>' ;
}
else {
2021-12-29 01:23:24 +01:00
echo '<p class="bottom16">' . $lang [ 'srv_profil_settings_text' ] . '</p>' ;
echo '<div class="setting_horizontal_wrapper">' ;
echo '<div class="setting_holder">' ;
echo '<label for="ime">' . $lang [ 'name' ] . ':</label>' ;
echo '<input class="large" id="ime" name="ime" placeholder="Ime" value="' . $row [ 'name' ] . '" type="text">' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<label for="priimek">' . $lang [ 'surname' ] . ':</label>' ;
echo '<input class="large" id="priimek" name="priimek" placeholder="Priimek" value="' . $row [ 'surname' ] . '" type="text">' ;
echo '</div>' ;
echo '</div>' ;
2022-01-04 01:47:46 +01:00
$alternativni_emaili = User :: getInstance () -> allEmails ( 'brez primarnega' );
2022-05-02 08:56:58 +02:00
$alternativni_emaili = array ( 'aaa' , 'sss' );
2021-12-29 01:23:24 +01:00
echo '<div class="setting_holder">' ;
echo '<label>' . $lang [ 'email' ] . ':</label>' ;
echo '<div class="icon_holder">' ;
echo '<input class="large disabled" value="' . $row [ 'email' ] . '" type="text">' ;
2022-05-02 08:56:58 +02:00
if ( ! empty ( $alternativni_emaili ))
2022-01-05 22:07:10 +01:00
echo '<input name="active_email" value="master" id="active-master" type="radio" ' . ( User :: getInstance () -> primaryEmail () == $row [ 'email' ] ? 'checked="checked"' : '' ) . '><label for="active-master">' . $lang [ 'login_email_subscription' ] . '</label>' ;
2021-12-29 01:23:24 +01:00
echo '</div>' ;
echo '</div>' ;
2022-01-04 01:47:46 +01:00
//Alternativni maili
2021-02-19 06:55:04 +01:00
if ( ! empty ( $alternativni_emaili )){
foreach ( $alternativni_emaili as $email ) {
2022-01-04 01:47:46 +01:00
echo '<div class="setting_holder">' ;
echo '<label>' . $lang [ 'altemail' ] . ':</label>' ;
echo '<div class="icon_holder">' ;
echo '<input class="large disabled" value="' . $email -> email . '" type="text">' ;
echo '<div class="blue pointer altmail" onclick="izbrisiAlternativniEmail(\'' . $email -> id . '\')"><span class="faicon trash empty"></span></div>' ;
2022-01-05 22:07:10 +01:00
echo '<input value="' . ( $email -> id ) . '" id="altemail' . ( $email -> id ) . '" name="active_email" type="radio" ' . ( $email -> active == 1 ? 'checked="checked"' : '' ) . '> <label for="altemail' . ( $email -> id ) . '">' . $lang [ 'login_email_subscription' ] . '</label>' ;
2022-01-04 01:47:46 +01:00
echo '</div>' ;
echo '</div>' ;
2021-02-19 06:55:04 +01:00
}
}
2022-01-04 01:47:46 +01:00
echo '<div class="setting_holder">' ;
echo '<div class="blue pointer" id="klik-dodaj-email"><span class="faicon add"></span>' . $lang [ 'srv_profil_settings_addemail' ] . '</div>' ;
2021-12-29 01:23:24 +01:00
echo '</div>' ;
echo '<div class="setting_holder dodaj-alternativni-email" style="display: none;">' ;
echo '<div class="setting_item">' ;
2022-05-02 08:56:58 +02:00
echo '<label for="alternativni-email">' . $lang [ 'login_alternative_emails' ] . ':</label>' ;
2021-12-29 01:23:24 +01:00
echo '<div class="vnos button_holder inline bottom0">' ;
echo '<input class="large" id="alternativni-email" value="" type="text">' ;
echo '<button type="button" class="medium blue" onclick="dodajAlternativniEmail()">' . $lang [ 'srv_inv_btn_add_recipients_add' ] . '</button>' ;
echo '</div>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<div id="alternativno-obvestilo" class="italic"></div>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-02-19 06:55:04 +01:00
// Ce je vklopljen modul gorenje, preverimo ce ima se default geslo in izpisemo opozorilo
if ( Common :: checkModule ( 'gorenje' )){
if ( SurveyGorenje :: checkGorenjePassword ())
echo '<p class="red bold">' . $lang [ 'gorenje_password_warning' ] . '</p>' ;
}
2020-08-14 13:36:36 +02:00
2021-12-29 01:23:24 +01:00
// Geslo
echo '<div class="setting_horizontal_wrapper">' ;
echo '<div class="setting_holder">' ;
echo '<label for="p1">' . $lang [ 'password' ] . ':</label>' ;
echo '<input class="large" name="geslo" placeholder="' . $lang [ 'password' ] . '" id="p1" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p1\').value=\'\';" type="password">' ;
echo '</div>' ;
echo '<div class="setting_holder">' ;
echo '<label for="p2">' . $lang [ 'password_confirm' ] . ':</label>' ;
echo '<input class="large" name="geslo2" placeholder="' . $lang [ 'password' ] . '" id="p2" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p2\').value=\'\';" type="password">' ;
echo '</div>' ;
echo '</div>' ;
2021-02-19 06:55:04 +01:00
// Prejemanje obvestil
2021-12-29 01:23:24 +01:00
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_gdpr_user_options' ] . ' ' . Help :: display ( 'srv_gdpr_user_options' ) . '</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="gdpr_agree" id="gdpr-agree-yes" value="1" ' . ( $row [ 'gdpr_agree' ] == 1 ? 'checked="checked"' : null ) . '/>' ;
echo '<label for="gdpr-agree-yes">' . $lang [ 'yes' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="radio" name="gdpr_agree" id="gdpr-agree-no" value="0" ' . ( $row [ 'gdpr_agree' ] == 0 ? 'checked="checked"' : null ) . '/>' ;
echo '<label for="gdpr-agree-no">' . $lang [ 'no1' ] . '</label>' ;
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2021-02-19 06:55:04 +01:00
// Google 2 FA
2020-08-14 13:36:36 +02:00
$user_option = User :: option ( $global_user_id , 'google-2fa-secret' );
$user_option_validate = User :: option ( $global_user_id , 'google-2fa-validation' );
2021-12-29 01:23:24 +01:00
echo '<div class="setting_holder">' ;
echo '<input type="checkbox" name="google-2fa" id="google-2fa" value="1" ' . ( ! empty ( $user_option ) ? 'checked="checked"' : '' ) . ' onclick="prikaziGoogle2faKodo()"/>' ;
echo '<label for="google-2fa">' . $lang [ 'google_2fa' ] . ' ' . Help :: display ( 'srv_google_2fa_options' ) . '</label>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
if ( empty ( $user_option )) {
$google2fa = new \Sonata\GoogleAuthenticator\GoogleAuthenticator ();
$googleSecret = $google2fa -> generateSecret ();
$googleLink = \Sonata\GoogleAuthenticator\GoogleQrUrl :: generate ( $row [ 'email' ], $googleSecret , $site_domain );
//Prikaži QR kodo
echo '<div class="settings-2fa-code" id="2fa-display" style="display: none;">' ;
echo '<div>' . $lang [ 'google_2fa_admin_enabled' ] . '<b>' . $googleSecret . '</b></div>' ;
echo '<div style="padding-top: 10px;">' . $lang [ 'google_2fa_admin_enabled_2' ] . '</div>' ;
echo '<input type="hidden" name="google-2fa-secret" value="' . $googleSecret . '">' ;
2022-01-03 15:30:44 +01:00
echo '<div><img class="twoFAQRcode" src="' . $googleLink . '"/></div>' ;
2020-08-14 13:36:36 +02:00
echo '<div>Ko boste shranili nastavitve, bo nastavitev obveljala.</div>' ;
echo '</div>' ;
} elseif ( ! empty ( $user_option ) && $user_option_validate == 'NOT' ) {
echo '<div class="google-2fa-validate">' ;
echo '<div style="padding:5px;">' . $lang [ 'google_2fa_admin_validate' ] . '</div>' ;
echo '<div style="display: block; clear: both;padding: 10px;"><input type="text" name="google-2fa-validate"></div>' ;
echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="ponastaviGoogle2fa()">' . $lang [ 'google_2fa_admin_test_code_reset' ] . '</a></div>' ;
echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="aktivirajGoogle2fa()">' . $lang [ 'google_2fa_admin_test_code' ] . '</a></div>' ;
echo '<div id="google-2fa-bvestilo" style="font-style: italic;">' . $lang [ 'google_2fa_user_error_code' ] . '</div>' ;
echo '</div>' ;
} else {
echo '<div class="google-2fa-deactivate" id="2fa-display" style="display: none;">' ;
echo '<div style="padding:5px;">' . $lang [ 'google_2fa_admin_deactivate' ] . '</div>' ;
echo '<div style="display: block; clear: both;padding: 10px;"><input type="text" name="google-2fa-deactivate"></div>' ;
echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="deaktivirajGoogle2fa()">' . $lang [ 'google_2fa_admin_deactivat_code' ] . '</a></div>' ;
echo '<div id="google-2fa-bvestilo" style="font-style: italic;">' . $lang [ 'google_2fa_user_error_code' ] . '</div>' ;
echo '</div>' ;
}
2021-12-29 01:23:24 +01:00
echo '<div class="button_holder below">' ;
echo '<button class="medium red" onClick="izbrisi1kaRacun();">' . $lang [ 'delete_account' ] . '</button>' ;
echo '</div>' ;
2021-02-19 06:55:04 +01:00
}
2021-12-29 01:23:24 +01:00
echo '</fieldset>' ;
2020-08-14 13:36:36 +02:00
2021-12-29 01:23:24 +01:00
echo '</form>' ;
2020-08-14 13:36:36 +02:00
2021-02-19 06:55:04 +01:00
// Save gumb - ce ni AAI
2021-09-29 10:37:17 +02:00
if ( ! isAAI ()){
2020-08-14 13:36:36 +02:00
2021-12-29 01:23:24 +01:00
echo '<div class="button_holder">' ;
echo '<button class="medium white-blue" onClick="window.location=' . $preklici_url . ';return false;">' . $lang [ 'edit1338' ] . '</button>' ;
echo '<button class="medium blue" onclick="save1kaRacunSettings();">' . $lang [ 'edit1337' ] . '</button>' ;
echo '</div>' ;
2021-02-19 06:55:04 +01:00
// div za prikaz uspešnosti shranjevanja
if ( $_GET [ 's' ] == '1' ) {
echo '<div id="success_save"></div>' ;
2022-03-11 00:34:08 +01:00
echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>' ;
2021-02-19 06:55:04 +01:00
}
}
2020-08-14 13:36:36 +02:00
2021-02-19 06:55:04 +01:00
2020-08-14 13:36:36 +02:00
// Tabela aktivnosti (prijav)
echo '<fieldset><legend>' . $lang [ 'srv_login_tracking_title' ] . '</legend>' ;
echo '<table class="login_tracking">' ;
2021-12-29 01:23:24 +01:00
echo '<tr><th>IP</th><th>' . $lang [ 'srv_login_tracking_date' ] . '</th></tr>' ;
2020-08-14 13:36:36 +02:00
$result = sisplet_query ( " SELECT IP, kdaj FROM user_login_tracker WHERE uid=' " . $global_user_id . " ' ORDER BY kdaj desc " );
if ( mysqli_num_rows ( $result ) == 0 ) {
echo $lang [ 'srv_login_tracking_noData' ];
}
else {
$count = 0 ;
while ( $row = mysqli_fetch_array ( $result )) {
2022-01-05 23:34:00 +01:00
echo '<tr ' . ( $count >= 5 ? ' class="displayNone"' : '' ) . ( $count == 4 ? ' class="show_as_last_row"' : '' ) . '>' ;
2020-08-14 13:36:36 +02:00
echo '<td>' . $row [ 'IP' ] . '</td>' ;
2021-12-29 01:23:24 +01:00
echo '<td>' . date ( 'j.n.Y' , strtotime ( $row [ 'kdaj' ])) . ' ' . date ( 'H:i:s' , strtotime ( $row [ 'kdaj' ])) . '</td>' ;
2020-08-14 13:36:36 +02:00
echo '</tr>' ;
$count ++ ;
}
}
echo '</table>' ;
2022-01-03 15:30:44 +01:00
//Gumb za izpis vseh prijav v tabeli - update v 2. fazi @TG
/** if ( mysqli_num_rows ( $result ) > 25 ){
2021-12-29 01:23:24 +01:00
echo '<span class="login_tracking_more bold" onClick="$(\'table.login_tracking tr\').removeClass(\'displayNone\'); $(\'.login_tracking_more\').addClass(\'displayNone\');">' . $lang [ 'srv_invitation_nonActivated_more' ] . '</span>' ;
2022-01-03 15:30:44 +01:00
} **/
2020-08-14 13:36:36 +02:00
echo '</fieldset>' ;
2021-02-19 06:55:04 +01:00
UserTrackingClass :: init () -> userTrackingDisplay ();
2020-08-14 13:36:36 +02:00
echo '</div>' ;
}
function setGlobalUserSetting () {
global $lang , $global_user_id ;
# polovimo nastavitve uporabnika
UserSetting :: getInstance () -> Init ( $global_user_id );
if ( isset ( $_REQUEST [ 'name' ]) && isset ( $_REQUEST [ 'value' ])) {
$name = $_REQUEST [ 'name' ];
$value = $_REQUEST [ 'value' ];
UserSetting :: getInstance () -> setUserSetting ( $name , $value );
UserSetting :: getInstance () -> saveUserSetting ();
} else { echo 'napaka' ;}
}
function showLockSurvey () {
global $lang , $global_user_id , $admin_type ;
UserSetting :: getInstance () -> Init ( $global_user_id );
# ali zaklepamo anketo ob aktivaciji
$lockSurvey = ( int ) UserSetting :: getInstance () -> getUserSetting ( 'lockSurvey' );
if ( $admin_type == '0' || $admin_type == '1' ) {
echo '<p>' ;
echo '<label><input type="checkbox" onclick="changeSurveyLock(this)" ' . ( $lockSurvey == 1 ? ' checked="checekd"' : '' ) . '>' ;
echo $lang [ 'srv_survey_lock_note' ];
echo '</label>' ;
echo '</p>' ;
}
if (( int ) $lockSurvey > 0 ) {
echo '<p class="small">' . $lang [ 'srv_unlock_popup' ] . '</p>' ;
}
}
function ajax_showTestSurveySMTP (){
ob_start ();
global $lang , $global_user_id ;
global $admin_type ;
$error = false ;
$msg = null ;
$email_msg = $lang [ 'srv_mail_test_smtp_test_success' ];
$email_subject = $lang [ 'srv_mail_test_smtp_test' ];
$MA = new MailAdapter ( $this -> anketa );
$settings = $MA -> getSettingsFromRequest ( $_REQUEST );
$mailMode = $_REQUEST [ 'SMTPMailMode' ];
if ( isset ( $_COOKIE [ 'uid' ])) {
$email = base64_decode ( $_COOKIE [ 'uid' ]);
}
else {
$error = true ;
$msg = $lang [ 'srv_mail_test_smtp_mail_detect_error' ];
}
if ( validEmail ( $email )){
// preverimo password - ne sme bit prazen
if (( $mailMode == 1 || $mailMode == 2 ) && empty ( $settings [ 'SMTPPassword' ])){ # password
$error = true ;
$msg = $lang [ 'srv_mail_test_smtp_password_error' ];
}
}
else {
$error = true ;
$msg = $lang [ 'srv_mail_test_smtp_mail_detect_error' ];
}
// preverjanje je ok.. poizkusimo poslat testni email
if ( $error == false ){
$MA -> addRecipients ( $email );
$result = $MA -> sendMailTest ( $email_msg , $email_subject , $mailMode , $settings );
if ( $result == false ){
$error = true ;
$msg = $lang [ 'srv_mail_test_smtp_not_possible' ];
}
}
// če imamo napake jo izpišemo
if ( $error == true ){
echo $lang [ 'srv_mail_test_smtp_error' ] . ': ' . $msg ;
}
else {
echo $lang [ 'srv_mail_test_smtp_sent' ] . ': ' . $email ;
}
#vsebino shranimo v buffer
$content = ob_get_clean ();
$popUp = new PopUp ();
#$popUp->setId('divSurveySmtp');
$popUp -> setHeaderText ( $lang [ 'srv_mail_test_smtp' ]);
#dodamo vsebino
$popUp -> setContent ( $content );
# dodamo gumb Prekliči
$button = new PopUpCancelButton ();
$button -> setCaption ( $lang [ 'srv_zapri' ]) -> setTitle ( $lang [ 'srv_zapri' ]);
$popUp -> addButton ( $button );
echo $popUp ;
}
}
?>