Feature: Records per page is now user specific and persists with logout/login sessions

This commit is contained in:
johnnyq
2023-08-17 19:42:42 -04:00
parent 94caee4aa6
commit ce2ba6d3d2
8 changed files with 1009 additions and 1003 deletions

View File

@@ -8,7 +8,7 @@
*/
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / $_SESSION['records_per_page']);
$total_pages = ceil($total_found_rows / $user_config_records_per_page);
if ($total_found_rows > 10) {
$i = 0;
@@ -21,12 +21,12 @@ if ($total_found_rows > 10) {
<div class="col-sm mb-3">
<form action="post.php" method="post">
<select onchange="this.form.submit()" class="form-control select2 col-sm-2" name="change_records_per_page">
<option <?php if ($_SESSION['records_per_page'] == 5) { echo "selected"; } ?> >5</option>
<option <?php if ($_SESSION['records_per_page'] == 10) { echo "selected"; } ?> >10</option>
<option <?php if ($_SESSION['records_per_page'] == 20) { echo "selected"; } ?> >20</option>
<option <?php if ($_SESSION['records_per_page'] == 50) { echo "selected"; } ?> >50</option>
<option <?php if ($_SESSION['records_per_page'] == 100) { echo "selected"; } ?> >100</option>
<option <?php if ($_SESSION['records_per_page'] == 500) { echo "selected"; } ?> >500</option>
<option <?php if ($user_config_records_per_page == 5) { echo "selected"; } ?> >5</option>
<option <?php if ($user_config_records_per_page == 10) { echo "selected"; } ?> >10</option>
<option <?php if ($user_config_records_per_page == 20) { echo "selected"; } ?> >20</option>
<option <?php if ($user_config_records_per_page == 50) { echo "selected"; } ?> >50</option>
<option <?php if ($user_config_records_per_page == 100) { echo "selected"; } ?> >100</option>
<option <?php if ($user_config_records_per_page == 500) { echo "selected"; } ?> >500</option>
</select>
</form>
</div>