public function manage_locations() { if ($this->session->userdata('USER_TYPE') == '1') { $locations_service = new Locations_service(); $data['locations'] = $locations_service->get_locations(); $data['business_types'] = $this->config->item('BUSINESS_TYPES'); $partials = array('content' => 'locations/locations'); //load the view $this->template->load('template/main_template', $partials, $data); //load teh template } else { $this->template->load('template/denied'); } }
public function index() { $questionnaire_service = new Questionnaire_service(); $settings_service = new Settings_service(); $locations_service = new Locations_service(); $setting = $settings_service->get_settings_by_slug('site_url'); $data['languages'] = $this->config->item('LANGUAGES'); $data['locations'] = $locations_service->get_locations(); $data['questionnaires'] = $questionnaire_service->get_questionnaires($this->session->userdata('USER_LOCATION')); $data['domain_url'] = $setting->value; $partials = array('content' => 'dashboard/dashboard_view'); //load the view $this->template->load('template/main_template', $partials, $data); //load teh template }
function load_user() { $user_service = new User_service(); $user_model = new User_model(); $locations_service = new Locations_service(); $user_types = ""; if ($this->session->userdata('USER_TYPE') == '1') { $user_types = $this->config->item('USER_TYPES'); } else { if ($this->session->userdata('USER_TYPE') == '2') { //if admin users belongs to his location $user_types = $this->config->item('USER_TYPES'); unset($user_types[1]); } } $data['user_types'] = $user_types; $data['locations'] = $locations_service->get_locations(); $user_model->set_id(trim($this->input->post('user_id', TRUE))); $data['user'] = $user_service->get_user_by_id($user_model); echo $this->load->view('users/edit_user', $data); }