Subversion Repositories SmartDukaan

Rev

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

Rev 20056 Rev 20070
Line 22... Line 22...
22
/**
22
/**
23
 * admin_index method
23
 * admin_index method
24
 *
24
 *
25
 * @return void
25
 * @return void
26
 */
26
 */
27
	public function admin_index() {
27
	public function admin_index($agent_id = null) {
28
// 		throw new NotFoundException(__('Unauthorized access'));
28
// 		throw new NotFoundException(__('Unauthorized access'));
29
		if ($this->request->is('post')) {
29
		if ($this->request->is('post')) {
30
			alert('Clicked');
30
			alert('Clicked');
31
		}
31
		}
32
		$cur_date = date('Y-m-d', time());
32
		$cur_date = date('Y-m-d', time());
-
 
33
		$newdate = date('Y-m-d', strtotime(' -1 day'));
-
 
34
		if(date('D',time()) == 'Sun'){
-
 
35
			$newdate = date('Y-m-d', strtotime(' -2 day'));
-
 
36
		}elseif(date('D',strtotime(' -1 day')) == 'Sun'){
-
 
37
			$newdate = date('Y-m-d', strtotime(' -2 day'));
-
 
38
		} 
33
		$this->Callhistory->recursive = 0;
39
		$this->Callhistory->recursive = 0;
-
 
40
		if($agent_id == null){
34
		$this->Paginator->settings = array('order' => array('id'=>'desc'),'conditions' => array('call_time  LIKE'=>"%$cur_date%" ,'Callhistory.agent_id >' => 2));
41
			$this->Paginator->settings = array('order' => array('id'=>'desc'),'conditions' => array('Callhistory.call_time >'=>$newdate,'Callhistory.agent_id >' => 2),'limit' => 100);
-
 
42
		}else{
-
 
43
			$this->Paginator->settings = array('order' => array('id'=>'desc'),'conditions' => array('Callhistory.call_time >'=>$newdate,'Callhistory.agent_id ' => $agent_id),'limit' => 100);
-
 
44
		}
-
 
45
		
35
 
46
 
36
		$this->set('callhistories', $this->Paginator->paginate());
47
		$this->set('callhistories', $this->Paginator->paginate());
37
	}
48
	}
38
 
49
 
39
/**
50
/**