summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyRecoding.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyRecoding.php')
-rw-r--r--admin/survey/classes/class.SurveyRecoding.php101
1 files changed, 49 insertions, 52 deletions
diff --git a/admin/survey/classes/class.SurveyRecoding.php b/admin/survey/classes/class.SurveyRecoding.php
index 53f789e..1189faf 100644
--- a/admin/survey/classes/class.SurveyRecoding.php
+++ b/admin/survey/classes/class.SurveyRecoding.php
@@ -7,11 +7,10 @@ class SurveyRecoding
function __construct($anketa) {
$this->anketa = $anketa;
+
SurveyInfo::getInstance()->SurveyInit($anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
-
- $this->db_table = '_active';
-
+
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
function Ajax() {
@@ -63,8 +62,8 @@ class SurveyRecoding
function DisplaySettings() {
global $lang;
echo '<fieldset><legend>'.$lang['srv_data_subnavigation_recode'].'</legend>';
- echo $lang['srv_recode_note'].'<br/><br/>';
- echo $lang['srv_recode_note_text'].'<br/><br/>';
+ echo '<p class="bottom16">'.$lang['srv_recode_note'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_recode_note_text'].'</p>';
#poiščemo spremenljivke ki so morda rekodirane v drugo spremenljivko
/*
$qry_str = "select distinct spr1, spr2 from srv_recode_vrednost WHERE ank_id = '$this->anketa'";
@@ -110,11 +109,16 @@ class SurveyRecoding
$qry_str = "SELECT s.id, s.variable, s.naslov FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1,2,3,6,16,17,7,18,20,22,25)ORDER BY g.vrstni_red ASC, s.vrstni_red ASC";
$sql = sisplet_query($qry_str);
if (mysqli_num_rows($sql)) {
+
+
+
echo '<table id="recode_table">';
- echo '<thead><tr>';
- echo '<th colspan="4">'.$lang['srv_recode_h_variable'].'</th>';
- echo '<th colspan="5">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
- echo '</tr></thead>';
+ echo '<tr>';
+ echo '<th></th>';
+ echo '<th>'.$lang['srv_recode_h_variable'].'</th>';
+ echo '<th>'.$lang['srv_recode_h_scale'].'</th>';
+ echo '<th class="center functions_column" colspan="2">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
+ echo '</tr>';
while (list($spr_id, $variable, $naslov) = mysqli_fetch_row($sql)) {
$vmv = new RecodeValues($this->anketa,$spr_id);
$hasRecoded = $vmv->hasRecodedValues() || in_array($spr_id,$recodedFrom);
@@ -150,20 +154,16 @@ class SurveyRecoding
$css_even_odd = ( ($cnt_even_odd & 1) ? ' odd' : ' even' );
echo '<tr id="recoding_variable_div_'.$spr_id.'" class="recoding_variable_div'.$css_even_odd.$css_border.'">';
- echo '<td style="width:auto;">';
- SurveyAnalysis::showIcons($spr_id.'_0',$row,'desc',array('noReport' => true, 'showChart' => false));
- echo '</td>';
- echo '<td style="width:25px; text-align:center;" class="gray">';
- echo $icon1;
- echo '</td>';
+
echo '<td>';
- echo '<span class="gray">'.$icon2.'</span>';
- echo '<span class="green'.$css_strong.'">';
+ SurveyAnalysis::showIcons($spr_id.'_0',$row,'desc',array('noReport' => true, 'showChart' => false), true);
+ echo '</td>';
+ echo '<td>';
echo '<a onclick="showspremenljivkaSingleVarPopup(\''.$spr_id.'_0\'); return false;" href="#">';
echo $variable;
echo '</a>';
- echo '</span> - <span class="spaceRight'.$css_strong.'">'.skrajsaj(strip_tags($naslov),40).'</span>';
+ echo ' - '.skrajsaj(strip_tags($naslov),40);
if ($key) {
$row1 = Cache::srv_spremenljivka($key);
@@ -172,60 +172,57 @@ class SurveyRecoding
echo '</td>';
- echo '<td class="gray" style="padding-right:10px; padding-left:10px;">';
+ echo '<td>';
$legend = Cache::spremenljivkaLegenda($spr_id);
- echo '('.$legend['izrazanje'].' - '.$legend['skala'].')';
+ echo $legend['skala'];
echo '</td>';
- echo '<td style="width:50px; text-align:center;" >';
+
+ echo '<td class="functions_column">';
+ echo '<div class="functions">';
+
#dodaj
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="silver">'.$lang['srv_recode_add'].'</span>';
+ echo '<div class="sep sep silver">'.$lang['srv_recode_add'].'</div>';
} else {
- echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</span>';
+ echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</div>';
}
}
- echo '</td>';
- echo '<td style="padding-right:10px; padding-left:10px;text-align:center;">';
# uredi
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</span>';
+ echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</div>';
} else {
- echo '<span class="silver">'.$lang['srv_recode_edit'] .'</span>';
+ echo '<div class="sep silver">'.$lang['srv_recode_edit'] .'</div>';
}
}
- echo '</td>';
- echo '<td style="padding-right:10px; padding-left:10px; text-align:center;">';
# odstrani
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</span>';
+ echo '<div class="sep as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</div>';
} else {
- echo '<span class="silver" >'.$lang['srv_recode_remove'].'</span>';
+ echo '<div class="sep silver" >'.$lang['srv_recode_remove'].'</div>';
}
}
- echo '</td>';
-
- echo '<td style="padding-right:10px; padding-left:10px;">';
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ($hasRecoded) {
- echo '<label><span class="as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</span></label>';
+ echo '<label><div class="sep as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</div></label>';
#echo '<label><input type="checkbox" id="recoding_variable_cb_'.$spr_id.'" onchange="enableRecodeVariable(\''.$spr_id.'\',this);"'.($enabled?' checked="checked"':'').' autocomplete="off">'.$lang['srv_recode_enable'].'</label>';
} else {
- echo '<span class="silver">'.$lang['srv_recode_enabled'].'</span>';
+ echo '<div class="sep silver">'.$lang['srv_recode_enabled'].'</div>';
}
}
+ echo '</div>';
echo '</td>';
$visible= ((int)$row['visible'] == 1) ? true : false;
@@ -243,7 +240,7 @@ class SurveyRecoding
session_start();
- if ($_SESSION['showRunRecodeButton'][$this->anketa] == true) {
+ if (isset($_SESSION['showRunRecodeButton'][$this->anketa]) && $_SESSION['showRunRecodeButton'][$this->anketa] == true) {
echo '<br/><div class="buttonwrapper floatLeft" id="btnRunRecode" title="'.$lang['srv_compute_start'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="runRecodeVredonosti($(\'#question_recode_run_note\'));">'.$lang['srv_compute_start'].'</a></div>';
echo '<br /><br />';
}
@@ -271,12 +268,12 @@ class SurveyRecoding
$vmv = new RecodeValues($this->anketa,$spr_id);
$vmv->DisplayMissingValuesForQuestion();
#echo '</span>';
-
- echo '<div class="recodeButtonHolder buttons_holder">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="saveQuestionRecode(); return false;">'.$lang['save'].'</a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancelQuestionRecode(); return false;"><span>'.$lang['srv_cancel'].'</span></a></div></span>';
- echo '<br class="clr"/>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="cancelQuestionRecode(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="saveQuestionRecode(); return false;">'.$lang['save'].'</button>';
echo '</div>';
+
} else {
echo 'Napaka!';
}
@@ -478,21 +475,21 @@ class SurveyRecoding
}
}
-
}
+
if (count($all_recoded) == 0) {
echo $lang['srv_recode_summary_nothing'];
- } else {
+ }
+ else {
#var_dump($all_recoded);#
- echo '<span id="div_recent_recoding_1" class="as_link" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggle();">+ '.$lang['srv_recode_summary'].'</span>';
- echo '<span id="div_recent_recoding_2" class="as_link displayNone" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggle();">- '.$lang['srv_recode_summary'].'</span>';
+ echo '<span id="div_recent_recoding_1" class="as_link" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggleClass(\'displayNone\');">+ '.$lang['srv_recode_summary'].'</span>';
+ echo '<span id="div_recent_recoding_2" class="as_link displayNone" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggleClass(\'displayNone\');">- '.$lang['srv_recode_summary'].'</span>';
echo '<div id="div_recent_recoding" class="displayNone">';
foreach ($all_recoded AS $msg) {
echo $msg['txt']."<br/>";
}
echo '</div>';
}
-
}
function enableRecodeVariable() {