Created
September 23, 2011 01:52
-
-
Save khannedy/1236575 to your computer and use it in GitHub Desktop.
Membuat Pagination Sederhana di PHP dan Combo Box HTML 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table border="1"> | |
| <thead> | |
| <tr> | |
| <th>Employee Id</th> | |
| <th>First name</th> | |
| <th>Last Name</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <?php | |
| foreach ($employees as $employee) { | |
| ?> | |
| <tr> | |
| <td><?php echo $employee->getId(); ?></td> | |
| <td><?php echo $employee->getFirstName(); ?></td> | |
| <td><?php echo $employee->getLastName(); ?></td> | |
| </tr> | |
| <?php | |
| } | |
| ?> | |
| </tbody> | |
| </table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form method="get"> | |
| Halaman : | |
| <select name="page" onchange="this.form.submit();"> | |
| <?php | |
| for ($i = 1; $i <= $totalHalaman; $i++) { | |
| ?> | |
| <option value="<?php echo $i; ?>" | |
| <?php | |
| if ($i == $currentPage) { | |
| echo 'selected="selected"'; | |
| } | |
| ?> | |
| > | |
| <?php echo $i; ?> | |
| </option> | |
| <?php | |
| } | |
| ?> | |
| </select> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment