MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/allyindian_com/sbltt/application/models/Homemodel.php
<?php
class Homemodel extends CI_Model{
	/*
	public function mis_life_chart(){
		$life_chart_info = $this->db->query("SELECT count(*) as tot_count,product_category,company,vendorcompanyname FROM sblt_leads_product INNER join sblt_vendor on vendor_id = company where product_category = '2' GROUP by company ORDER BY `tot_count` DESC");
		$life_chart_rslt = $life_chart_info->result_array();
		return $life_chart_rslt;
	}
	public function mis_hl_chart(){
		$life_chart_info = $this->db->query("SELECT count(*) as tot_count,product_category,company,vendorcompanyname FROM sblt_leads_product INNER join sblt_vendor on vendor_id = company where product_category = '3' GROUP by company ORDER BY `tot_count` DESC");
		$life_chart_rslt = $life_chart_info->result_array();
		return $life_chart_rslt;
	}

	public function crm_chart(){
		$emp_id     = $this->session->userdata('emp_id');
		$role_id    = $this->session->userdata('emp_role');
		if($role_id === "6"){
			$id       = $emp_id;
			$team     = $this->get_team_info($id);
			$emp_id = $team->teammembers.",".$id;
		}
		$crm_chart_info = $this->db->query("SELECT sblt_lead_type_info.lead_status,statusname,count(*) as lead_count,IFNULL(sum(expected_value),0) as crmvalue,IFNULL(sum(expected_login),0) as rmvalue FROM `sblt_lead_type_info` INNER JOIN sblt_lead_status on sblt_lead_status.status_id =  sblt_lead_type_info.lead_status where created_by in ($emp_id) and sblt_lead_type_info.lead_status != '3' GROUP by lead_status");
		$crm_chart_rslt = $crm_chart_info->result_array();
		return $crm_chart_rslt;
	}
	
	public function crm_chart_drill($lead_status){
		$emp_id     = $this->session->userdata('emp_id');
		$role_id    = $this->session->userdata('emp_role');
		if($role_id === "6"){
			$id       = $emp_id;
			$team     = $this->get_team_info($id);
			$emp_id = $team->teammembers.",".$id;
		}
		
		$crm_chart_info = $this->db->query("SELECT sblt_lead_type_info.prospect_level,prospect_name,count(*) as lead_count,IFNULL(sum(expected_value),0) as crmvalue,IFNULL(sum(expected_login),0) as rmvalue FROM `sblt_lead_type_info` INNER JOIN sblt_prospect_level on sblt_prospect_level.prospect_id = sblt_lead_type_info.prospect_level where created_by in ($emp_id) and lead_status = '$lead_status' GROUP by prospect_level");
		$crm_chart_rslt = $crm_chart_info->result_array();
		return $crm_chart_rslt;
	}
	
	public function get_team_info($id){
		$this->db->from('team');
		$this->db->where('teamleader', $id);
		$this->db->where('team.deleted',0);
		return $this->db->get()->row();
	}
	*/
}
?>