Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional pagination on top of the table #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GreeenPeppper
Copy link

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one
<a class="pagination prev" href="?page=<?php echo $page-1?>">« Previous page</a>
<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $x is not yet defined here. Also, it will only be 49 after the foreach loop (when looping over a full "page" of users).

<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
<a class="pagination next" href="?page=<?php echo ++$page?>">Next page »</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating the $page variable here means that it has the wrong value when used (and incremented again) later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants