Beispiel #1
0
    //page end is actually the range to show 5 rec, 10 recs, etc.
    $page_end = $_REQUEST['page_end'];
} else {
    $page_end = "10";
}
if (!empty($_REQUEST['client_id'])) {
    $keyword = $_REQUEST['client_id'];
    $field = 'client_id';
} else {
    $client_id = "";
}
$r = new Reports('unknown', BASE_DOMAIN);
if (!empty($_REQUEST['keyword'])) {
    $reports = $r->search($keyword, $field, $page_start, $page_end);
    //returns paged results
    $reports_count = $r->search_counter($keyword, $field);
    //get search result count
    echo "<b>Result(s): " . $reports_count . "</b><br /><hr>";
} elseif (!empty($_REQUEST['uid'])) {
    //get one report from search results
    $uid = $_REQUEST['uid'];
    $reports = $r->getReport($uid);
} else {
    echo "Sorry, No Results Found <br /><br />";
    die;
}
$pager_count = $reports_count;
//total records for query
$pager_range = count($reports);
//total currently displayed
$pager_end = $page_start + $pager_range;