Subversion Repositories SmartDukaan

Rev

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

Rev 19357 Rev 19374
Line 578... Line 578...
578
 
578
 
579
	}
579
	}
580
	
580
	
581
	public function target(){
581
	public function target(){
582
		$this->layout = "innerpages";
582
		$this->layout = "innerpages";
583
		$user_id = $this->request->query('user_id');
-
 
584
		if($user_id == null || $user_id == ''){
-
 
585
			$user_id = $this->Auth->user('id');
583
		$user_id = $this->Auth->user('id');
586
		}
-
 
587
// 		if(isset($user_id) && !empty($user_id)) {
-
 
588
// 			$this->loadModel('User');
-
 
589
// 			$dbuser = $this->User->findById($user_id);
-
 
590
// 			$this->Auth->login($dbuser['User']);
-
 
591
// 		}
-
 
592
 
584
 
593
		$cachekey = 'target-'.$user_id;
585
		$cachekey = 'target-'.$user_id;
594
		$getoffer = Cache::read($cachekey,'target');
586
		$getoffer = Cache::read($cachekey,'target');
595
		$current_time = time();
587
		$current_time = time();
596
		$response = "";
588
		$response = "";
Line 634... Line 626...
634
		}
626
		}
635
		
627
		
636
		
628
		
637
		$this->loadModel('User');
629
		$this->loadModel('User');
638
		$user_email = "";
630
		$user_email = "";
639
		if($user_id != null || $user_id != ''){
-
 
640
			$opt = array('conditions'=>array('id'=>$user_id),'recursive'=>-1,'fields'=>'email');
-
 
641
			$usId = $this->User->find('first',$opt);
-
 
642
			$user_email = $usId['User']['email'];
-
 
643
		}
-
 
644
		
631
		
645
// 		$user_email = $this->Auth->user('email');
632
		$user_email = $this->Auth->user('email');
646
		$this->set(compact('response','maxpercentage','user_email'));
633
		$this->set(compact('response','maxpercentage','user_email'));
647
	}
634
	}
648
/**
635
/**
649
 * add method
636
 * add method
650
 *
637
 *