summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Controllers/Vprasanja/NumberController.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main/survey/app/Controllers/Vprasanja/NumberController.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/NumberController.php b/main/survey/app/Controllers/Vprasanja/NumberController.php
index 13f312c..d8adf4b 100644
--- a/main/survey/app/Controllers/Vprasanja/NumberController.php
+++ b/main/survey/app/Controllers/Vprasanja/NumberController.php
@@ -60,6 +60,7 @@ class NumberController extends Controller
//**************************************************************************************************
//***************************
+ $limit = ''; $limit2 = '';
if ($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit'])
$limit = '(' . $row['vsota_min'] . ')';
@@ -69,8 +70,6 @@ class NumberController extends Controller
$limit = '(min ' . $row['vsota_min'] . ')';
elseif ($row['num_useMax'] == 1)
$limit = '(max ' . $row['vsota_limit'] . ')';
- else
- $limit = '';
if ($row['size'] == 2) {
if ($row['num_useMin2'] == 1 && $row['num_useMax2'] == 1 && $row['num_min2'] == $row['num_max2'])
@@ -81,8 +80,6 @@ class NumberController extends Controller
$limit2 = '(min ' . $row['num_min2'] . ')';
elseif ($row['num_useMax2'] == 1)
$limit2 = '(max ' . $row['num_max2'] . ')';
- else
- $limit2 = '';
}
# preverimo ali je vrednost v bazi missing
@@ -102,11 +99,11 @@ class NumberController extends Controller
$taWidth = 10;
//preverjanje praznega vnosa (-1)
- $row1['text'] != -1 ? $text = $row1['text'] : $text = '';
- $row1['text2'] != -1 ? $text2 = $row1['text2'] : $text2 = '';
+ $text = (isset($row1['text']) && $row1['text'] != -1) ? $row1['text'] : '';
+ $text2 = (isset($row1['text2']) && $row1['text2'] != -1) ? $row1['text2'] : '';
- $row1['text'] != -1 ? $value[1] = $row1['text'] : $value[1] = '';
- $row1['text2'] != -1 ? $value[2] = $row1['text2'] : $value[2] = '';
+ $value[1] = (isset($row1['text']) && $row1['text'] != -1) ? $row1['text']: '';
+ $value[2] = (isset($row1['text2']) && $row1['text2'] != -1) ? $row1['text2']: '';
$sql2 = sisplet_query("SELECT id, naslov, vrstni_red, other FROM srv_vrednost WHERE spr_id='$spremenljivka' order BY vrstni_red");
$array_others = array();
@@ -130,11 +127,11 @@ class NumberController extends Controller
echo '<br>';
}
- echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
-
# če imamo enoto na levi jo izpišemo
if ($row['enota'] == 1) {
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
echo $naslov;
+ echo '</label>';
}
echo ' <input type="text" class="width_' . $taWidth . '" name="vrednost_' . $spremenljivka . '[]"'
@@ -143,19 +140,20 @@ class NumberController extends Controller
. ' onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');"'
. ' onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); checkBranching();"'
. (!$missing ? '' : ' disabled') . '> ' . "\n";
+
# če imamo enoto na desni jo izpišemo
if ($row['enota'] == 2) {
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $row2['vrstni_red'] . '" ' . ($row['ranking_k'] == '1' && get('mobile') == 0 ? ' style="display:none;"' : '') . '>';
echo $naslov;
- }
-
- echo '</label>';
+ echo '</label>';
+ }
} else {
# imamo polje drugo - ne vem, zavrnil...
$array_others[$row2['id']] = array(
'naslov' => $naslov,
'vrstni_red' => $row2['vrstni_red'],
- 'value' => $text[$row2['vrstni_red']],
+ 'value' => (isset($text[$row2['vrstni_red']]) ? $text[$row2['vrstni_red']] : ''),
);
}
@@ -226,7 +224,8 @@ class NumberController extends Controller
//za custom opisne labele
//moznosti urejanja opisnih label drsnika
- if($slider_VmesneDescrLabel){
+ if($slider_VmesneDescrLabel){
+ $slider_CustomDescriptiveLabels = '';
for($i=1; $i<=$slider_NumofDescrLabels; $i++){
if($custom == ''){ //ce nimamo prevoda opisnih label za drsnika
$slider_CustomDescriptiveLabelsTmp = ($spremenljivkaParams->get('slider_Labela_opisna_'.$i) ? $spremenljivkaParams->get('slider_Labela_opisna_'.$i) : '');
@@ -327,7 +326,7 @@ class NumberController extends Controller
# missing vrednost
$_id = 'missing_value_spremenljivka_' . $spremenljivka . '_vrednost_' . $oKey;
- if ($srv_data_vrednost[$oKey]) {
+ if (isset($srv_data_vrednost[$oKey]) && $srv_data_vrednost[$oKey]) {
$sel = true;
} else {
$sel = false;
@@ -357,11 +356,12 @@ class NumberController extends Controller
$hide_missing = true;
echo '<div class="variabla' . $oblika['cssFloat'] . ' missing" id="vrednost_if_' . $oKey . '"' . ' ' . ($hide_missing ? ' style="display:none"' : '') . '>';
- echo '<label for="' . $_id . '">';
- echo '<input type="checkbox" name="vrednost_mv_' . $spremenljivka . '[]" id="' . $_id . '" value="' . $oKey . '"' . $_checked . ($_disabled ? ' disabled' : '') . ' data-calculation="0" onclick="checkBranching(); ' . ($checkbox_limit > 0 ? 'checkboxLimit(\'' . $spremenljivka . '\', \'' . $oKey . '\', \'' . $checkbox_limit . '\');' : '') . ' checkMissing(this);"> ';
+ echo ' <label for="'.$_id.'">';
+ echo ' <input type="checkbox" name="vrednost_mv_' . $spremenljivka . '[]" id="' . $_id . '" value="' . $oKey . '"' . $_checked . ($_disabled ? ' disabled' : '') . ' data-calculation="0" onclick="checkBranching(); ' . ($checkbox_limit > 0 ? 'checkboxLimit(\'' . $spremenljivka . '\', \'' . $oKey . '\', \'' . $checkbox_limit . '\');' : '') . ' checkMissing(this);"> ';
// Font awesome checkbox
- echo '<span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
- echo '' . $other['naslov'] . '</label>';
+ echo ' <span class="enka-checkbox-radio" '.((Helper::getCustomCheckbox() != 0) ? 'style="font-size:' . Helper::getCustomCheckbox() . 'px;"' : '').'></span>';
+ echo $other['naslov'];
+ echo ' </label>';
echo '</div>';
}
}