Jump to content

Recommended Posts

Regards,

You see, I have 143 pages of data tables that I continue to add to daily with my document records, but I'd like to hide data, say on pages 1 to 140. I've tried playing around with the code and have had some wonky success, but it doesn't display data on only pages 140->forward. (I'm fine with pages 1-140 being blank and still appearing as a clickable button at the bottom of the page for selection).

On a side note, there's been an issue persistent since day 1, which is that when the limit of 20 per page has passed, until there are another 5~ or so data entries, the next page button won't appear, so I'll have to go to the URL and manually change the page number to see the new page. I'm used to it at this point.

This is my code for the particular data:

if(isset($_GET['new documents'])){
    
    $rows = $service->count(array('is_new'=>3));
    $page = (isset($_GET['page'])) ? $page = $_GET['page'] : $page = 1;
    $offset = ($page - 1) * $limit;
     
    $pagination->records($rows);
    $pagination->records_per_page($limit);
    
    $documents = $service->findAll(array('is_new'=>3,'limit'=>$limit,'offset'=>$offset));
    foreach ($documents as $d){
        $sid = $d->getUserId();
        $eid = $d->getDocVersion()->getuserId();

        $admin[] = $sService->findOneById($sid);

        if(!empty($eid)){
            $users[] = $eService->findOneById($eid);
        }else{
            $users[] = '';
        }
    }
    $sectionHeading = 'New';
    include (ABSPATH . '/tmplt/doc/new.tmplt.php');
    exit;
}

 

 

Any help would be appreciated!
Thanks!

Link to comment
https://forums.phpfreaks.com/topic/299791-zebra-pagination-removing-pages/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.