view Code
<?php
$i=1+$this->uri->segment(3);
if(is_array($displaydata))
{
foreach($displaydata as $db) {
?>
custom fileds...
<?php $i++; } } ?>
<?php if(empty($displaydata)) { ?>
<tr>
<td colspan="7" bgcolor="#F8F8F8">No Records Found .. .... ...</td>
</tr>
<?php } ?>
</table> <?php echo $this->pagination->create_links();?></td>
controller code
public function certificatedata()
{
$displaydata = $this->mreminder->listcertificatedata('','') ;
$total_rows = count($displaydata) ;
$config['base_url'] = base_url().'index.php/welcome/certificatedata/' ;
$config['per_page'] = 10 ;
$config['full_tag_open'] = '<div>' ;
$config['full_tag_close'] = '</div>' ;
$config['first_link'] = 'First' ;
$config['last_link'] = 'Last' ;
$config['use_page_numbers'] = FALSE ;
$config['prev_link'] = '<';
$config['uri_segment'] = 3 ;
$config['num_links'] = 7 ;
$config['cur_tag_open'] = '<b>' ;
$config['cur_tag_close'] = '</b>' ;
$config['total_rows'] = $total_rows ;
$displaydata = $this->mreminder->listcertificatedata($config['per_page'], $this->uri->segment(3)) ;
$this->pagination->initialize($config);
$data = array(
'displaydata' => $displaydata
) ;
$this->load->view('certificatedata',$data);
}
Model COde
function listbillingdata($num, $offset)
{
if($offset!="")
{
$que = "select * from billingtbl where deleted=0 LIMIT ".$offset.", ".$num."";
}
else if($num!="")
{
$que = "select * from billingtbl where deleted=0 LIMIT ".$num."" ;
}
else
{
$que = "select * from billingtbl where deleted=0" ;
}
$query = $this->db->query($que) ;
$results = $query->result_array() ;
return $results ;
}