Subversion Repositories SmartDukaan

Rev

Rev 15503 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15503 Rev 15629
Line 111... Line 111...
111
 *
111
 *
112
 * @return void
112
 * @return void
113
 */
113
 */
114
	public function admin_index() {
114
	public function admin_index() {
115
		$this->SearchTerm->recursive = 0;
115
		$this->SearchTerm->recursive = 0;
-
 
116
		$data=$this->request->query('search');
-
 
117
		if(!empty($data)){
-
 
118
			$options = array('conditions' => array('SearchTerm.search_term LIKE '=> '%'.$data.'%'),'order'=>array('SearchTerm.id'=>'desc'));	
-
 
119
		}else{
116
		$this->Paginator->settings = array('order' => array('id'=>'desc'));
120
			$options = array('order' => array('id'=>'desc'));
-
 
121
		}		
-
 
122
		$this->Paginator->settings = $options;
117
		$this->set('searchTerms', $this->Paginator->paginate());
123
		$this->set('searchTerms', $this->Paginator->paginate());
118
	}
124
	}
119
 
125
 
120
/**
126
/**
121
 * admin_view method
127
 * admin_view method
Line 204... Line 210...
204
			$this->set('userId', $id);
210
			$this->set('userId', $id);
205
 
211
 
206
	}
212
	}
207
	public function admin_search($id=null){
213
	public function admin_search($id=null){
208
			$data=$this->request->query('search');
214
			$data=$this->request->query('search');
209
			$options = array('conditions' => array('SearchTerm.search_term LIKE '=> '%'.$data.'%'));
215
			$options = array('conditions' => array('SearchTerm.search_term LIKE '=> '%'.$data.'%'),'order'=>array('SearchTerm.id'=>'desc'));
210
			$list = $this->SearchTerm->find('all',$options);
216
			$list = $this->SearchTerm->find('all',$options);
211
			$this->set('searchTerms', $list);
217
			$this->set('searchTerms', $list);
212
			$this->set('search_term', $data);
218
			$this->set('search_term', $data);
213
	}
219
	}
214
}
220
}