Subversion Repositories SmartDukaan

Rev

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

Rev 14969 Rev 15015
Line 20... Line 20...
20
	public $apihost;	
20
	public $apihost;	
21
	public $livepriceurl;
21
	public $livepriceurl;
22
 
22
 
23
	public function beforeFilter() {
23
	public function beforeFilter() {
24
		parent::beforeFilter();
24
		parent::beforeFilter();
25
		$this->Auth->allow('bycategory','category','mine','getdeals','getliveprice','search');
25
		$this->Auth->allow('bycategory','category','mine','getdeals','getliveprice','search','filter');
26
		$callback = $this->request->query('callback');	
26
		$callback = $this->request->query('callback');	
27
		$this->livepriceurl = Configure::read('livepriceurl');	
27
		$this->livepriceurl = Configure::read('livepriceurl');	
28
	}
28
	}
29
 
29
 
-
 
30
	public function filter($type='brand',$categoryId=3){
-
 
31
		$url = $this->apihost.'deals/brands/?category_id='.$categoryId;
-
 
32
		$brands = $this->make_request($url,null);
-
 
33
		$this->layout = 'innerpages';
-
 
34
		$this->set(compact('brands','categoryId'));
-
 
35
	}
-
 
36
 
30
	public function search() {
37
	public function search() {
31
		$userId = $this->request->query('user_id');
38
		$userId = $this->request->query('user_id');
32
		if(isset($userId) && !empty($userId)){
39
		if(isset($userId) && !empty($userId)){
33
			$this->loadModel('User');
40
			$this->loadModel('User');
34
			$dbuser = $this->User->findById($userId);
41
			$dbuser = $this->User->findById($userId);