Exemple #1
0
function check_input($number, $qparams, $pageNo, $start, $direction)
{
    global $pageSize;
    $paginator = new \com\indigloo\ui\Pagination($qparams, $pageSize);
    $paginator->setBaseConvert(false);
    if ($pageNo != $paginator->getPageNo()) {
        printf("Test # %d failed \n", $number);
    }
    $params = $paginator->getDBParams();
    if ($params["start"] != $start) {
        printf("Test # %d failed \n", $number);
    }
    if (strcmp($params["direction"], $direction) != 0) {
        printf("Test # %d failed \n", $number);
    }
}
Exemple #2
0
function render_links($total)
{
    global $baseURI;
    global $pageSize;
    for ($j = 1; $j <= 10; $j++) {
        $qparams = array("gpage" => $j, "gpa" => $j * $pageSize);
        $paginator = new \com\indigloo\ui\Pagination($qparams, $pageSize);
        $paginator->setBaseConvert(false);
        $paginator->setMaxPageNo(4);
        $start = ($j - 1) * $pageSize;
        $end = $start + $pageSize;
        $end = $end > $total ? $total : $end;
        $gNumRecords = $end - $start;
        printf(" \n\n Total (%d) page-%d \t start-%d end-%d \t gNumRecords %d \n ", $total, $j, $start, $end, $gNumRecords);
        $paginator->render($baseURI, $start, $end, $gNumRecords);
        printf("  \n ---------------- \n");
        if (!$paginator->hasNext($gNumRecords)) {
            break;
        }
    }
}