Subversion Repositories SmartDukaan

Rev

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

Rev 19941 Rev 19991
Line 121... Line 121...
121
 * @return void
121
 * @return void
122
 */
122
 */
123
	public function view($id = null) {
123
	public function view($id = null) {
124
		$arrSubCategory = Configure::read('arrSubCategory');
124
		$arrSubCategory = Configure::read('arrSubCategory');
125
		$userId = $this->request->query('user_id');
125
		$userId = $this->request->query('user_id');
-
 
126
		$dealpin = $this->getpin();
-
 
127
// 		$this->set(compact('dealpin'));
-
 
128
	
126
		if(isset($userId) && !empty($userId)) {
129
		if(isset($userId) && !empty($userId)) {
127
			$this->loadModel('User');
130
			$this->loadModel('User');
128
			$dbuser = $this->User->findById($userId);
131
			$dbuser = $this->User->findById($userId);
129
			$this->Auth->login($dbuser['User']);
132
			$this->Auth->login($dbuser['User']);
130
		}
133
		}
Line 240... Line 243...
240
			else if ($sort=='available_price' && $direction==1){
243
			else if ($sort=='available_price' && $direction==1){
241
				$sortlabel  = 'pricelow';
244
				$sortlabel  = 'pricelow';
242
			}
245
			}
243
			
246
			
244
			$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction,$filter,$brands,$subcategories);
247
			$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction,$filter,$brands,$subcategories);
-
 
248
			$url = $url."&pin=".$dealpin;
245
			$response = $this->make_request($url,null);
249
			$response = $this->make_request($url,null);
246
			$deals = array();
250
			$deals = array();
247
			
251
			
248
			$response_count =1;
252
			$response_count =1;
249
			if($response == '')
253
			if($response == '')
Line 339... Line 343...
339
		$this->layout = 'ajax';
343
		$this->layout = 'ajax';
340
		$page = $this->request->query('page');
344
		$page = $this->request->query('page');
341
		if(!isset($page)){
345
		if(!isset($page)){
342
			$page = 1;
346
			$page = 1;
343
		}
347
		}
-
 
348
		$dealpin = $this->getpin();
344
		$sort = $this->request->query('sort');
349
		$sort = $this->request->query('sort');
345
		$direction = $this->request->query('direction');
350
		$direction = $this->request->query('direction');
346
		// $filter = $this->request->query('filter');
351
		// $filter = $this->request->query('filter');
347
		// $brands = $this->request->query('brands');
352
		// $brands = $this->request->query('brands');
348
		$brands = $this->request->query('brands');
353
		$brands = $this->request->query('brands');
Line 358... Line 363...
358
		else if(!empty($subcategories)){
363
		else if(!empty($subcategories)){
359
			$filter = 'subcategory';
364
			$filter = 'subcategory';
360
		}
365
		}
361
		
366
		
362
		$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction,$filter,$brands,$subcategories);
367
		$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction,$filter,$brands,$subcategories);
-
 
368
		$url = $url."&pin=".$dealpin;
363
		$response = $this->make_request($url,null);
369
		$response = $this->make_request($url,null);
364
		$deals = array();
370
		$deals = array();
365
		if(!empty($response)){
371
		if(!empty($response)){
366
			foreach ($response as $key => $value) {
372
			foreach ($response as $key => $value) {
367
				if(!empty($value)){
373
				if(!empty($value)){