<?php
class Sales_Rep_Model extends CI_Model {
	 private $tableName = 'user';
  
  
  function __construct() 
  {
   		/* Call the Model constructor */
    	parent::__construct();
        $this->load->database();
        $this->load->helper('url');
        //$this->load->library(array('email'));
  }
  
  	function get_all_active_sales_rep($warehouse_id)
	
	{
		$this->db->select($this->tableName.'.user_id');
		$this->db->select($this->tableName.'.user_first_name');
		$this->db->from($this->tableName);
		$this->db->order_by("user_id", "asc");
		$this->db->where("user_status",1);
		$this->db->where("warehouse_id",$warehouse_id);
		
		
		$this->db->where("group_id", 4);		
		$query = $this->db->get();
		$data=array();
		
		
		
		foreach ($query->result() as $row)
		{
			$data[$row->user_id] = $row->user_first_name;
		}
			return ($data);
		
	}

	
}