<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sales_Representative_C extends CI_Controller {
	
	
	public function __construct()
	{
		parent::__construct();
		$this->load->model('Sales_Rep_Model');
		$this->load->model('Common_Model');
		$this->load->model('Warehouse_Model');
		$this->load->model('User_Group_Model');
		
				
	}

    var $main_menu_name = "people";
	var $sub_menu_name = "users";
	private $table = 'user';

	public function index()
	{
		$user_id=$this->session->userdata('ss_user_id'); 
		$current_user="Unknown";
		if($user_id){
		$current_user=$this->session->userdata('ss_user_id');
		
		}
		$sesdata = array(
		   'ss_user_username'  => '',
		   'ss_user_id'     => '',
		   'ss_group_id' => '',
		   'ss_warehouse_id' => '',-
		   'ss_user_first_name' => '',
		   'ss_user_last_name' => '',
		   'ss_user_group_name' => ''
		); 
		//insert user activity
		$this->Common_Model->add_user_activitie("Illegal Access by ".$current_user."- Logout User");
		$this->session->unset_userdata($sesdata);
		redirect(base_url(),'refresh');
		
	}
	
	
public function get_list_salse_rep_list($value='')
	{
			$warehouse_id=$this->input->get('WH');
	        $values = $this->Sales_Rep_Model->get_all_active_sales_rep($warehouse_id);
	        echo json_encode($values); 
	 }
	   
	
	
	
}