for a CI System,i have a reseller table and Users tables. each user is mapped to its reseller by a field called KEY which is unique string. It's in both users table and reseller's table each user(record) has a reseller key mapped to it. I hope you understood the concept. Now i want to create a view for admin. Currently i show the list of reseller
and list of users,Now how to create a view in which when i click on reseller
i can see only his reseller?
here i fetch all the reseller in index
function how to filter based on key
public function index ()
{
$usertype=$this->session->userdata('usertype');
if($usertype ==="admin")
{
// Fetch all users
$this->data['users'] = $this->reseller_m->get();
// Load view
$this->data['subview'] = 'admin/reseller/index';
$this->load->view('admin/_layout_main', $this->data);
}
else
{
$this->load->view('permission');
}
}