Pagination
Posted: Wed Feb 15, 2006 5:31 pm
Could someone show me some tips? I've the following code, what I want to do is to display a page of 20 rows and display the following at the bottom of the page. I'm not quite know how to do this.
1 2 3 4 5 6 7 8 9 10 next
when the user click on next, I would like to have it display
prev 2 3 4 5 6 7 8 9 10 11 next
1 2 3 4 5 6 7 8 9 10 next
when the user click on next, I would like to have it display
prev 2 3 4 5 6 7 8 9 10 11 next
Code: Select all
$i_limit_start = $next * $g_limit;
$i_no_of_pages = $no_of_pages;
for($vloop = 0 ; $vloop < $no_of_pages ; $vloop++)
{
if( ($vloop) != $next)
{
print("<a href = '".$HTTP_SERVER_VARS["PHP_SELF"]."?x=admin&a=show&dep=".$dep."&tixstatus=".$tixstatus."&next=".$vloop."&order=".$p_order."&col=".$i_col."' class = 'link'> ".($vloop+1)." </a>");
}
else
{
print("<a href = '".$HTTP_SERVER_VARS["PHP_SELF"]."?x=admin&a=show&dep=".$dep."&tixstatus=".$tixstatus."&next=".$vloop."&order=".$p_order."&col=".$i_col."' class = 'link'><font color = 'red'><b> ".($vloop+1)."</b></font> </a>");
}
}