[eluser]max123[/eluser]
function create_search_agent() //create a new search agent
{
$this->load->model('vacancy_model');
$this->load->model('profile_model');
$this->load->model('search_agent_model');
$this->load->helper('url');
$data=array();
if (($this->session->userdata('email'))== NULL)
{
$this->session->set_flashdata('message', 'Please login to view this page.');
redirect('home/index/-'.$var);
}
$email=$this->session->userdata('email');
$user_id= $this->profile_model->get_id_by_email($email);
$id=$user_id;
$search_agents = $this->search_agent_model->get_search_agents($user_id);
$rows = $search_agents->num_rows();
if($rows>=3)
{
redirect('/seeker/my_searches','refresh');
echo "[removed]alert('You cannot create more than 3 search agents');[removed]";
}
$data['controller'] ="set_search_agent/$id";
$data['keyword'] = '';
$data['category_id'] = '';
$data['country_id'] = '';
$data['city_id'] = '';
$data['date_posted_id'] = '';
$data['heading'] ="Create a search agent";
$data['job_categories2'] = $this->vacancy_model->get_job_categories(); //get job categories
$data['countries'] =$this->vacancy_model->get_countries(); // get countries
$data['city_states'] =$this->vacancy_model->get_city_states(); // get cities and states
$data['date_posted'] =$this->vacancy_model->job_posted_dates(); // get cities and states
$data['user_id'] = $this->profile_model->get_id_by_email($this->session->userdata('email')); //gives an error when remove this redundent line
$data['header'] = $this->top_job->get_header($this->redux_auth_model->getUserGroupByUserId($email)); //get header
$data['display_name'] = $this->profile_model->set_get_display_name($this->session->userdata('email'));
$data['loginPage'] = $this->load->view('login',$data, TRUE);
$data['banner'] = $this->load->view('banner',$data,TRUE);
$data['footer'] = $this->load->view('footer','',TRUE);
$this->load->view('seeker/search_agent_create',$data);
}