Subversion Repositories SmartDukaan

Rev

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

Rev 15219 Rev 15226
Line 19... Line 19...
19
 * admin_index method
19
 * admin_index method
20
 *
20
 *
21
 * @return void
21
 * @return void
22
 */
22
 */
23
	public function admin_index() {
23
	public function admin_index() {
-
 
24
		if ($this->request->is('post')) {
-
 
25
			alert('Clicked');
24
 
26
		}
25
		$this->Callhistory->recursive = 0;
27
		$this->Callhistory->recursive = 0;
26
		$this->Paginator->settings = array('order' => array('id'=>'desc'));
28
		$this->Paginator->settings = array('order' => array('id'=>'desc'));
-
 
29
 
27
		$this->set('callhistories', $this->Paginator->paginate());
30
		$this->set('callhistories', $this->Paginator->paginate());
28
	}
31
	}
29
 
32
 
30
/**
33
/**
31
 * admin_view method
34
 * admin_view method
Line 106... Line 109...
106
			$this->Session->setFlash(__('The callhistory has been deleted.'));
109
			$this->Session->setFlash(__('The callhistory has been deleted.'));
107
		} else {
110
		} else {
108
			$this->Session->setFlash(__('The callhistory could not be deleted. Please, try again.'));
111
			$this->Session->setFlash(__('The callhistory could not be deleted. Please, try again.'));
109
		}
112
		}
110
		return $this->redirect(array('action' => 'index'));
113
		return $this->redirect(array('action' => 'index'));
-
 
114
	}
-
 
115
	public function admin_search(){
-
 
116
		$date_from = $this->request->query('date_from');
-
 
117
		$date_to = $this->request->query('date_to');
-
 
118
		$this->Callhistory->recursive = 0;
-
 
119
		if(!empty($date_from) && !empty($date_to)){
111
	}}
120
			$sqlQuery = "SELECT c.id,c.retailer_id,c.agent_id,c.mobile_number,c.call_type,c.call_time,c.duration_sec,c.sms_verified,c.call_disposition,c.disposition_description,c.created, a.name FROM callhistory c join agents a on a.id=c.agent_id where date(call_time) between '$date_from' and '$date_to' order by id desc";
-
 
121
			$resul=$this->Callhistory->query($sqlQuery);	
-
 
122
		}
-
 
123
		$this->set('result', $resul);
-
 
124
	}
-
 
125
}