Subversion Repositories SmartDukaan

Rev

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

Rev 15217 Rev 15232
Line 555... Line 555...
555
	public function admin_search() {
555
	public function admin_search() {
556
		$type = $this->request->query('type');
556
		$type = $this->request->query('type');
557
		$search = $this->request->query('search');
557
		$search = $this->request->query('search');
558
		$this->User->recursive = -1;
558
		$this->User->recursive = -1;
559
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
559
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
-
 
560
		if($type == 'unactivated'){
-
 
561
			$options['conditions'] = array('activated' =>0);
-
 
562
		}
560
		if(!empty($type) && !empty($search)){
563
		else if(!empty($type) && !empty($search)){
561
			$options['conditions'] = array($type.' LIKE '=>"%$search%");
564
			$options['conditions'] = array($type.' LIKE '=>"%$search%");			
562
			$this->Paginator->settings = $options;
565
		}else{
563
			$users = $this->Paginator->paginate();
566
			$options['conditions'] = array('date(created)'=>date('Y-m-d',time()));			
564
		}		
567
		}		
-
 
568
		$this->Paginator->settings = $options;
565
		// $groups = $this->User->Group->find('list');
569
		$users = $this->Paginator->paginate();		
566
		$this->set(compact('users'));	
570
		$this->set(compact('users'));	
567
	}
571
	}
568
 
572
 
569
	public function dashboard() {
573
	public function dashboard() {
570
		App::uses('CakeTime', 'Utility');
574
		App::uses('CakeTime', 'Utility');