fix: Dashboard pagination display and AJAX handler syntax error

- Fixed missing closing PHP tag in AJAX method causing syntax error
- Updated both AJAX handler and template to always show item count
- Fixed pagination display to be consistent between initial load and AJAX updates
- Pagination item count now shows even when there's only one page of results

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bengizmo 2025-05-30 12:50:27 -06:00
parent 797ec10771
commit ff35b34501
2 changed files with 10 additions and 9 deletions

View file

@ -359,13 +359,13 @@ class HVAC_Dashboard {
</tbody>
</table>
<?php if ($pagination['total_pages'] > 1) : ?>
<div class="tablenav bottom">
<div class="tablenav-pages">
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
<?php if ($pagination['total_pages'] > 1) : ?>
<span class="pagination-links">
<?php if ($pagination['has_prev']) : ?>
<a class="prev-page button" href="#" data-page="1">
<a class="first-page button" href="#" data-page="1">
<span class="screen-reader-text">First page</span>
<span aria-hidden="true">«</span>
</a>
@ -389,7 +389,7 @@ class HVAC_Dashboard {
<span class="screen-reader-text">Next page</span>
<span aria-hidden="true"></span>
</a>
<a class="next-page button" href="#" data-page="<?php echo esc_attr($pagination['total_pages']); ?>">
<a class="last-page button" href="#" data-page="<?php echo esc_attr($pagination['total_pages']); ?>">
<span class="screen-reader-text">Last page</span>
<span aria-hidden="true">»</span>
</a>
@ -398,9 +398,10 @@ class HVAC_Dashboard {
<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>
<?php endif; ?>
</span>
<?php endif; ?>
</div>
</div>
<?php endif;
<?php
$html = ob_get_clean();

View file

@ -344,10 +344,10 @@ get_header(); // Use theme's header
</table>
</div>
<?php if ($pagination['total_pages'] > 1) : ?>
<div class="tablenav bottom">
<div class="tablenav-pages">
<span class="displaying-num"><?php echo esc_html($pagination['total_items']); ?> items</span>
<?php if ($pagination['total_pages'] > 1) : ?>
<span class="pagination-links">
<?php if ($pagination['has_prev']) : ?>
<a class="first-page button" href="#" data-page="1">