Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Model
- function get_search($search_terms = 'default'){
- $this->db->like('numero', $search_terms['numero']);
- $this->db->like('id_categoria', $search_terms['id_categoria']);
- $this->db->like('mes', $search_terms['mes']);
- $this->db->like('ano', $search_terms['ano']);
- $this->db->like('vereadores', $search_terms['vereadores']);
- $this->db->like('assunto', $search_terms['assunto']);
- $query = $this->db->get('leis');
- if ($query->num_rows() > 0)
- {
- return $query->result_array();
- }
- else
- {
- return false;
- }
- }
- //Controller
- function buscar(){
- $search_terms = array(
- 'numero' => $this->input->post('numero'),
- 'id_categoria' => $this->input->post('id_categoria'),
- 'mes' => $this->input->post('mes'),
- 'ano' => $this->input->post('ano'),
- 'vereadores' => $this->input->post('vereadores'),
- 'assunto' => $this->input->post('assunto')
- );
- $data['query'] = $this->leis_model->get_search($search_terms);
- $data['categorias'] = $this->leis_categorias_model->get_leis_categorias();
- $this->template->load('template','leis/resultados_view.php', $data);
- }
Advertisement
Add Comment
Please, Sign In to add comment