File: /home/cafsindia/login_cafsindia_com/application/controllers/Health_reconcilation.php
<?php if ( ! defined('BASEPATH')) exit('No direct script is allowed');
require_once("Action_controller.php");
class Health_reconcilation extends Action_controller{
public function __construct(){
parent::__construct('health_reconcilation');
$this->collect_base_info();
}
// LOAD PAGE QUICK LINK,FILTERS AND TABLE HEADERS
public function index(){
$data['quick_link'] = $this->quick_link;
$data['table_head'] = $this->table_head;
$data['master_pick'] = $this->master_pick;
$data['fliter_list'] = $this->fliter_list;
$this->load->view("$this->control_name/manage",$data);
}
public function health_reconcilation_sts(){
$start_date = $this->input->post("start_date");
$end_date = $this->input->post("end_date");
$health_reconcilation_qry = 'SELECT cw_payment_mode.payment_mode,cw_health_product.product_name,cw_health_company.company_name,DATE_FORMAT(cw_health_renewals_log.renewed_date,"%d-%m-%Y") as renewed_date,cw_health_renewals_log.renewal_mode,renewal_premium_amount,renewal_plus_on_premium as renewal_add_on_premium,renewal_gst,renewal_net_premium,renewal_total_premium,renewal_covered_year,renewal_sum_insured,renewal_policy_no,cw_health_renewals.proposer_name,contact_number from cw_health_renewals inner JOIN cw_health_renewals_log on cw_health_renewals_log.prime_health_renewals_id = cw_health_renewals.prime_health_renewals_id inner JOIN cw_health_product on cw_health_product.prime_health_product_id = cw_health_renewals.product inner join cw_health_company on cw_health_company.prime_health_company_id = cw_health_renewals.company INNER JOIN cw_payment_mode on cw_payment_mode.prime_payment_mode_id = cw_health_renewals.payment_mode where cw_health_renewals_log.renewed_date >="'.$start_date.'" AND cw_health_renewals_log.renewed_date <= "'.$end_date.'" ORDER BY cw_health_renewals_log.renewed_date ASC';
$health_reconsilation_info = $this->db->query("CALL sp_a_run ('SELECT','$health_reconcilation_qry')");
$health_reconsilation_result = $health_reconsilation_info->result_array();
$health_reconsilation_info->next_result();
if($health_reconsilation_result){
echo json_encode(array('success' => TRUE,'health_reconsilation_result' => $health_reconsilation_result));
}else{
echo json_encode(array('success' => FALSE,'message' => "No Data Available"));
}
}
}
?>