[eluser]masentinel900[/eluser]
Hello everybody.
Now I'm creating a download manager of the next way:
1: In the model file I made the query selection to my DB.
2: In a controller I get the data from my DB and I organize it trought of a foreach loop seting the data in a table and then show it in a output function.
3: In my app when I look the table in the view, I see the data tabulate and paginate by 10 records. each record has 4 rows. the rows are the name, created by, date and a selected field.
-When I onclick on the name of the record (LINK) the download start automatically, downloading the correponding file.
¡For this there are somy variables that I get but don't show, which are the route of my file!.
All goes fine, But I'm truncated in what I don't know how to send the selected route to my controller route.
Actually I have this:
Code:
if ($query->num_rows() > 0)
{
foreach($query->result_array() as $row)
{
$data = array(
'fechacreacion' => $row['fechacreacion'],
'descripcion' => $row['descripcion'],
'codigoagencia' => $row['codigoagencia'],
'nombreacta' => $row['nombreacta'],
'rutaarchivo' => $row['rutaarchivo'],
);
$content.="
<tr>
<td id=''><input name='opcion-res' type='radio' align='center'/></td>
<td id=''><a href='download'>$data[descripcion]</a></td>
<td id=''>$data[rutaarchivo]</td>
<td id=''>$data[fechacreacion]</td>
</tr>
";
}
$this->session->set_userdata('logged_content', $data);
}
$this->output->set_output($content);
If someone has a better Idea of Howa could to be a download manager, I will thanks that let me know.