Subversion Repositories SmartDukaan

Rev

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

Rev 14954 Rev 14964
Line 13... Line 13...
13
 *
13
 *
14
 * @var array
14
 * @var array
15
 */
15
 */
16
	public $components = array('Paginator');
16
	public $components = array('Paginator');
17
 
17
 
-
 
18
	public function beforeFilter() {		
-
 
19
		parent::beforeFilter();
-
 
20
		$this->Auth->allow('notificationactive');
-
 
21
		$this->apihost = Configure::read('pythonapihost');
-
 
22
	}
18
/**
23
/**
19
 * index method
24
 * index method
20
 *
25
 *
21
 * @return void
26
 * @return void
22
 */
27
 */
Line 273... Line 278...
273
		}
278
		}
274
		$this->set('notificationId',$id);
279
		$this->set('notificationId',$id);
275
		$this->set('sortdata', $userActions);
280
		$this->set('sortdata', $userActions);
276
	}
281
	}
277
 
282
 
278
	public function admin_notificationactive(){
283
	public function notificationactive(){
279
			$cid = $this->request->query('cid');
284
		$cid = $this->request->query('cid');
280
			$options = array('conditions' => array('id'=> $cid,'expiresAt >'=>date('Y-m-d H:i:s',time())));
285
		$options = array('conditions' => array('id'=> $cid,'expiresAt >'=>date('Y-m-d H:i:s',time())));
281
			$count = $this->NotificationCampaign->find('count',$options);
286
		$count = $this->NotificationCampaign->find('count',$options);
282
			
287
		
283
			if(!$count){
288
		if(!$count){
284
				$result = array('success'=>false);
289
			$result = array('success'=>false);
285
			}else{
290
		}else{
286
				$result = array('success'=>true);
291
			$result = array('success'=>true);
287
			}
-
 
288
			
-
 
289
			$this->response->type('json');
-
 
290
			$this->layout = 'ajax';
-
 
291
			$this->set(array(
-
 
292
			    'result' => $response,
-
 
293
			    '_serialize' => array('result')
-
 
294
			));
-
 
295
			$this->render('/Elements/json');
-
 
296
		}
292
		}
-
 
293
		
-
 
294
		$this->response->type('json');
-
 
295
		$this->layout = 'ajax';
-
 
296
		$this->set(array(
-
 
297
		    'result' => $result,
-
 
298
		    '_serialize' => array('result')
-
 
299
		));
-
 
300
		$this->render('/Elements/json');
-
 
301
	}
297
}
302
}
298
303