File: /home/cafsindia/hrms_cafsinfotech_in/OLD/application_bk/controllers/Transaction_count.php
<?php if ( ! defined('BASEPATH')) exit('No direct script is allowed');
require_once("Action_controller.php");
class Transaction_count extends Action_controller{
public function __construct(){
parent::__construct('transaction_count');
if(!$this->Appconfig->isAppvalid()){
redirect('config');
}
}
// LOAD PAGE WITH TABLE DATA
public function index(){
$data['table_headers']= $this->xss_clean(get_process_month_headers());
$this->load->view("$this->control_name/manage",$data);
}
//LOAD PAGE TABLE VIEW WITH DATA BASED ON SEARCH FILTERS
public function search(){
$search_query = 'select transactions_month,trans_status FROM `cw_transactions` WHERE trans_status= 1 group by transactions_month';
$search_data = $this->db->query("CALL sp_a_run ('SELECT','$search_query')");
$search_result = $search_data->result();
$num_rows = $search_data->num_rows();
$search_data->next_result();
$data_rows = array();
foreach ($search_result as $search){
$data_rows[]=get_process_month_data_row($search,$this);
}
echo json_encode(array('total'=>$num_rows,'rows'=>$data_rows));
}
}
?>