Subversion Repositories SmartDukaan

Rev

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

Rev 17683 Rev 17695
Line 208... Line 208...
208
			$this->loadModel('NotificationRule');
208
			$this->loadModel('NotificationRule');
209
			$notification = $this->NotificationRule->getNotification($this->Auth->User('id'));	
209
			$notification = $this->NotificationRule->getNotification($this->Auth->User('id'));	
210
		    $filterstr = '';
210
		    $filterstr = '';
211
			if(isset($filter) && !empty($filter)){
211
			if(isset($filter) && !empty($filter)){
212
			    $filterstr = '&filter='.$filter.'&brands='.$brands.'&subcategories='.$subcategories;
212
			    $filterstr = '&filter='.$filter.'&brands='.$brands.'&subcategories='.$subcategories;
-
 
213
		  	} 
-
 
214
 
-
 
215
		  	$get_url = "'".$_SERVER['REQUEST_URI']."'";
-
 
216
		  	$urlArray = explode('=',$_SERVER['REQUEST_URI']);
-
 
217
		  	$last = $urlArray[sizeof($urlArray)-1];
-
 
218
		  	
-
 
219
		  	if(!isset($filter) && empty($filter)){
-
 
220
		  		if (strpos($get_url,'filter=brand&brands') !== false)
-
 
221
		  		{
-
 
222
		  			$filterstr= "&filter=brand&brands=".$last;
-
 
223
		  		}
-
 
224
		  		if (strpos($get_url,'filter=subcategory&subcategories') !== false)
-
 
225
		  		{
-
 
226
		  			$filterstr= "&filter=subcategory&subcategories=".$last;
-
 
227
    			// echo "url",$url;
-
 
228
 
-
 
229
		  		}
-
 
230
 
213
		  	} 	  	
231
		  	} 	  	
214
			$this->set(compact('response_count','deals','id','likedDeals','disLikedDeals','page','sort','direction','notification','filter','brands','filterstr','brandschosen','subcategories','subcategorieschosen'));
232
			$this->set(compact('response_count','deals','id','likedDeals','disLikedDeals','page','sort','direction','notification','filter','brands','filterstr','brandschosen','subcategories','subcategorieschosen'));
215
		}else{
233
		}else{
216
			//Check for apk support of sharing
234
			//Check for apk support of sharing
217
			$sharable = 0;
235
			$sharable = 0;
Line 250... Line 268...
250
			$this->render('/Elements/nooffers');
268
			$this->render('/Elements/nooffers');
251
		}		
269
		}		
252
	}
270
	}
253
 
271
 
254
	public function getdeals($id = null) {
272
	public function getdeals($id = null) {
-
 
273
	
255
		$this->log('getdeal id '.$id,'api');
274
		$this->log('getdeal id '.$id,'api');
256
		$likedDeals = $disLikedDeals = array();
275
		$likedDeals = $disLikedDeals = array();
257
		$this->layout = 'ajax';
276
		$this->layout = 'ajax';
258
		$page = $this->request->query('page');
277
		$page = $this->request->query('page');
259
		if(!isset($page)){
278
		if(!isset($page)){
Line 293... Line 312...
293
					$disLikedDeals[$value['UserAction']['store_product_id']] = $value['UserAction']['id'];
312
					$disLikedDeals[$value['UserAction']['store_product_id']] = $value['UserAction']['id'];
294
				}
313
				}
295
			}
314
			}
296
		}
315
		}
297
		$filterstr = '';
316
		$filterstr = '';
-
 
317
 
-
 
318
		$get_url = "'".$_SERVER['REQUEST_URI']."'";
-
 
319
		$urlArray = explode('=',$_SERVER['REQUEST_URI']);
-
 
320
		$last = $urlArray[sizeof($urlArray)-1];
-
 
321
 
-
 
322
		if(!isset($filter) && empty($filter)){
-
 
323
			if (strpos($get_url,'filter=brand&brands') !== false)
-
 
324
			{
-
 
325
				$filterstr= "&filter=brand&brands=".$last;
-
 
326
			}
-
 
327
			if (strpos($get_url,'filter=subcategory&subcategories') !== false)
-
 
328
			{
-
 
329
				$filterstr= "&filter=subcategory&subcategories=".$last;
-
 
330
			}
-
 
331
 
-
 
332
		} 	  	
-
 
333
 
298
		if(isset($filter) && !empty($filter)){
334
		if(isset($filter) && !empty($filter)){
299
		    $filterstr = '&filter='.$filter.'&brands='.$brands;
335
		    $filterstr = '&filter='.$filter.'&brands='.$brands;
300
	  	} 
336
	  	} 
301
		$this->set(compact('deals','id','page','likedDeals','disLikedDeals','sort','direction','brands','filter','filterstr'));
337
		$this->set(compact('deals','id','page','likedDeals','disLikedDeals','sort','direction','brands','filter','filterstr'));
302
		if(!empty($deals) && !empty($deals[0])){
338
		if(!empty($deals) && !empty($deals[0])){
303
			$this->render('/Elements/deals');
339
			$this->render('/Elements/deals');
304
		}else{
340
		}else{
305
			$this->render('/Elements/nodeals');
341
			$this->render('/Elements/nodeals');
306
		}
342
		}
-
 
343
 
-
 
344
 
-
 
345
 
307
	}
346
	}
308
/**
347
/**
309
 * add method
348
 * add method
310
 *
349
 *
311
 * @return void
350
 * @return void