0){ $this->anketa = $anketa; } } // Nastavitve chat-a (na kateri strani se prikaze...) public function displaySettings(){ global $lang; $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_chat_code'].':'; echo ''; echo '

'; // Prikaz vklopa chata echo ''.$lang['srv_chat_type'].':'; echo ''; echo ''; echo ''; echo '

'; echo '
'; // Gumb shrani echo '
'; echo '
'; echo $lang['edit1337'] . '
'; 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']); } } }