mercredi 9 septembre 2020

If statement for page navigation

I am trying to figure out a way to show a Page Navigation but only if there are more then 30 items, because the limit for 1 page is max 30 items. If there are more then 30 items it should show a page navigation to the next list with max 30 items and so on...(0-30, 30-60, 60-90...)

if($this->quantity_selected_rows >= $this->items_per_page && $this->quantity_total_rows > $this->items_per_page)
{show navigation}
else
{dont show navigation}

e.g. 
quantity_selected_rows = 30
items_per_page = 100
quantity_total_rows = 30

for clarity:

if(30>=30 && 100 > 30)
{show navigation}
else
{dont show navigation}

My Problem is that if i filter my grid and it would EXACTLY give me 30 filtered items it will show the page navigation according to my statement, which is bad.

Is there a better way to describe this ?

Thanks !

Aucun commentaire:

Enregistrer un commentaire