(06-23-2022, 09:55 PM)demyr Wrote: But the thing I face here is the $total variable. It is not usable. Because imagine the total is 6 and I have 3 results per page for 10 results. Then after the second or third pagination it keeps showing the same, the last, item for the rest of the paginations.
Sorry, I don't get what you say.
$page is the current page number, starting at 1.
$perPage is the number of the records found you show on one page.
$total is the number of total records found.
And you need to modify
get_all_offers_pending() so that returns data set with limit and offset.
The limit is
$perPage. The offset can be calculated from
$page.