<?
/*
* This file is to be included from the main index file for ajax call.
* -When you want to use ajax instead of a simple HREF Tag,
* please comment linkAsAjax() line
*/
/* please find your own files and update the require paths below...
*
* */
/*
* additions and revisions:
* added ASCENDING/DESCENDING by field columns using: $newPaging->useOrdering($v) please see line 69
* added grouping the pagers to limit the pagers in your page (please see the ellipses on line 54)
*
* */
require_once 'config/config.php';
require_once 'lib/corephp/class.database.php';
require_once 'lib/corephp/Paging.php';
$db = new Database();
$pagespergroup = 5; $limitpp = 10; $spacer = ' | ';
//no need to edit anything beyond this line except for all query variables:
//change $query, $orderby to reflect your own; change $fetchnow->DESCRIPTION to suite your own column name from you own database
$query = "SELECT TABLE_NAME, COLUMN_NAME FROM columns";
$newPaging = new Paging($query, $_REQUEST, $limitpp, $pagespergroup);
$newPaging->linkAsAjax('post', 'container', 'refresher.php');
$f = $newPaging->getFields;
$res = $newPaging->showPageRecs();
echo $newPaging->fullquery."<br/>";
echo "mul: ".$mul."<br/>startat: ".$startat."<br/><br/>";
echo $newPaging->showFirst('«')." ".
$newPaging->showPrevGroup(' (...) ').
$newPaging->showPrev('prev')." ".
$newPaging->showPages($spacer)." ".
$newPaging->showNext('next')." ".
$newPaging->showNextGroup(' (...) ').
$newPaging->showLast('»');
echo "<BR><BR>";
echo "<table border='1' width=500>";
echo "<tr>";
foreach($f as $k=>$v){ echo "<td>".$newPaging->useOrdering($v).'</td>';}
echo "</tr>";
while ($row = mysql_fetch_object($res)) {
echo "<tr><td>".$row->TABLE_NAME. "</td><Td>". $row->COLUMN_NAME."</td></tr>";
}
echo "</table><BR><BR>";
//showFirst, showPrev, showNext, showLast, showPages are optional functions
echo $newPaging->showFirst('«')." ".
$newPaging->showPrev('prev')." ".
$newPaging->showPages($spacer)." ".
$newPaging->showNext('next')." ".
$newPaging->showLast('»');
?>
|