File: /home/cafsindia/crm_cafsindia_com/application/controllers/Incentives_report.php
<?php if ( ! defined('BASEPATH')) exit('No direct script is allowed');
require_once("Secure_Controller.php");
class Incentives_report extends Secure_Controller{
public function __construct(){
parent::__construct('incentives_report');
$this->load->model('Incentive_report_model');
}
public function index(){
if(!$this->Appconfig->isAppvalid()){
redirect('config');
}
$data['table_headers']=$this->xss_clean(incentives_report_table_headers());
$this->load->view('incentives_report/manage',$data);
}
public function search() {
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$filters = array('start_date' => $this->input->get('start_date'), 'end_date' => $this->input->get('end_date'));
$incentive_info = $this->Incentive_report_model->search($search, $filters, $limit, $offset, $sort, $order);
foreach($incentive_info as $incentive){
$data_rows[] = $this->xss_clean(incentives_report_table_data($incentive, $this));
}
echo json_encode(array('total' => "59", 'rows' => $data_rows));
}
/*
public function search(){
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$filters = array('start_date' => $this->input->get('start_date'),
'end_date' => $this->input->get('end_date'));
$incentives=$this->Incentive_report_model->search($search,$limit,$offset,$sort,$order);
$total_rows= $this->Incentive_report_model->get_found_rows($search);
$data_rows=array();
foreach($incentives->result() as $incentive){
$data_rows[]=incentives_report_table_data($incentive,$this);
}
$data_rows=$this->xss_clean($data_rows);
echo json_encode(array('total'=>$total_rows,'rows'=>$data_rows));
}
*/
}
?>