Subversion Repositories SmartDukaan

Rev

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

Rev 15378 Rev 15380
Line 28... Line 28...
28
		$this->set('title_for_layout','Profittill Bookmarklet');
28
		$this->set('title_for_layout','Profittill Bookmarklet');
29
	}
29
	}
30
 
30
 
31
	public function mywallet() {
31
	public function mywallet() {
32
		$userId = $this->request->query('user_id');
32
		$userId = $this->request->query('user_id');
33
		$tokenValidated = $this->checkToken();
33
		$tokenValidated = $this->checkToken($userId);
34
		if(isset($userId) && !empty($userId) && $tokenValidated){	
34
		if(isset($userId) && !empty($userId) && $tokenValidated){	
35
			$next = "/my-wallet";					
35
			$next = "/my-wallet";					
36
			$redirectUrl = $this->getAutoLoginUrl($userId,$next);
36
			$redirectUrl = $this->getAutoLoginUrl($userId,$next);
37
			// header('location:'.$redirectUrl);
37
			$this->log($redirectUrl,'headers');
38
			// exit();
-
 
39
			$this->layout = 'innerpages';
38
			$this->layout = 'innerpages';
40
			$this->set(compact('redirectUrl'));
39
			$this->set(compact('redirectUrl'));
41
		}else{
40
		}else{
42
			$this->redirect(array('controller'=>'special','action'=>'native','login'));
41
			$this->redirect(array('controller'=>'special','action'=>'native','login'));
43
		}
42
		}
Line 569... Line 568...
569
		}else{
568
		}else{
570
			$options['conditions'] = array('date(created)'=>date('Y-m-d',time()));			
569
			$options['conditions'] = array('date(created)'=>date('Y-m-d',time()));			
571
		}		
570
		}		
572
		$this->Paginator->settings = $options;
571
		$this->Paginator->settings = $options;
573
		$users = $this->Paginator->paginate();		
572
		$users = $this->Paginator->paginate();		
574
		$sql = "SELECT DATE( created ) , referrer, COUNT( id ) FROM users WHERE DATEDIFF( NOW( ) , created ) =1 AND referrer IS NOT NULL GROUP BY DATE( created ) , referrer";
-
 
575
		$lastdayactivations = $this->User->query($sql);
-
 
-
 
573
		
576
		$this->set(compact('users','lastdayactivations'));	
574
		$this->set(compact('users'));	
577
	}
575
	}
578
 
576
 
579
	public function dashboard() {
577
	public function dashboard() {
580
		App::uses('CakeTime', 'Utility');
578
		App::uses('CakeTime', 'Utility');
581
		$user = $this->User->read(null,$this->Auth->user('id'));
579
		$user = $this->User->read(null,$this->Auth->user('id'));