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/Models/Model.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/Models/Model.php')
-rw-r--r-- | main/survey/app/Models/Model.php | 15 |
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']);
}
|