Subversion Repositories SmartDukaan

Rev

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

Rev 19214 Rev 19238
Line 1249... Line 1249...
1249
		$limit = 20;
1249
		$limit = 20;
1250
		$offset = ($page - 1)*$limit;
1250
		$offset = ($page - 1)*$limit;
1251
		$this->layout = 'innerpages';
1251
		$this->layout = 'innerpages';
1252
		$url = Configure::read('nodeurl')."/getAllNotifications?user_id=".$user_id."&android_id=".$android_id."&offset=".$offset."&limit=".$limit;
1252
		$url = Configure::read('nodeurl')."/getAllNotifications?user_id=".$user_id."&android_id=".$android_id."&offset=".$offset."&limit=".$limit;
1253
		$noti= $this->make_request($url,null);
1253
		$noti= $this->make_request($url,null);
1254
		if(isset($noti) && !empty($noti))
1254
		if(isset($noti) && !empty($noti)){
1255
		{
-
 
1256
			foreach ($noti as $nkey => $nval){
1255
			foreach ($noti as $nkey => $nval){
1257
				if($nval["status"] == "sent" || $nval["status"] == "recieved" || $nval["status"] == "failed"){
1256
				if($nval["status"] == "sent" || $nval["status"] == "recieved" || $nval["status"] == "failed"){
1258
					$noti[$nkey]['seen'] = false;
1257
					$noti[$nkey]['seen'] = false;
1259
				}
1258
				}
1260
				if($nval["status"] == "opened" || $nval["status"] == "referrer" || $nval["status"] == "login"){
1259
				if($nval["status"] == "opened" || $nval["status"] == "referrer" || $nval["status"] == "login"){
1261
					$noti[$nkey]['seen'] = true;
1260
					$noti[$nkey]['seen'] = true;
1262
				}
1261
				}
1263
			}
1262
			}
-
 
1263
			$updateCountUrl = Configure::read('nodeurl')."/updateNotificationCount?user_id=".$user_id."&android_id=".$android_id;
-
 
1264
			$this->post_request($updateCountUrl,null);				
1264
		}		
1265
		}
1265
		$nexturl = "/users/getmorenotification?page=".($page+1);
1266
		$nexturl = "/users/getmorenotification?page=".($page+1);
1266
		$this->set(compact('noti','nexturl'));
1267
		$this->set(compact('noti','nexturl'));
1267
	}
1268
	}
1268
	
1269
	
1269
	public function getmorenotification(){
1270
	public function getmorenotification(){