0
My problem is this. My project’s Dashboard has an input where the user inserts the process number and clicks to search, as code below:
<form class="navbar-form navbar-left" role="search" action="<?= base_url() ?>processo/pesquisar" method="post">
<div class="form-group">
<input type="text" style="width: 250px;" name="pesquisar" class="form-control" placeholder="Digite o número do processo" required>
<button type="submit" class="btn btn-default btn-md"> CONSULTAR</button>
</div>
</form>
When you click search, I call the search method of the Process controller, as below, which calls the get_processos_like method of the model, Processo_model:
public function pesquisar() {
$this->load->model('Processo_model', 'processo');
$dados['processo'] = $this->processo->get_processos_like();
if (!$this->processo->get_processos_like()) {
$data["msg"] = "Processo não encontrado.";
$this->load->view('includes/msg_erro', $data);
} else {
$this->load->view('/listar/listar_processo_adv', $dados);
}
}
#Método get_processos_like do Model:
function get_processos_like() {
$termo = $this->input->post('pesquisar');
$this->db->select('*');
$this->db->where('nprocesso', $termo);
return $this->db->get('processo')->result();
}
This method returns the data from the searched process to view listr_processos_adv.php, which displays all process information and has a link calling another view, as below:
<div class="row">
<div align="center">
<button type="button" title="Detalhes" onclick="window.location.href = '<?= base_url('processo/custas')?>'" class="btn btn-primary>INFORMAÇÕES DE CUSTAS</button>
</div>
</div>
Until then everything works, it happens that I need to pass the number of this process found and displayed to another view, called listr_processo_custas.php, which displays in addition to some information about the process, displaying its costs (expenses) of the process. Well my dear, I turned around a lot, but the question is simple: How do I pass a variable to another view in Codeigniter?
thank you in advance!
Simple like that, thank you very much my dear @Paulo Weverton
– Ramiro
Would it be possible to pass the codProcesses in a hidden way? Because it is at the url.
– Ramiro