%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/dashboard/models/ |
Current File : /home/ugotscom/public_html/dg/application/modules/dashboard/models/Dashboard_model.php |
<?php class Dashboard_model extends CI_Model{ public function get_count() { $user_id=$_SESSION['user_id']; $this->db->select('*'); $this->db->from('leads'); $this->db->where('added_by',$user_id); $query = $this->db->get(); return $query->num_rows(); } public function hot_leads() { $user_id=$_SESSION['user_id']; $this->db->select('*'); $this->db->from('leads'); $this->db->where('lead_type_id',1); $this->db->where('added_by',$user_id); $query = $this->db->get(); return $query->num_rows(); } public function closed_leads() { $user_id=$_SESSION['user_id']; $this->db->select('*'); $this->db->from('leads'); $this->db->where('lead_type_id',4); $this->db->where('added_by',$user_id); $query = $this->db->get(); return $query->num_rows(); } public function todaysfollowup() { $user_id=$_SESSION['user_id']; $today = date("Y-m-d"); $this->db->select('*'); $this->db->from('leads'); $this->db->where('followup_date',$today); $this->db->where('added_by',$user_id); $query = $this->db->get(); return $query->num_rows(); } public function totalno(){ $this->db->select('added_by, COUNT(added_by) as total'); $this->db->from('leads'); $this->db->group_by('added_by'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } public function closedtotalno(){ $this->db->select('added_by, COUNT(added_by) as total'); $this->db->from('leads'); $this->db->where('lead_type_id',4); $this->db->group_by('added_by'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } public function enquirytotal(){ $this->db->select('enquiry_source, COUNT(enquiry_source) as total'); $this->db->from('leads'); $this->db->group_by('enquiry_source'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } }