[eluser]praveenarya[/eluser]
hi all,
i am having problem with pagination i did as explained in user guide but iam getting errors my code is
Code:
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCFCFD" class="sborder">
<tr>
<td width="5%" nowrap="nowrap" class="menuheading">S.No </td>
<td width="65%" height="25" class="menuheading">Loaction</td>
<td width="10%" align="center" class="menuheading">Status</td>
<td width="10%" align="center" class="menuheading">Edit</td>
<td width="10%" align="center" class="menuheading">Delete</td>
</tr>
<?
$i=0;
$query("select * from ab_bus_location where 1 order by loc_id desc");
$total=$query->num_rows();
foreach ($query->result_array() as $row)
{
$i=$i+1;
if($row['loc_status']==0) {
$fs="In-Active"; $sf=1;$color="red";
}else{
$fs="Active"; $sf=2;$color="green";
}
?>
<tr bgcolor="#FFFFFF">
<td align="center"><? echo $i; ?>.</td>
<td height="25" align="left" class="capfont"><? echo $row['loc_name'];?></td>
<td width="10%" align="center"><a href="<? echo base_url();?>index.php/admin/Manage_location/status/<?php echo $row['loc_id']?>/<<? echo $sf; ?>" class="insub"><font color="<?=$color?>"><?= $fs;?> </font></a></td>
<td align="center"><a href="<? echo base_url();?>index.php/admin/Manage_location/edit/<?php echo $row['loc_id'];?>" class="insub">Edit</a></td>
<td width="15%" align="center"><a href="<? echo base_url();?>index.php/admin/Manage_location/delete/<?php echo $row['loc_id'];?>" class="insub">Delete</a></td>
</tr>
<? } ?>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><? if($total>0) {
$this->load->library('pagination');
$config['base_url'] = current_url();
$config['total_rows'] = $total;
$config['per_page'] = '2';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
} else { echo "---- No Records Found ----"; }?></td>
</tr>
</table></td>
</tr>
</table>
i gor error
Severity: Notice
Message: Undefined property: CI_Loader::$pagination
Filename: admin/manage_location.php
Line Number: 125
Fatal error: Call to a member function initialize() on a non-object in D:\wamp\www\example\system\application\views\admin\manage_location.php on line 125
plz help me
thanks in advamce