summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.RecodeValues.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.RecodeValues.php')
-rw-r--r--admin/survey/classes/class.RecodeValues.php96
1 files changed, 51 insertions, 45 deletions
diff --git a/admin/survey/classes/class.RecodeValues.php b/admin/survey/classes/class.RecodeValues.php
index eef65b0..2f4bd91 100644
--- a/admin/survey/classes/class.RecodeValues.php
+++ b/admin/survey/classes/class.RecodeValues.php
@@ -30,9 +30,8 @@ class RecodeValues {
self::$anketa = $anketa;
self::$spremenljivka = $spremenljivka;
- SurveyInfo::getInstance()->SurveyInit($anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- self::$db_table = '_active';
+ SurveyInfo::getInstance()->SurveyInit($anketa);
+ self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# polovimo manjkajoče privzete vrednosti ankete
self::$smv = new SurveyMissingValues(self::$anketa);
@@ -445,7 +444,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == '0') ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -463,7 +462,7 @@ class RecodeValues {
echo '&nbsp;'.$lang['srv_recode_number_to'];
- echo '<select name="recode_number_type[]" onChange="recode_number_type_changed(this);">';
+ echo '<select class="dropdown medium" name="recode_number_type[]" onChange="recode_number_type_changed(this);">';
foreach (self::$options AS $oKey => $option) {
if ($option['variable'] == null && $oKey != '_0_') {
echo '<option disabled="disabled">'.$option['naslov'].'</option>';
@@ -495,7 +494,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == '0') ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -515,7 +514,7 @@ class RecodeValues {
# imamo rekodiranje v novo spremenljivko
$recode['vred_id'] = '-1';
- echo '<select name="recode_number_vrednost[]">';
+ echo '<select class="dropdown medium" name="recode_number_vrednost[]">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -668,48 +667,57 @@ class RecodeValues {
}
$sugestedName = strip_tags(self::$cacheSpremenljivka['naslov'].' - recoded');
echo'<div id="divRecodeSprOption">';
- echo '<label>'.$lang['srv_recode_to_spr'].'</label>';
+ echo '<label>'.$lang['srv_recode_to_spr'].': ';
if ( $_GET['t'] == 'charts' || $_POST['recIsCharts'] == 1 ) {
- echo $lang['srv_recode_to_spr_same'];
+ echo $lang['srv_recode_to_spr_same'].'</label>';
} else {
- echo '<label><input type="radio" name="recode_type" value="0" '.((int)$recode_type == 0 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;">'.$lang['srv_recode_to_spr_same'].'</label>';
- echo '<label><input type="radio" name="recode_type" value="1" '.((int)$recode_type == 1 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;">'.$lang['srv_recode_to_spr_new'].'</label>';
+ echo '</label><input type="radio" name="recode_type" id="recode_type0" value="0" '.((int)$recode_type == 0 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;"><label for="recode_type0">'.$lang['srv_recode_to_spr_same'].'</label>';
+ echo '<input type="radio" name="recode_type" id="recode_type1" value="1" '.((int)$recode_type == 1 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;"><label for="recode_type1">'.$lang['srv_recode_to_spr_new'].'</label>';
}
echo '</div>';
if ((int)$recode_type == 1) {
- echo'<span id="divRecodeSprNew" class="floatRecodeSpremenljivka">';
+ echo'<div id="divRecodeSprNew" class="top16 bottom16">';
if ((int)$to_spr_id == 0) {
- echo '<div class="new-spr" style="text-align: right">';
- echo $lang['srv_recode_to_spr_add_spr'].'<br/>';
+ echo '<div class="new-spr">';
+ //echo $lang['srv_recode_to_spr_add_spr'].'<br/>';
echo '<div id="coding_spr_new" >';
- echo '<p>'.$lang['srv_recode_to_spr_name'].' <input type="text" id="rec_spremenljivka_naslov" name="spremenljivka_naslov" default="1" contenteditable="true" value="'.$sugestedName.'" style="width: 123px" />';
+ echo '<p class="top16">'.$lang['srv_recode_to_spr_name'].' <input type="text" class="text medium" id="rec_spremenljivka_naslov" name="spremenljivka_naslov" default="1" contenteditable="true" value="'.$sugestedName.'"/>';
#echo '<a href="#" onclick="recodeSpremenljivkaNew(); return false;">'.$lang['add'].'</a>';
- echo '<a href="#" onclick="recodeSpremenljivkaNew(); return false;""><span class="faicon add small" title="'.$lang['add'].'"></span></a>';
+ echo '<button class="small blue" onclick="recodeSpremenljivkaNew(); return false;"">'.$lang['add'].'</button>';
echo '</p>';
echo '</div>';
echo '</div>';
} else {
- echo '<strong>'.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).'</strong><br/><br/>';
+ echo '<span class="semi-bold">'.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).'</span>';
$sql1 = sisplet_query("SELECT naslov FROM srv_vrednost WHERE spr_id='$to_spr_id' ORDER BY vrstni_red ASC");
+ $count = 0;
+ echo '<p class="top16 bottom16">'.$lang['srv_recode_valueset'];
while ($row1 = mysqli_fetch_array($sql1)) {
if ($rowSpremenljivka['tip'] == 1) {
- echo '<input type="radio" onclick="return false;" /><label> '.$row1['naslov'].'</label>';
- echo '<br/>';
+ if ($count == 0) {
+ $count = 1;
+ }
+ else {
+ echo ', ';
+ }
+ echo $row1['naslov'];
}
}
+ echo '</p>';
+ echo '<div class="setting_holder">';
if (mysqli_num_rows($sql1) == 0) {
echo '&nbsp;'.$lang['srv_novavrednost'].': '; $margin='0';
- } else { $margin = '23px';
+ } else { $margin = 'none-left';
}
- echo '<input type="text" name="vrednost_new" value="" '.(mysqli_num_rows($sql1)>0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' style="margin-left:'.$margin.'; width: 80px" /> ';
- echo '<a href="#" onclick="recodeVrednostNew(); return false;"><span class="faicon add small icon-as_link" title="'.$lang['add'].'"></span></a>';
- echo '<br>Napredne spremembe:'.Help::display('srv_recode_advanced_edit');
+ echo '<input class="text medium '.$margin.'" type="text" name="vrednost_new" value="" '.(mysqli_num_rows($sql1)>0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' /> ';
+ echo '<button class="small blue" onclick="recodeVrednostNew(); return false;">'.$lang['add'].'</button>';
+ echo '<p class="recode_end">Napredne spremembe:'.Help::display('srv_recode_advanced_edit').'</p>';
+ echo '</div>';
}
- echo '</span>';
+ echo '</div>';
}
- echo'<br class="clr" />';
}
if ( $displayType == 1 ) {
if (count(self::$variables)> 0) {
@@ -722,39 +730,37 @@ class RecodeValues {
//echo '<table style="width:65% !important;">';
echo '<table class="question_recode_table">';
echo '<tr>';
- echo '<th class="halfWidth" colspan="2">';
+ echo '<th class="main_head center" colspan="2">';
echo $lang['srv_recode_original'];
echo '</th>';
- echo '<td rowspan="2" style="vertical-align:top;">&nbsp;<span class="sprites arrow_switch"></span>&nbsp;</td>';
- echo '<th class="halfWidth" rowspan="2" style="vertical-align:top;">';
+ echo '<th class="main_head center" style="vertical-align:top;">';
echo $lang['srv_recode_to'];
echo '</th>';
echo '</tr>';
echo '<tr>';
- echo '<td class="halfWidth anl_ac gray">';
- echo $lang['srv_recode_to_label'];
- echo '</td>';
- echo '<td class="halfWidth anl_ac gray">';
- echo $lang['srv_recode_to_value'];
- echo '</td>';
+ echo '<th class="dark">';
+ echo $lang['srv_label'];
+ echo '</th>';
+ echo '<th class="dark center">';
+ echo $lang['srv_vrednost'];
+ echo '</th>';
+ echo '<th>';
+ echo '</th>';
echo '</tr>';
foreach (self::$variables AS $vKey => $variable) {
echo '<tr>';
- echo '<td class="anl_ac">';
+ echo '<td class="labela">';
echo $variable['naslov'];
echo '</td>';
- echo '<td class="anl_ac">';
+ echo '<td class="center">';
echo '&nbsp;&nbsp;['.$variable['variable'].']';
echo '</td>';
- # spacer
- echo '<td>&nbsp</td>';
- #
echo '<td>';
if ((int)$recode_type == 0) {
# imamo klasično rekodiranje
- echo '<select name="MVFQ_'.$variable['variable'].'">';
+ echo '<select class="dropdown medium" name="MVFQ_'.$variable['variable'].'">';
foreach (self::$options AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -775,7 +781,7 @@ class RecodeValues {
if (!isset($recodedFrom[$vKey])) {
$recodedFrom[$vKey] = '-1';
}
- echo '<select name="MVSNFQ_'.$vKey.'">';
+ echo '<select class="dropdown medium" name="MVSNFQ_'.$vKey.'">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -817,7 +823,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == $recode['operator']) ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -835,7 +841,7 @@ class RecodeValues {
echo '&nbsp;'.$lang['srv_recode_number_to'];
$is_missing_value = false;
- echo '<select name="recode_number_type" onChange="recode_number_type_changed(this);">';
+ echo '<select class="dropdown medium" name="recode_number_type" onChange="recode_number_type_changed(this);">';
foreach (self::$options AS $oKey => $option) {
if ($oKey == '_0_' || $oKey == '_1_' || $oKey == '_2_') {
# privzeto izberemo prvi odgovor - veljavni, nato spodaj popravimo
@@ -876,7 +882,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == $recode['operator']) ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -897,7 +903,7 @@ class RecodeValues {
$recodedFrom[$rKey] = '-1';
}
# imamo rekodiranje v novo spremenljivko
- echo '<select name="recode_number_vrednost[]">';
+ echo '<select class="dropdown medium" name="recode_number_vrednost[]">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {