Hi,
Anyone know why this method is call EVERY TIME "$this->vagas_model->new_jobcv_entry($db_array);" even when the if was false...
tkz in advice
if($this->tank_auth->is_logged_in()){
if(!$this->tank_auth->is_company()){
$db_array = array(
'jobs_id' => $jobs_id,
'user_id' => $this->session->userdata('user_id'),
'created_by' => 'Hora do emprego'
);
print_r($db_array);
if($this->vagas_model->is_user_in_this_job($db_array['user_id'],$db_array['jobs_id']) == true)
{
echo "entrou";
$data['body'] = 'CV já enviado para esta vaga.';
}else{
echo "droga";
$this->vagas_model->new_jobcv_entry($db_array);
$data['body'] = 'enviado';
}
}else{
$data['body'] = "Apenas para empresas";
}
}else{
$data['body'] = "Precisa estar logado";
}
echo modules::run('index/iframe',$data);