PCHomepage
Programmer
I wrote a function to put the page number at the bottom of each page and I understand in general why it's not working but cannot work out the logistics to make it work. This is being run inside a foreach loop after the rest of the content is written to the screen. $PageNo (and $RevDate) are coming from a column in the data itself. Appearance-wise it is presenting the page numbers properly but in the wrong places so the first page number appears after the first row of data instead of after the 41st row, then the second one appears the row after the 41st row, etc. Any ideas?
PHP:
function PageNo($PageNo, $RevDate) {
$RevDate = ($RevDate) ? strtoupper(gmdate('M j, Y', $RevDate)) : "";
global $last_pageno;
if ($PageNo != $last_pageno) :
$last_pageno = $PageNo;
$DisplayPageNo = "<div id=\"css-pageno\">\n";
$DisplayPageNo .= "<div class=\"row\">\n";
$DisplayPageNo .= "<div class=\"col\">$PageNo<div class=\"revdate\">REVISED $RevDate</div></div>\n";
$DisplayPageNo .= "</div>\n";
$DisplayPageNo .= "</div>\n";
$DisplayPageNo .= "<div class=\"page-break\"></div>\n";
return $DisplayPageNo;
endif;
}