Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db->select('*');
- $this->db->from('eficaz_ocorrencia');
- $this->db->join('eficaz_setor', 'eficaz_setor.EFICAZ_SETOR_ID = eficaz_ocorrencia.EFICAZ_OCORRENCIA_SETOR_ID');
- $this->db->join('funcionarios', 'funcionarios.ID = eficaz_ocorrencia.EFICAZ_OCORRENCIA_FUNCIONARIOS_ID');
- $this->db->join('eficaz_item', 'eficaz_item.EFICAZ_ITEM_ID = eficaz_ocorrencia.EFICAZ_OCORRENCIA_ITEM_ID');
- /* ####################################################################### */
- if(isset($post['EFICAZ_SETOR_ID'])){ $this->db->where_in('EFICAZ_SETOR_ID', $post['EFICAZ_SETOR_ID']); }
- if(isset($post['EFICAZ_ITEM_ID'])){ $this->db->where_in('EFICAZ_ITEM_ID', $post['EFICAZ_ITEM_ID']); }
- if(isset($post['EFICAZ_OCORRENCIA_FUNCIONARIOS_ID'])){ $this->db->where('FUNC_MATR', $post['EFICAZ_OCORRENCIA_FUNCIONARIOS_ID']); }
- if(isset($post['DESEMP_DATA_DESDE'])){ $this->db->where('EFICAZ_OCORRENCIA_DT_OCORRENCIA >=', datatoDBa($post['DESEMP_DATA_DESDE'])); }
- if(isset($post['DESEMP_DATA_ATE'])){ $this->db->where('EFICAZ_OCORRENCIA_DT_OCORRENCIA <=', datatoDBp($post['DESEMP_DATA_ATE'])); }
- /* ####################################################################### */
- $this->db->where('EFICAZ_OCORRENCIA_USER', $id);
- /* ####################################################################### */
- if(isset($post['EFICAZ_FUNC_NOME'])){
- $this->db->query("(FUNC_NOME LIKE %{$post['FUNC_NOME']}%)");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement