Subversion Repositories SmartDukaan

Rev

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

Rev 19811 Rev 19883
Line 1282... Line 1282...
1282
			$this->post_request($updateCountUrl,null);				
1282
			$this->post_request($updateCountUrl,null);				
1283
		}
1283
		}
1284
		else{
1284
		else{
1285
			$this->render('/Elements/nonotification');
1285
			$this->render('/Elements/nonotification');
1286
		}
1286
		}
1287
		$nexturl = "/users/getmorenotification?page=".($page+1);
1287
		$nexturl = "/users/getmorenotification?page=".($page+1)."&user_id=".$user_id."&android_id=".$android_id;
1288
		$this->set(compact('noti','nexturl'));
1288
		$this->set(compact('noti','nexturl'));
1289
	}
1289
	}
1290
	
1290
	
1291
	public function getmorenotification(){
1291
	public function getmorenotification(){
1292
		$this->layout = 'ajax';
1292
		$this->layout = 'ajax';
1293
		$page = $this->request->query('page');
1293
		$page = $this->request->query('page');
-
 
1294
		$android_id = $this->request->query('android_id');
-
 
1295
		$user_id = $this->request->query('user_id');
1294
		if(!isset($page)){
1296
		if(!isset($page)){
1295
			$page = 1;
1297
			$page = 1;
1296
		}
1298
		}
1297
		$limit = 20;
1299
		$limit = 20;
1298
		$offset = ($page - 1)*$limit;
1300
		$offset = ($page - 1)*$limit;
1299
		$url = Configure::read('nodeurl')."/getAllNotifications?user_id=".$user_id."&android_id=".$android_id."&offset=".$offset."&limit=".$limit;
1301
		$url = Configure::read('nodeurl')."/getAllNotifications?user_id=".$user_id."&android_id=".$android_id."&offset=".$offset."&limit=".$limit;
1300
		$noti= $this->make_request($url,null);
1302
		$noti= $this->make_request($url,null);
1301
		debug($noti);
-
 
1302
		if(isset($noti) && !empty($noti))
1303
		if(isset($noti) && !empty($noti))
1303
		{
1304
		{
1304
			foreach ($noti as $nkey => $nval){
1305
			foreach ($noti as $nkey => $nval){
1305
				if($nval["status"] == "sent" || $nval["status"] == "recieved" || $nval["status"] == "failed"){
1306
				if($nval["status"] == "sent" || $nval["status"] == "recieved" || $nval["status"] == "failed"){
1306
					$noti[$nkey]['seen'] = false;
1307
					$noti[$nkey]['seen'] = false;
Line 1308... Line 1309...
1308
				if($nval["status"] == "opened" || $nval["status"] == "referrer" || $nval["status"] == "login"){
1309
				if($nval["status"] == "opened" || $nval["status"] == "referrer" || $nval["status"] == "login"){
1309
					$noti[$nkey]['seen'] = true;
1310
					$noti[$nkey]['seen'] = true;
1310
				}
1311
				}
1311
			}
1312
			}
1312
		}
1313
		}
1313
		$nexturl = "/users/getmorenotification?page=".($page+1);
1314
		$nexturl = "/users/getmorenotification?page=".($page+1)."&user_id=".$user_id."&android_id=".$android_id;
1314
		$this->set(compact('noti','nexturl'));
1315
		$this->set(compact('noti','nexturl'));
1315
		$this->render('/Elements/getnotification');
1316
		$this->render('/Elements/getnotification');
1316
	}
1317
	}
1317
	
1318
	
1318
	public function sendseen($cid = null){
1319
	public function sendseen($cid = null){