/*==== the record of the data is paginated =====
A page that has a contiguous 10-page connection
One page to display $limit_row record information
and has the next 10 page and the 10 page paging function
===================================
------need to pass in value $total_row; $limit _row; $pagename;-----
$total _row The total number of rows for the selected query result
$limit _row The maximum number of rows to display per page
$pagename Displays the page name for the return. (without suffix name)
----------------------------------------------------
----------------------------------------------------
$page the currently read page
$total _page can be divided into several pages.
$row _begin to start reading from the first few lines
$row _end to read the first line
-----------------------------------------------------*/
if (! $page) {$page = 1;}
$total _page=ceil ($total _row/$limit _row);
$row _begin= $limit _row* ($page-1);
if ($page = = $total _page&& ($total _row% $limit _row)) {
$read _row= ($total _row% $limit _row);
}else{$read _row= $limit _row;}
if ($total _page<=10) {
$page _begin=0;
$page _end= $total _page;
$page 10=1;
$newpage 10=1;
}else{
--------------page shows the next 10 pages----------------
$page 10 for a total of a few 10 pages
$newpage 10 is the starting position for reading 10 pages
$page _endx to read the last page
$page 10=ceil ($total _PAGE/10);
if ($newpage ten = = "") {$newpage 10=1;}
$page _begin=10* ($newpage 10-1);
if ($newpage 10==1)
{
if ($newpage 10== ($page 10-1) && ($total _page%10))
{
$page _endx= $total _page%10;
$page _end=10;
echo "| Top 10 Pages | Next $page _endx page | ";
}else{
$page _end=10;
echo "| is the top 10 page | Next 10 pages | ";
}
}elseif ($newpage 10>1) {
if ($newpage 10== $page 10&& ($total _page%10))
{$page _end= $total _page%10;
echo "| Top 10 Pages | is the last $page _end | ";
}else{
if ($newpage 10== ($page 10-1) && ($total _page%10))
{$page _endx= $total _page%10;
$page _end=10;
echo "| Top 10 Pages | Next $page _endx page | ";
} else{
$page _end=10;
echo "| Top 10 Pages | Next 10 pages | ";
}
}
}
}
----------------------page numbers per 10 pages--------------------------------------
echo "Total:" $total _row. " section ";
for ($n = $page _begin+1; $n <= $page _begin+ $page _end; $n + +) {
echo "$n";
}
echo "Page";
?>
http://www.bkjia.com/PHPjc/315554.html www.bkjia.com true http://www.bkjia.com/PHPjc/315554.html techarticle ?/*==== to the data of the record page display ===== a page has a continuous 10 page connection One page can display $limit_row record information and have the next 10 pages and 10 page paging function = = ...