Subversion Repositories SmartDukaan

Rev

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

Rev 19670 Rev 19829
Line 125... Line 125...
125
		$userId = $this->request->query('user_id');
125
		$userId = $this->request->query('user_id');
126
		if(isset($userId) && !empty($userId)) {
126
		if(isset($userId) && !empty($userId)) {
127
			$this->loadModel('User');
127
			$this->loadModel('User');
128
			$dbuser = $this->User->findById($userId);
128
			$dbuser = $this->User->findById($userId);
129
			$this->Auth->login($dbuser['User']);
129
			$this->Auth->login($dbuser['User']);
130
		}			
130
		}
-
 
131
		$color = array('0'=>'#458ccc','1'=>'#44cbbc','2'=>'#a77189', '3'=>'#f9b931' ,'4' =>'#44cbbc', '5' => '#f48f3f' , '6'=>'#a77189');
131
		
132
		
132
		//Sort - type, ordering
133
		//Sort - type, ordering
133
		$sort = $this->request->query('sort');
134
		$sort = $this->request->query('sort');
134
		$direction = $this->request->query('direction');
135
		$direction = $this->request->query('direction');
135
		
136
		
Line 200... Line 201...
200
		}
201
		}
201
 
202
 
202
		//$filter = $this->request->query('filter');
203
		//$filter = $this->request->query('filter');
203
		// $brands = $this->request->query('brands');
204
		// $brands = $this->request->query('brands');
204
		if($id != 2) {
205
		if($id != 2) {
-
 
206
			if($id != 6){
-
 
207
 				$url = $this->apihost.'deals/brands/?category_id='.$categoryId;		
-
 
208
				$brandres = $this->make_request($url,null);
-
 
209
				$brandlist = array();
-
 
210
				foreach ($brandres as $bkey => $bvalue){
-
 
211
					$brandlist[$bvalue['brand_id']] = $bvalue['brand'];
-
 
212
				}
-
 
213
				$this->set(compact('brandlist'));
-
 
214
			}
205
			//Fetch deals
215
			//Fetch deals
206
			$likedDeals = $disLikedDeals = array();
216
			$likedDeals = $disLikedDeals = array();
207
			if(!empty($brands) && !empty($subcategories)){
217
			if(!empty($brands) && !empty($subcategories)){
208
				$filter = 'brand|subcategory';
218
				$filter = 'brand|subcategory';
209
			}			
219
			}			
Line 273... Line 283...
273
 
283
 
274
			$filterstr = '&brands='.$brands.'&subcategories='.$subcategories;
284
			$filterstr = '&brands='.$brands.'&subcategories='.$subcategories;
275
			$nexturl = "/categories/getdeals/".$id."/?page=".($page+1)."&sort=".$sort."&direction=".$direction."".$filterstr;			
285
			$nexturl = "/categories/getdeals/".$id."/?page=".($page+1)."&sort=".$sort."&direction=".$direction."".$filterstr;			
276
			
286
			
277
			$offerresponse = $this->getuseroffer();
287
			$offerresponse = $this->getuseroffer();
278
			$color = array('0'=>'#458ccc','1'=>'#44cbbc','2'=>'#a77189', '3'=>'#f9b931' ,'4' =>'#44cbbc', '5' => '#f48f3f' , '6'=>'#a77189');
-
 
-
 
288
			
279
			$this->set(compact('color','arrSubCategory','offerresponse','response_count','deals','id','likedDeals','disLikedDeals','page','sort','direction','notification','filter','brands','filterstr','subcategories','errorstr','nexturl','searchfor', 'searchableSubCategories', 'sortlabel'));
289
			$this->set(compact('color','arrSubCategory','offerresponse','response_count','deals','id','likedDeals','disLikedDeals','page','sort','direction','notification','filter','brands','filterstr','subcategories','errorstr','nexturl','searchfor', 'searchableSubCategories', 'sortlabel'));
280
		}else{
290
		}else{
281
			//Check for apk support of sharing
291
			//Check for apk support of sharing
282
			$sharable = 0;
292
			$sharable = 0;
283
			if(isset($_COOKIE['shareApps']) && !empty($_COOKIE['shareApps'])) {
293
			if(isset($_COOKIE['shareApps']) && !empty($_COOKIE['shareApps'])) {