diff options
Diffstat (limited to '')
-rw-r--r-- | admin/survey/classes/class.SurveyUserSession.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/admin/survey/classes/class.SurveyUserSession.php b/admin/survey/classes/class.SurveyUserSession.php index a839878..b23be27 100644 --- a/admin/survey/classes/class.SurveyUserSession.php +++ b/admin/survey/classes/class.SurveyUserSession.php @@ -39,12 +39,21 @@ class SurveyUserSession }
self::$ank_id = $anketa;
+ // Ce ni prijavljen v 1ko nastavimo usr_id na avtorja ankete, da se prikazejo njegovi grafi
+ if($global_user_id == -1){
+ SurveyInfo::getInstance()->SurveyInit(self::$ank_id);
+ $usr_id = SurveyInfo::getInstance()->getSurveyColumn("insert_uid");
+ }
+ else{
+ $usr_id = $global_user_id;
+ }
+
# preberemo vse nastavitve za to anketo - ce jih se nimamo
if (!is_countable(self::$dataArray) || count(self::$dataArray) == 0) {
- $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$global_user_id'");
+ $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$usr_id'");
$row = mysqli_fetch_array($sql);
- self::$dataArray = unserialize($row['data']);
+ self::$dataArray = ($row != null ? unserialize($row['data']) : array());
}
}
|