File: /home/cafsindia/allyindian_com/sbltt/application/controllers/Software_update.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
class Software_update extends Secure_Controller
{
public function __construct()
{
parent::__construct('software_update');
$this->load->model('Software_update_model');
}
public function index()
{
if(!$this->Appconfig->isAppvalid()){
redirect('config');
}
$data['table_headers'] = $this->xss_clean(get_software_update_table_headers());
$this->load->view('software_update/manage', $data);
}
/*
Returns Supplier table data rows. This will be called with AJAX.
*/
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('crm' => $this->input->get('crm'),
'crmto' => $this->input->get('crmto'));
$all_leads = $this->Software_update_model->search($search, $filters, $limit, $offset, $sort, $order);
$total_rows = $this->Software_update_model->get_found_rows($search, $filters);
$data_rows = array();
foreach($all_leads->result() as $leads){
$data_rows[] = get_transfer_data_row($leads, $this);
}
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
/*
This abstrack_report
*/
public function software_update(){
$filters = array('start_date' => $this->input->post('start_date'), 'end_date' => $this->input->post('end_date'));
$result = $this->Software_update_model->software_update($filters);
echo json_encode(array('success' => TRUE, 'result' => $result));
}
public function software_update_chart($start,$end){
$start = $_REQUEST['start'];
$end = $_REQUEST['end'];
$result = $this->Software_update_model->software_update_chart($start,$end);
$rows['type'] = 'pie';
$rows['name'] = 'Company';
foreach ($result as $key => $value) {
$rows['data'][] = array('Total Operation', $value['tot_op']);
$rows['data'][] = array('Vehicle Not Assigned', $value['assigned']);
$rows['data'][] = array('Operation Cancelled', $value['book_cancel']);
}
$rslt = array();
array_push($rslt,$rows);
print json_encode($rslt, JSON_NUMERIC_CHECK);
}
}
?>