diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to 'main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php')
-rw-r--r-- | main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php | 76 |
1 files changed, 14 insertions, 62 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php b/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php index de5581d..9da537e 100644 --- a/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php +++ b/main/survey/app/Controllers/Vprasanja/OneAgainstAnotherController.php @@ -42,11 +42,7 @@ class OneAgainstAnotherController extends Controller /**
* @desc prikaze vnosno polje za one against another
*/
- function display($spremenljivka)
- {
-
- //echo "One against another!";
-
+ function display($spremenljivka){
$loop_id = get('loop_id') == null ? " IS NULL" : " = '" . get('loop_id') . "'";
@@ -59,13 +55,12 @@ class OneAgainstAnotherController extends Controller $gridWidth = (($spremenljivkaParams->get('gridWidth') > 0) ? $spremenljivkaParams->get('gridWidth') : 30);
$gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0);
$cssAlign = '';
- //$gridAlign = 1;
+
if ($gridAlign == 1)
$cssAlign = ' alignLeft';
elseif ($gridAlign == 2)
$cssAlign = ' alignRight';
- //$css = ' style = "width: '.$gridWidth.'%;" ';
// izracuni za sirino celic
$size = $row['grids'];
@@ -94,10 +89,9 @@ class OneAgainstAnotherController extends Controller if ($mv_count > 0) {
$size += 1 + $mv_count;
}
+
// diferencial
- //if ($row['enota'] == 1) {
$size += 2;
- //}
# če imamo nastavljno sirino prvega grida ostalih ne nastavljamo
if ($gridWidth == 30) {
@@ -112,39 +106,6 @@ class OneAgainstAnotherController extends Controller echo '<table class="grid_table multigrid" >' . "\n";
-
- // echo '<colgroup class="question">';
- // //echo '<col class="width_'.$gridWidth.'">';
- // echo '<col class="width_15">';
- // echo '</colgroup>';
- // echo '<colgroup>';
- // //echo '<col class="space">';
- // echo '<col class="width_20">';
- // echo '</colgroup>';
- // echo '<colgroup class="category">';
- // for ($i=1; $i<=$row['grids']; $i++)
- // echo '<col>';
- // echo '</colgroup>';
- // if ($mv_count > 0) {
- // echo '<colgroup>';
- // echo '<col class="space">';
- // echo '</colgroup>';
- // echo '<colgroup class="missing">';
- // for ($i=1; $i<=$mv_count; $i++)
- // echo '<col>';
- // echo '</colgroup>';
- // }
- // if ($row['enota'] > 0) {
- // echo '<colgroup>';
- // //echo '<col class="space">';
- // echo '<col class="width_20">';
- // echo '</colgroup>';
- // //echo '<colgroup class="differential">';
- // //echo '<col class="width_'.$gridWidth.'">';
-
- // //echo '</colgroup>';
- // }
-
echo '<tbody>';
$bg++;
@@ -161,11 +122,19 @@ class OneAgainstAnotherController extends Controller # loop skozi srv_vrednost, da izpišemo vrstice z vrednostmi
$sql1 = sisplet_query("SELECT * FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY FIELD(vrstni_red, $orderby)");
while ($row1 = mysqli_fetch_array($sql1)) {
+
# po potrebi prevedemo naslov
$naslov = Language::getInstance()->srv_language_vrednost($row1['id']);
if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
+ # po potrebi prevedemo naslov2 za diferencial
+ $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true);
+ if ($naslov2 != '') {
+ $row1['naslov2'] = $naslov2;
+ }
+
# preverimo izbrano vrednost
$grid_id = $srv_data_grid[$row1['id']]['grd_id'];
@@ -193,37 +162,20 @@ class OneAgainstAnotherController extends Controller //radio buttoni
-
if (count($srv_grids) > 0) {
$first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
-/* if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
- # dodamo spejs pred manjkajočimi vrednostmi
- echo ' <td></td>' . "\n";
- $first_missing_value = false;
- } */
$value = $srv_grids[$i]['id'];
# izpišemo radio grida
if ($srv_grid['other'] != 0) {
-/* echo '<td class="missing' . ((Helper::getCustomCheckbox() != 0) ? ' custom-radio custom-size-' . Helper::getCustomCheckbox() : '') . ' ' . $cssAlign . '">';
- # imamo missing vrednost
- echo '<label for="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '">';
- echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="grid_missing_value_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation="0" onclick="checkChecked(this); checkTableMissing(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . ');">';
- echo '<span ' . (($row1['hidden'] == 2) ? 'class="answer-disabled"' : '') . '></span>';
- echo '</label>';
- echo '</td>' . "\n";
- if ($i == 1) { //ce je to prvi radio button, dodaj ali
- //echo '<td style="text-align: center;"> ali </td>';
- echo '<td style="text-align: center;"> ' . self::$lang['srv_tip_sample_t6_4_vmes'] . ' </td>';
- }
+ }
+ else {
- */
- }else {
- //echo '<td class="category ' . $cssAlign . '">';
echo '<td class="category style="text-align: center;">';
+
# ni missing vrednost
echo '<label for="vrednost_' . $row1['id'] . '_grid_' . $value . '">';
echo '<input type="radio" ' . (!$hideName ? ' name="vrednost_' . $row1['id'] . '"' : '') . ' id="vrednost_' . $row1['id'] . '_grid_' . $value . '" value="' . $value . '"' . (($grid_id == $value && $grid_id != '' && !$is_missing) ? ' checked' : '') . ($is_missing ? ' disabled' : '') . ' data-calculation="' . $srv_grids[$i]['variable'] . '" onclick="checkChecked(this); checkBranching(); setCheckedClass(this, null, ' . $row1['id'] . ');">';
|