summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Controllers/Vprasanja/VsotaController.php
diff options
context:
space:
mode:
Diffstat (limited to 'main/survey/app/Controllers/Vprasanja/VsotaController.php')
-rw-r--r--main/survey/app/Controllers/Vprasanja/VsotaController.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/VsotaController.php b/main/survey/app/Controllers/Vprasanja/VsotaController.php
index ad79de7..b69d190 100644
--- a/main/survey/app/Controllers/Vprasanja/VsotaController.php
+++ b/main/survey/app/Controllers/Vprasanja/VsotaController.php
@@ -71,20 +71,21 @@ class VsotaController extends Controller
$row2 = mysqli_fetch_array($sql2);
//preverjanje skritega vprasanja(-2)
- $row2['text'] != -2 ? $text = $row2['text'] : $text = '';
+ $text = isset($row2['text']) && $row2['text'] != -2 ? $row2['text'] : '';
echo '<div class="variabla_sum width_' . $gridWidth . '" id="vrednost_if_' . $row1['id'] . '" ' . ($row1['if_id'] > 0 ? ' style="display:none"' : '') . '>';
//echo ' <label for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
//echo ' <label style="width:200px;display: inline-block;" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
- echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
- echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '" value="' . $text . '" onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');" onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); calcSum(' . $spremenljivka . ', ' . $max . ', ' . $row['vsota_limit'] . ');" onBlur="checkBranching();" ' . ($selected ? ' disabled' : '') . '>';
+ echo '<label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '">' . $row1['naslov'] . '</label>';
+ echo '<input type="text" name="spremenljivka_' . $spremenljivka . '_vrednost_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_sestevanec_' . $counter . '" value="' . $text . '" onkeypress="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . ');" onkeyup="checkNumber(this, ' . $row['cela'] . ', ' . $row['decimalna'] . '); calcSum(' . $spremenljivka . ', ' . $max . ', ' . $row['vsota_limit'] . ');" onBlur="checkBranching();" ' . ($selected ? ' disabled' : '') . '>';
echo '</div>' . "\n";
$counter++;
$sum += (double)$text;
}
+ $limit = '';
if ($row['vsota_limit'] != 0 && $row['vsota_limit'] == $row['vsota_min'])
$limit = '(' . $row['vsota_min'] . ')';
elseif ($row['vsota_limit'] != 0 && $row['vsota_min'] != 0)
@@ -95,14 +96,15 @@ class VsotaController extends Controller
$limit = '(min ' . $row['vsota_min'] . ')';
$rowl = Language::srv_language_spremenljivka($spremenljivka);
- if ($rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
- if ($row['vsota'] == '') $row['vsota'] = self::$lang['srv_vsota_text'];
+ if (isset($rowl['vsota']) && $rowl['vsota'] != '')
+ $row['vsota'] = $rowl['vsota'];
+
+ if ($row['vsota'] == '')
+ $row['vsota'] = self::$lang['srv_vsota_text'];
echo '<div class="variabla_sum width_' . $gridWidth . ' sum" id="vsota_' . $row['id'] . '">';
- //echo ' <label for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- //echo ' <label style="width:200px;display: inline-block;" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
- echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vsota_' . $row['id'] . '" id="spremenljivka_' . $spremenljivka . '_vsota" value="' . $sum . '" disabled class="def">';
+ echo ' <label class="vsota_besedilo" for="spremenljivka_' . $spremenljivka . '_vsota">' . $row['vsota'] . '</label>';
+ echo ' <input type="text" name="spremenljivka_' . $spremenljivka . '_vsota_' . $row['id'] . '" id="spremenljivka_' . $spremenljivka . '_vsota" value="' . $sum . '" disabled class="def">';
echo '</div>' . "\n";
if ($row['vsota_show'] == 1)