[eluser]predat0r[/eluser]
Hi, first of all I made several good working paginations earlier. This time has no idea what is wrong. The point is, I have the pagination routin startad, page numbers appear, but I have all records from a table on all pages. So 8 records on first page, the same 8 records on second page and so on.
Any idea? thx
The controller:
Code:
function programok() {
$config['base_url'] = 'http://localhost/site/admin/programok';
$config['total_rows'] = $this->db->get('programok')->num_rows();
$config['per_page'] = 5;
$config['num_links'] = 20;
$this->pagination->initialize($config);
$this->db->order_by('datum', 'DESC');
$q = $this->db->get('programok');
if($q->num_rows() > 0) {
$data['records'] = $q->result();
}
$data['tartalom'] = 'ad_programok_ossz';
$this->load->view('admin', $data);
}
The view that loaded and need pagination
Code:
<table>
...
<?php foreach ($records as $record)
{
echo '<tr>';
echo '<td>' . $record->id . '</td>';
echo '<td>' . $record->program . '</td>';
echo '<td>' . $record->datum . '</td>';
echo '<td align="center">' . anchor('admin/prog_szerk/'.$record->id, img(array('src' => 'images/szerkeszt.png', 'border' => '0'))) . '</td>';
if($record->publikal == 1)
{
$chkparams = array(
'class' => 'chkbox',
'checked' => TRUE,
'name' => 'publchk',
'value' => $record->id
);
echo '<td align="center">' . form_checkbox($chkparams) . '</td>';
} else {
echo '<td align="center">' . form_checkbox($chkparams) . '</td>';
$chkparams = array(
'class' => 'chkbox',
'checked' => FALSE,
'name' => 'publchk',
'value' => $record->id
);
}
echo '<td align="center">' . anchor('admin/prog_torol/'.$record->id, img(array('src' => 'images/torles.png', 'border' => '0')), array('onclick' => 'return(confirm(\'Biztosan törlöd?\'));')) . '</td>';
echo '</tr>';
}
?>
</table>
<div align="center"><?php echo $this->pagination->create_links(); ?></div>