File: //home/cafsindia/crm_cafsindia_com/application/controllers/Closed_leads.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
class Closed_leads extends Secure_Controller{
public function __construct(){
parent::__construct('closed_leads');
$this->load->model('Closed_leads_model');
$this->load->model('Customer');
}
public function index(){
if(!$this->Appconfig->isAppvalid()){
redirect('config');
}
$data['table_headers'] = $this->xss_clean(get_closed_leads_table_headers());
$this->load->view('closed_leads/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'),
'General_Insurance' => FALSE,
'Portfolio' => FALSE,
'Health_Insurance' => FALSE,
'Mutual_Funds' => FALSE,
'Term_Plan' => FALSE );
$filledup = array_fill_keys($this->input->get('filters'), TRUE);
$filters = array_merge($filters, $filledup);
$all_leads = $this->Closed_leads_model->search($search, $filters, $limit, $offset, $sort, $order);
$total_rows = $this->Closed_leads_model->get_found_rows($search, $filters);
$data_rows = array();
foreach($all_leads->result() as $leads){
// $data_rows[] = $this->xss_clean(get_all_leads_data_row($leads, $this));
$data_rows[] = get_all_leads_data_row($leads, $this);
}
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
}
?>