Subversion Repositories SmartDukaan

Rev

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

Rev 14654 Rev 14734
Line 192... Line 192...
192
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
192
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
193
		}
193
		}
194
		return $this->redirect(array('action' => 'index'));
194
		return $this->redirect(array('action' => 'index'));
195
	}
195
	}
196
 
196
 
-
 
197
	public function admin_by($userId = null) {		
-
 
198
		$this->Click->recursive = 0;
-
 
199
		$q = $this->request->query('q');
-
 
200
		if(isset($q) && !empty($q)){
-
 
201
			$options = array('conditions' => array('Click.user_id' => $userId, 'Click.url LIKE'=>'%'.$q.'%'),'order'=>array('id'=>'desc'),'limit' => 100);
-
 
202
 			$this->set(compact('q'));
-
 
203
		} else {
-
 
204
			$options = array('conditions' => array('Click.user_id' => $userId),'order'=>array('id'=>'desc'),'limit' => 100);
-
 
205
 		}
-
 
206
		$this->Paginator->settings = $options;
-
 
207
		$clicks = $this->Paginator->paginate();		
-
 
208
		$this->set(compact('clicks'));
-
 
209
	}
-
 
210
 
197
/**
211
/**
198
 * admin_index method
212
 * admin_index method
199
 *
213
 *
200
 * @return void
214
 * @return void
201
 */
215
 */
202
	public function admin_index() {
216
	public function admin_index() {
203
		$this->Click->recursive = 0;
217
		$this->Click->recursive = 0;
-
 
218
		$q = $this->request->query('q');
-
 
219
		if(isset($q) && !empty($q)){
-
 
220
			$this->Paginator->settings = array('conditions' => array('Click.url LIKE'=>'%'.$q.'%'),'order' => array('id'=>'desc'));
-
 
221
 			$this->set(compact('q'));
-
 
222
		} else {
-
 
223
			$this->Paginator->settings = array('order' => array('id'=>'desc'));
-
 
224
 		}
204
		$this->set('clicks', $this->Paginator->paginate());
225
		$this->set('clicks', $this->Paginator->paginate());
205
	}
226
	}
206
 
227
 
207
/**
228
/**
208
 * admin_view method
229
 * admin_view method