summaryrefslogtreecommitdiffstats
path: root/main/survey/app/Models/Model.php
diff options
context:
space:
mode:
Diffstat (limited to 'main/survey/app/Models/Model.php')
-rw-r--r--main/survey/app/Models/Model.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/main/survey/app/Models/Model.php b/main/survey/app/Models/Model.php
index dbeab7e..a87dde1 100644
--- a/main/survey/app/Models/Model.php
+++ b/main/survey/app/Models/Model.php
@@ -172,7 +172,7 @@ class Model
// Ce nismo v admin vmesniku (preview) ne shranjujemo vrstnega reda
- if(!isset($_GET['a']) || $_GET['a'] != 'preview_spremenljivka'){
+ if(!isset($_GET['a']) || ($_GET['a'] != 'preview_spremenljivka' && $_GET['a'] != 'showspremenljivkaSingleVarPopup')){
// Shranimo vrstni red ce imamo random
if($randomsort){
@@ -282,12 +282,14 @@ class Model
return $getOtherValue[$spremenljivka];
}
- $stringOther = "SELECT vre_id FROM srv_specialdata_vrednost WHERE spr_id='" . $spremenljivka . "' AND usr_id='" . get('usr_id') . "'";
+ $sqlOther = sisplet_query("SELECT vre_id FROM srv_specialdata_vrednost WHERE spr_id='" . $spremenljivka . "' AND usr_id='" . get('usr_id') . "'");
- $sqlOther = sisplet_query($stringOther);
- $rowOther = mysqli_fetch_assoc($sqlOther);
+ if(mysqli_num_rows($sqlOther) > 0){
+ $rowOther = mysqli_fetch_assoc($sqlOther);
+ return save('getOtherValue[' . $spremenljivka . ']', $rowOther['vre_id'], 1);
+ }
- return save('getOtherValue[' . $spremenljivka . ']', $rowOther['vre_id'], 1);
+ return false;
}
/**
@@ -301,7 +303,8 @@ class Model
"ON DUPLICATE KEY UPDATE vre_id='" . $vrednost . "'");
else
$sqlDelete = sisplet_query("DELETE from srv_specialdata_vrednost WHERE spr_id = '" . $spremenljivka . "' AND usr_id = '" . get('usr_id') . "'");
- return mysqli_affected_rows($GLOBALS['connect_db']);
+
+ return mysqli_affected_rows($GLOBALS['connect_db']);
}