[eluser]masentinel900[/eluser]
I'm selecting some values from a DB for put them in a dynamic table. Next of generate the table with four(4) rows get from the db, I need get the value generate of each one row for may to do the appropiate download..
This is the controller.
Code:
foreach($query->result() as $row)
{
$datos = array(
'idacta' => $row->idacta,
'rutaarchivo' => $row->rutaarchivo,
'descripcion' => $row->descripcion,
'fechademodificacion' => $row->fechademodificacion,
);
for($i>1; $i<=$datos['idacta']; $i++)
{
$content .= "
<tr>
<td id='$i'><input name='opcion-res' type='radio' align='center'/></td>
<td id='$i'><a href='download'>$datos[rutaarchivo]</a></td>
<td id='$i'>$datos[descripcion]</td>
<td id='$i'>$datos[fechademodificacion]</td>
<input id='$i' type='hidden' name='hola' value='$datos[rutaarchivo]'/>
</tr>
";
}
$this->session->set_userdata('logged_content', $datos);
$this->output->set_output($content);
}
This is the side of my controller where I'm add the variables with the DB rows, I need get the variable of hidden input which content the route of the file for be downloaded. The second <th> have a link wich call the download controller and there I get the value of the route trought the userdata parameters..
If I have 20 files diferents and I try to download any always goes download me the last because is getting the route but outside of the foreach.
The question is : How I do for may get the dynamic variable inside of the loop?
I'm developing a space for downloads. Any suggestion or Idea please let me know..