function redirectRole() { $userName = $this->input->post('userName'); $password = $this->input->post('password'); $this->load->model('user'); $user = new user(); $results = $user->searchUserByUsename($userName); if ($results[0]->userid == 1) { $this->load->model('Vacancy'); $vacancy = new Vacancy(); $array = $vacancy->getVacancyByUser($results[0]->userid); $data["vacancies"] = $array; $this->load->view('mainView', $data); } else { if ($results[0]->userid == 2) { $this->load->model('Vacancy'); $vacancy = new Vacancy(); $array = $vacancy->getVacancyByUser($results[0]->userid); $data["vacancies"] = $array; $this->load->view('employerView', $data); } else { if ($results[0]->userid == 3) { $this->load->model('Event'); $event = new Event(); $array = $event->getAllEventByUser($results[0]->userid); $data["events"] = $array; $this->load->view('organizerview', $data); } } } }
function getVacancyByUserID() { $this->load->model('Vacancy'); $vacancy = new Vacancy(); $vacancy->getVacancyByUser(1); }