public function edit_user($id) { $user = Users::getUser($id); $data['user'] = $user; $data['title'] = "User Management::Edit " . $user->Name . "'s Details"; $data['title'] = "User Management::Add New User"; $data['module_view'] = "add_user_view"; $data['levels'] = Access_Level::getAll(); $data['districts'] = District::getAll(); $data['provinces'] = Province::getAll(); $this->base_params($data); }
public function edit() { $access_level = $this->session->userdata('user_indicator'); $user_type = "1"; $facilities = ""; //If user is a super admin, allow him to add only facilty admin and nascop pharmacist if ($access_level == "system_administrator") { $user_type = "indicator='nascop_pharmacist' or indicator='facility_administrator'"; $facilities = Facilities::getAll(); } else { if ($access_level == "facility_administrator") { $facility_code = $this->session->userdata('facility'); $user_type = "indicator='pharmacist'"; $facilities = Facilities::getCurrentFacility($facility_code); } } $user_id = $this->input->get('u_id'); $data['users'] = Users::getUserAdmin($user_id); $data['user_type'] = Access_Level::getAll($user_type); echo json_encode($data); }