0){ $this->anketa = $anketa; } } // Nastavitve chat-a (na kateri strani se prikaze...) public function displaySettings(){ global $lang; global $site_url; $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/"); $preklici_url = "'". $site_url . $preklici_url . "'"; $row = SurveyInfo::getInstance()->getSurveyRow(); echo '
'.$lang['settings'].''; // Koda za embed tawk chat widgeta $code = ''; $sql = sisplet_query("SELECT * FROM srv_chat_settings WHERE ank_id='".$this->anketa."'"); if(mysqli_num_rows($sql) > 0){ $row = mysqli_fetch_array($sql); $code = $row['code']; } echo '

'.$lang['srv_vrsta_survey_note_14_1a'].':

'; echo '
'; echo '

'.$lang['srv_chat_code'].':

'; echo ''; echo '
'; // Prikaz vklopa chata echo '

'.$lang['srv_vrsta_survey_note_14_1c'].'

'; echo '
'; echo ''.$lang['srv_chat_type'].':'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo '
'; // Gumb shrani echo '
'; echo ''; echo ''; echo '
'; echo '
'; } public function ajax() { if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){ $code = isset($_POST['code']) ? $_POST['code'] : ''; $chat_type = isset($_POST['chat_type']) ? $_POST['chat_type'] : '0'; $sql = sisplet_query("INSERT INTO srv_chat_settings (ank_id, code, chat_type) VALUES ('".$this->anketa."', '".$code."', '".$chat_type."') ON DUPLICATE KEY UPDATE code='".$code."', chat_type='".$chat_type."'"); if (!$sql) echo mysqli_error($GLOBALS['connect_db']); } } }