diff options
Diffstat (limited to 'admin/survey/modules/mod_panel/class.SurveyPanel.php')
-rw-r--r-- | admin/survey/modules/mod_panel/class.SurveyPanel.php | 108 |
1 files changed, 74 insertions, 34 deletions
diff --git a/admin/survey/modules/mod_panel/class.SurveyPanel.php b/admin/survey/modules/mod_panel/class.SurveyPanel.php index 30113ad..d3a8da6 100644 --- a/admin/survey/modules/mod_panel/class.SurveyPanel.php +++ b/admin/survey/modules/mod_panel/class.SurveyPanel.php @@ -20,16 +20,18 @@ class SurveyPanel{ # polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $this->db_table = '_active';
- }
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}
// Prikazemo nastavitve pri vklopu naprednega modula
public function displaySettings(){
- global $lang;
+ global $lang;
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
echo '<fieldset><legend>'.$lang['settings'].'</legend>';
@@ -37,49 +39,78 @@ class SurveyPanel{ $row = $this->getPanelSettings();
// Url za preusmeritev
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url'].':</span>';
- echo '<input type="text" size="40" name="url" id="url" value="'.$rowA['url'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url'].':</p>';
+ echo '<input type="text" class="large w300" name="url" id value="'.$rowA['url'].'" />';
+ echo '</div>';
// Ime parametra za id respondenta
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_user_id_name'].':</span>';
- echo '<input type="text" name="user_id_name" id="user_id_name" value="'.$row['user_id_name'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_user_id_name'].':</p>';
+ echo '<input type="text" class="large w300" name="user_id_name" id="user_id_name" value="'.$row['user_id_name'].'" />';
+ echo '</div>';
// Ime parametra za status
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_status_name'].':</span>';
- echo '<input type="text" name="status_name" id="status_name" value="'.$row['status_name'].'" />';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<p" >'.$lang['srv_panel_status_name'].':</p>';
+ echo '<input type="text" class="large w300" name="status_name" id="status_name" value="'.$row['status_name'].'" />';
+ echo '</div>';
// Privzeta vrednost status parametra
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_status_default'].':</span>';
- echo '<input type="text" name="status_default" id="status_default" value="'.$row['status_default'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_status_default'].':</p>';
+ echo '<input type="text" class="large w300" name="status_default" id="status_default" value="'.$row['status_default'].'" />';
+ echo '</div>';
// Primer zacetnega url-ja
$link = SurveyInfo::getSurveyLink();
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url1_example'].':</span>';
- echo $link.'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url1_example'].':</p>';
+ echo '<p class="gray">'.$link.'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID</p>';
+ echo '</div>';
// Primer končnega url-ja
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url2_example'].':</span>';
- echo $rowA['url'].'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS';
-
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url2_example'].':</p>';
+ // Dodaten pogoj, ce imamo slucajno ? ze v osnovnem delu urlja (da vracamo tudi recimo fiksen parameter)
+ if(strpos($rowA['url'], "?") !== false){
+ echo '<p class="gray">'.$rowA['url'].'&'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS</p>';
+ }
+ else{
+ echo '<p class="gray">'.$rowA['url'].'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS</p>';
+ }
+ echo '</div>';
+
+ // Ko se uporabnik vrne (zacne od zacetka/nadaljuje kjer je ostal)
+ echo '<div class="setting_holder">';
+ 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"' . ($rowA['cookie_return'] == 0 ? ' checked="checked"' : '') . ' />';
+ 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"' . ($rowA['cookie_return'] == 1 ? ' checked="checked"' : '') . ' />';
+ echo ' <label for="cookie_return_1">' . $lang['srv_cookie_return_middle'] . '</label>';
+ echo ' </div>';
+ echo '</div>';
+
+ // Nadaljevanje kasneje
+ echo '<div class="setting_holder">';
+ echo ' <input type="checkbox" id="continue_later" name="continue_later" value="1" '.($rowA['continue_later'] == 1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="continue_later">'.$lang['srv_show_continue_later'].' '.Help::display('srv_continue_later_setting').'</label> ';
+ echo '</div>';
+
echo '</fieldset>';
-
+
// Gumb shrani
- echo '<br class="clr" />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="panel_save_settings(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ 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="panel_save_settings(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
echo '<div id="success_save"></div>';
}
@@ -90,8 +121,8 @@ class SurveyPanel{ // Vstavimo vrstico z nastavitvami
$sql1 = sisplet_query("INSERT INTO srv_panel_settings (ank_id) VALUES ('".$this->anketa."')");
- // Uredimo nastavitve zakljucka
- $sql2 = sisplet_query("UPDATE srv_anketa SET concl_link='1' WHERE id='".$this->anketa."'");
+ // Uredimo nastavitve zakljucka, deaktiviramo piskotke in nastavimo nastavitev za nadaljevanje, da nadaljuje kjer je ostal
+ $sql2 = sisplet_query("UPDATE srv_anketa SET concl_link='1', cookie='-1', cookie_return='1' WHERE id='".$this->anketa."'");
if (!$sql2) echo mysqli_error($GLOBALS['connect_db']);
// Ustvarimo sistemsko skrito vprasanje za panel id respondenta
@@ -160,6 +191,15 @@ class SurveyPanel{ $sqlS = sisplet_query("UPDATE srv_spremenljivka s, srv_grupa g
SET s.variable='".$user_id_name."'
WHERE s.variable='".$user_id_name_old."' AND s.gru_id=g.id AND g.ank_id='".$this->anketa."'");
+
+
+ // Shranimo kje nadaljuje in ce ima opcijo za nadaljevanje kasneje
+ if (isset($_POST['cookie_return']) && isset($_POST['continue_later']))
+ $sql = sisplet_query("UPDATE srv_anketa SET cookie_return='".$_POST['cookie_return']."', continue_later='".$_POST['continue_later']."' WHERE id='".$this->anketa."'");
+
+
+ // vsilimo refresh podatkov
+ SurveyInfo :: getInstance()->resetSurveyData();
$this->displaySettings();
}
|