Subversion Repositories SmartDukaan

Rev

Rev 14579 | Rev 14855 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14579 Rev 14849
Line 81... Line 81...
81
			foreach ($activeNotificationRules as $key => $rule) {
81
			foreach ($activeNotificationRules as $key => $rule) {
82
				$sql = $rule['NotificationRule']['sql'];
82
				$sql = $rule['NotificationRule']['sql'];
83
				if(strpos($sql, '{uid}')!==false){
83
				if(strpos($sql, '{uid}')!==false){
84
					$sql = str_replace('{uid}', $user_id, $sql);
84
					$sql = str_replace('{uid}', $user_id, $sql);
85
				}
85
				}
-
 
86
				$this->log($sql,'webnotifications');
86
				$valid = $this->query($sql);
87
				$valid = $this->query($sql,'webnotifications');
87
				if(!empty($valid)){
88
				if(!empty($valid)){
88
					$activeNotifications[] = $rule;
89
					$activeNotifications[] = $rule;
89
				}
90
				}
90
			}
91
			}
91
		}
92
		}
92
		if(!empty($activeNotifications)){
93
		if(!empty($activeNotifications)){
93
			$randkey = array_rand($activeNotifications);
94
			$randkey = array_rand($activeNotifications);
-
 
95
			$this->log(print_r($activeNotifications,1),'webnotifications');
94
			return $activeNotifications[$randkey];
96
			return $activeNotifications[$randkey];
95
		}else{
97
		}else{
96
			return null;
98
			return null;
97
		}
99
		}
98
	}
100
	}