I have the following code where I do a search with a worker code, but now I want to do it with more workers. It shows me only the last selected worker.
Controller.
// $persona = $this->input->post('persona');
$this->form_validation->set_rules('persona[]', 'persona','required|trim',array(
'required' => 'Seleccione una maquina'
));
foreach ($this->input->post('persona') as $persona) {
$desde =$this->input->post('fechadesde');
$hasta =$this->input->post('fechahasta');
$data['desde'] = $desde;
$data['hasta'] = $hasta;
$data['tipo'] = $this->input->post('customRadio');
$data['nombre'] =$this->m->verificarCodigo($persona);
$data['actividades']= $this->report->getActividades($desde,$hasta,$persona);
}
// print_r($data);
$this->load->view('report/person-result',$data);
My sight.
<?php if ($nombre): ?>
<?php echo $nombre->Nombre; ?>
<?php endif;?> </h4>
<?php $fechas = array(); ?>
<?php if ($seguimientos): ?>
<?php
foreach ($seguimientos as $seguimiento) {
$fechas[$seguimiento->fechaSeguimiento][] = $seguimiento;
}
?>
<?php foreach ($fechas as $fecha):?>
<table class="table table-hover dataTable no-footer">
<thead>
<tr>
<th>Fecha</th>
</tr>
</thead>
<?php foreach ($fecha as $seguimiento): ?>
<tr>
<td></td>
</tr>
<?php endforeach; ?>
</table>
<?php endforeach; ?>
<?php endif; ?>
Should I modify the variable $ data? And add a foreach in the view?