0){ $this->anketa = $anketa; } } // Nastavitve kviza (prikaz rezultatov, grafa...) public function displaySettings(){ global $lang; global $site_url; $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/"); $preklici_url = "'". $site_url . $preklici_url . "'"; echo '
'; // Gumb shrani echo ' '; echo ''; } // Pridobimo trenutne nastavitve kviza za anketo public function getSettings(){ $settings = array(); // Default vrednosti $settings['results'] = '1'; $settings['results_chart'] = '0'; $sql = sisplet_query("SELECT * FROM srv_quiz_settings WHERE ank_id='".$this->anketa."'"); if(mysqli_num_rows($sql) > 0){ $row = mysqli_fetch_array($sql); $settings['results'] = $row['results']; $settings['results_chart'] = $row['results_chart']; } return $settings; } public function ajax() { if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){ $results = isset($_POST['results']) ? $_POST['results'] : ''; $results_chart = isset($_POST['results_chart']) ? $_POST['results_chart'] : '0'; $sql = sisplet_query("INSERT INTO srv_quiz_settings (ank_id, results, results_chart) VALUES ('".$this->anketa."', '".$results."', '".$results_chart."') ON DUPLICATE KEY UPDATE results='".$results."', results_chart='".$results_chart."'"); if (!$sql) echo mysqli_error($GLOBALS['connect_db']); } } }