summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php124
1 files changed, 46 insertions, 78 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php b/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php
index 3e0b953..c706d39 100644
--- a/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php
+++ b/main/survey/app/Controllers/Vprasanja/ImageHotSpotController.php
@@ -82,11 +82,11 @@ class ImageHotSpotController extends Controller
//imena obmocij iz srv_vrednost
- $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ $sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='".$row['id']."' ORDER BY vrstni_red");
//$sqlR = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='$row[id]' ");
- $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='$row[id]' ");
+ $sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='".$row['id']."'");
- echo '<div id="hotspot_regions_hidden_menu_'.$row[id].'" style="display:none; ">';
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'" style="display:none; ">';
if (mysqli_num_rows($sql1) == 0){
echo ' <div class="variabla">';
echo '</div>';
@@ -184,8 +184,9 @@ class ImageHotSpotController extends Controller
if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -353,7 +354,7 @@ class ImageHotSpotController extends Controller
$mv_count = 0; # koliko je stolpcev z manjkajočimi vrednostmi
# če polje other != 0 je grid kot missing
//$sql_grid = sisplet_query("SELECT * FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
- $sql_grid = sisplet_query("SELECT id, naslov, other FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ $sql_grid = sisplet_query("SELECT id, naslov, other, variable FROM srv_grid WHERE spr_id='$row[id]' ORDER BY vrstni_red");
while ($row_grid = mysqli_fetch_assoc($sql_grid)) {
# priredimo naslov če prevajamo anketo
@@ -410,7 +411,7 @@ class ImageHotSpotController extends Controller
$row1['naslov'] = $naslov;
}
// preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
// ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -464,11 +465,10 @@ class ImageHotSpotController extends Controller
# izpišemo radio grida
if ($srv_grid['other'] != 0) {
- $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"missing ' . $cssAlign . '\">';
+ $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"missing\">';
# imamo missing vrednost
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<label for=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\">';
- //$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation=\"0\" onclick=\"checkChecked(this); checkTableMissing(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
//$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<span class="enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'"'.
@@ -479,7 +479,7 @@ class ImageHotSpotController extends Controller
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'</label>';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'</div>';
} else {
- $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"category ' . $cssAlign . '\">';
+ $htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<div class=\"category\">';
# ni missing vrednost
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
$htmltootip[$row1['id']] = $htmltootip[$row1['id']].'<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
@@ -576,7 +576,7 @@ class ImageHotSpotController extends Controller
$sql1 = sisplet_query("SELECT id, naslov, vrstni_red FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
$sqlR = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id='$row[id]' ");
- echo '<div id="hotspot_regions_hidden_menu_'.$row[id].'" style="display:none; ">';
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'" style="display:none; ">';
// Ali gre za sazu anketo
if(SurveyInfo::getInstance()->checkSurveyModule('sazu'))
@@ -621,35 +621,30 @@ class ImageHotSpotController extends Controller
# polovimo vrednosti gridov, prevedemo naslove in hkrati preverimo ali imamo missinge
$srv_grids = array();
$mv_count = 0; # koliko je stolpcev z manjkajočimi vrednostmi
- # če polje other != 0 je grid kot missing
- $sql_grid = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+
+ $sql_grid = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id='".$row['id']."' ORDER BY vrstni_red");
while ($row_grid = mysqli_fetch_assoc($sql_grid)) {
+
# priredimo naslov če prevajamo anketo
$naslov = Language::srv_language_grid($row['id'], $row_grid['id']);
+
if ($naslov != '') {
//$row_grid['naslov'] = $naslov;
$row_grid['vrstni_red'] = $naslov;
}
- $srv_grids[$row_grid['id']] = $row_grid;
- # če je označena kot manjkajoča jo prištejemo k manjkajočim
- if ($row_grid['other'] != 0) {
- $mv_count++;
- }
+ $srv_grids[$row_grid['id']] = $row_grid;
}
# Izpišemo TOP vrstico z labelami
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;
- }
// Datapiping
- $srv_grid['naslov'] = Helper::dataPiping($srv_grid['naslov']);
+ $srv_grid['region_name'] = Helper::dataPiping($srv_grid['region_name']);
}
}
@@ -674,18 +669,12 @@ class ImageHotSpotController extends Controller
if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
- if (count($srv_grids) > 0) {
- foreach ($srv_grids AS $i => $srv_grid) {
- if ($srv_grid['other'] != 0 && $srv_grids[$i]['id'] == $grid_id) {
- $is_missing = true;
- }
- }
- }
// Datapiping
$row1['naslov'] = Helper::dataPiping($row1['naslov']);
@@ -704,62 +693,41 @@ class ImageHotSpotController extends Controller
$first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
-
- if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
- $first_missing_value = false;
- }
$value = $srv_grids[$i]['id'];
- # izpišemo radio grida
- if ($srv_grid['other'] != 0) {
- $htmltootip[$row1['id']] .= '<div class=\"missing ' . $cssAlign . '\">';
- # imamo missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_grid_missing_value_' . $row1['id'] . '_grid_' . $value . '\" value=\"' . $value . '\"' . (($grid_id == $value && $grid_id != '') ? ' checked' : '') . ' data-calculation=\"0\" onclick=\"checkChecked(this); checkTableMissing(this); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRadioGrid(this, ' . $row1['id'] . ');\">';
+ $htmltootip[$row1['id']] .= '<div class=\"category\">';
+
+ // Za SAZU moramo posebej obarvati
+ if(SurveyInfo::getInstance()->checkSurveyModule('sazu')){
+ # ni missing vrednost
+ $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
+ $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRankingSazu(this, ' . $row1['id'] . ');\">';
$htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
'></span>';
- $htmltootip[$row1['id']] .= $srv_grid['naslov'];
+ //besedilo ob radio buttonu
+ $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
+
+ //besedilo ob radio buttonu - konec
+ $htmltootip[$row1['id']] .= '</label>';
+ }
+ else{
+ # ni missing vrednost
+ $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
+
+ $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRanking(this, ' . $row1['id'] . ');\">';
+ $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
+ ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
+ '></span>';
+ //besedilo ob radio buttonu
+ $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
+ //besedilo ob radio buttonu - konec
$htmltootip[$row1['id']] .= '</label>';
- $htmltootip[$row1['id']] .= '</div>';
- }
- else {
- $htmltootip[$row1['id']] .= '<div class=\"category ' . $cssAlign . '\">';
-
-
- // Za SAZU moramo posebej obarvati
- if(SurveyInfo::getInstance()->checkSurveyModule('sazu')){
- # ni missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRankingSazu(this, ' . $row1['id'] . ');\">';
- $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
- ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
- '></span>';
- //besedilo ob radio buttonu
- $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
-
- //besedilo ob radio buttonu - konec
- $htmltootip[$row1['id']] .= '</label>';
- }
- else{
- # ni missing vrednost
- $htmltootip[$row1['id']] .= '<label for=\"im_vrednost_' . $row1['id'] . '_grid_' . $value . '\">';
-
- $htmltootip[$row1['id']] .= '<input vrstni_red='.$srv_grid['vrstni_red'].' type=\"radio\" ' . (!$hideName ? ' name=\"vrednost_' . $row1['id'] . '\"' : '') . ' id=\"im_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); if (typeof checkBranching == \'function\'){checkBranching();} setCheckedClass(this, null, ' . $row1['id'] . '); mapdelovanjeRanking(this, ' . $row1['id'] . ');\">';
- $htmltootip[$row1['id']] .= '<span class=\"enka-checkbox-radio ' . (($row1['hidden'] == 2) ? ' answer-disabled' : '') .'\"'.
- ((Helper::getCustomCheckbox() != 0) ? (' style="font-size:' . Helper::getCustomCheckbox().'px;"') : '').
- '></span>';
- //besedilo ob radio buttonu
- $htmltootip[$row1['id']] .= $srv_grid['vrstni_red'];
- //besedilo ob radio buttonu - konec
- $htmltootip[$row1['id']] .= '</label>';
- }
- $htmltootip[$row1['id']] .= '</div>';
}
+
+ $htmltootip[$row1['id']] .= '</div>';
}
}