%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/public_html/dg/application/modules/chart/models/
Upload File :
Create Path :
Current File : /home/ugotscom/public_html/dg/application/modules/chart/models/Chart_model1.php

<?php

/**
* 
*/
class Chart_model extends CI_Model
{
	
	 public function getPersonas(){
		$this->db->select('name,user_id');
		$this->db->from('users');
		$query = $this->db->get();	
		
		return $query->result();
	}

	public function totalno(){
 $branch_id =$_SESSION['branch_id'];	
 $this->db->select('leads.added_by,users.name, COUNT(added_by) as total');
 $this->db->from('leads');
 $this->db->join('users',"users.user_id=leads.added_by","left");
 $this->db->where('leads.branch_id',$branch_id);
 $this->db->group_by('added_by'); 
 $this->db->order_by('total', 'desc'); 
 $query = $this->db->get();
 return $query->result();
 	

}
public function enquirytotal(){
 $branch_id =$_SESSION['branch_id'];	
 $this->db->select('leads.enquiry_source,enquiry_source.source, COUNT(enquiry_source) as total');
 $this->db->from('leads');
  $this->db->join('enquiry_source',"enquiry_source.enquiry_id=leads.enquiry_source","left");
 $this->db->where('leads.branch_id',$branch_id);
 $this->db->group_by('enquiry_source'); 
 $this->db->order_by('total', 'desc'); 
 $query = $this->db->get();
 $row = $query->result_array();
 return $row;	

}


	public function closedno(){
 $branch_id =$_SESSION['branch_id'];	
 $this->db->select('leads.added_by,leads.branch_id,leads.lead_type_id,users.name, COUNT(added_by) as total');
 $this->db->from('leads');
 $this->db->join('users',"users.user_id=leads.added_by","left");
  $this->db->where('leads.lead_type_id',4);
 $this->db->where('leads.branch_id',$branch_id);
 $this->db->group_by('added_by'); 
 $this->db->order_by('total', 'desc'); 
 $query = $this->db->get();
 return $query->result();
 	

}

}
  


Zerion Mini Shell 1.0