mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Show record details in listing filter footer Showing X of X of X Records
This commit is contained in:
@@ -18,9 +18,9 @@ if ($total_found_rows > 5) {
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm mb-3">
|
||||
<div class="col-sm mb-2">
|
||||
<form action="post.php" method="post">
|
||||
<select onchange="this.form.submit()" class="form-control select2 col-sm-2" name="change_records_per_page">
|
||||
<select onchange="this.form.submit()" class="form-control select2 col-12 col-sm-3" name="change_records_per_page">
|
||||
<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>
|
||||
@@ -29,10 +29,35 @@ if ($total_found_rows > 5) {
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm mb-3">
|
||||
<p class="text-center mt-2"><?php echo $total_found_rows; ?></p>
|
||||
|
||||
<?php
|
||||
// Number of records per page
|
||||
$per_page = $user_config_records_per_page;
|
||||
|
||||
// Current page (make sure $page is set; default to 1)
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
|
||||
// Calculate start and end item indexes
|
||||
$start = ($page - 1) * $per_page + 1;
|
||||
$end = $page * $per_page;
|
||||
|
||||
// Prevent $end from exceeding total found rows
|
||||
if ($end > $total_found_rows) {
|
||||
$end = $total_found_rows;
|
||||
}
|
||||
|
||||
// Now output something like "Showing X to Y of Z records"
|
||||
?>
|
||||
|
||||
<div class="col-sm mb-2">
|
||||
<p class="text-center">
|
||||
Showing <strong><?php echo $start; ?></strong> to <strong><?php echo $end; ?></strong> of <strong><?php echo $total_found_rows; ?></strong> records
|
||||
</p>
|
||||
|
||||
|
||||
<!--<p class="text-center mt-2"><?php echo $total_found_rows; ?></p> -->
|
||||
</div>
|
||||
<div class="col-sm mb-3">
|
||||
<div class="col-sm mb-2">
|
||||
|
||||
<ul class="pagination justify-content-sm-end">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user