0
Good afternoon guys. Follow the code of my view, which is working fine. It turns out that I would like to do the number of the process (2º <td>
), be clickable by calling another view. It is possible?
View code:
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.13/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.13/datatables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.13/js/dataTables.bootstrap.min.js"></script>
</head>
<div class="col-md-12">
<div class="row">
<br>
<div class="col-md-12">
<p><font size="3" face="helvetica"><strong>LISTA DE PROCESSOS</strong></font></p>
</div>
</div>
<div class="row">
<div class="col-md-4 ">
<button type="button" title="Imprimir" class="btn btn-primary hidden-print" onclick="myFunction()">
<span class="glyphicon glyphicon-print" aria-hidden="true"></span></button>
<button type="button" title="Cadastrar Processo" onclick="return window.location.href = '<?= base_url('processo/cadastro/') ?>'" class="btn btn-primary btn-sm hidden-print"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> PROCESSO</button>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<table id="book-table" >
<thead>
<tr>
<td><b>Cliente</b></td>
<td><b>Nº do Processo</b></td>
<td><b>Parte</b></td>
<td><b>Pasta</b></td>
<td><b>Valor da causa</b></td>
<td><b>Situação</b></td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#book-table').DataTable({
"autowidth": false,
"ajax": {
url: "<?php echo site_url("processo/processos_page") ?>",
type: 'GET'
}
});
});
</script>
<script>
function myFunction() {
window.print();
}
</script>
Controller Function Code (Process):
public function processos_page() {
// Datatables Variables
$draw = intval($this->input->get("draw"));
$start = intval($this->input->get("start"));
$length = intval($this->input->get("length"));
$processo = $this->Processo_model->getAll();
$data = array();
foreach ($processo->result() as $proc) {
$data[] = array(
$proc->nomecliente,
$proc->nprocesso,
$proc->nomeparte,
$proc->pastaescritorio,
$proc->valorcausa,
$proc->situacao
);
}
$output = array(
"draw" => $draw,
"recordsTotal" => $processo->num_rows(),
"recordsFiltered" => $processo->num_rows(),
"data" => $data
);
echo json_encode($output);
exit();
}
that way it didn’t work either, I don’t use the Model class for that View. Maybe the problem is on this line: $Row[] = " <div align='center'> <a href='" . base_url() . "Processor/ver/" . $ $proc->nprocesso . " 'class='btn btn-Success' ><i class='fa fa fa-search'></i></a> </div>";What would be Processor/ver/
– Ramiro
Netbeans gave this message regarding this line: $no = $_POST['start']; "Do Not Access Superglobal Array $_Post Directly.
– Ramiro
And your controller to open the view to view the process,
– Adriano Silva
Create and model class and add the codes I’ve put that will work, this is the way that the guys from the datatables teach in their forum.
– Adriano Silva
I added the script for you to put in your view file to call the datatables
– Adriano Silva
It’s tense, I’m not getting it :(
– Ramiro