Subversion Repositories SmartDukaan

Rev

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

Rev 17380 Rev 17386
Line 722... Line 722...
722
	}
722
	}
723
 
723
 
724
	public function admin_search() {
724
	public function admin_search() {
725
		$type = $this->request->query('type');
725
		$type = $this->request->query('type');
726
		$search = $this->request->query('search');
726
		$search = $this->request->query('search');
-
 
727
		
727
		$this->User->recursive = -1;
728
		$this->User->recursive = -1;
728
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
729
		$options = array('limit'=>100,'order'=>array('id'=>'desc'));
729
		if($type == 'unactivated'){
730
		if($type == 'unactivated'){
730
			$options['conditions'] = array('activated' =>0);
731
			$options['conditions'] = array('activated' =>0);
731
		}
732
		}
Line 734... Line 735...
734
				$options['conditions'] = array($type =>$search);			
735
				$options['conditions'] = array($type =>$search);			
735
			}else{
736
			}else{
736
				$options['conditions'] = array($type.' LIKE '=>"%$search%");			
737
				$options['conditions'] = array($type.' LIKE '=>"%$search%");			
737
			}
738
			}
738
		}else{
739
		}else{
-
 
740
			
739
			$options['conditions'] = array('date(User.created)'=>date('Y-m-d',time()));			
741
			$options['conditions'] = array('date(User.created)'=>'');			
740
		}	
742
		}	
741
		
743
		
742
		$sql = "SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ";
744
		$sql = "SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ";
743
		$last_act = $this->User->query($sql);
745
		$last_act = $this->User->query($sql);
744
		// debug($last_act);
746
		// debug($last_act);