when $num_rows[0] is 0, so an empty * result was rendering as a card with a filter bar and nothing under it. This * fills that gap and, more usefully, distinguishes the two reasons a list can * be empty: * * - nothing has been created yet -> say so plainly * - the filters exclude everything -> say THAT, and offer a way out * * The second is the one worth getting right: a filtered-to-nothing list looks * identical to an empty install, and the fix (clear the filters) is invisible. * * $page_title is set from the script name by includes/page_title.php, which * every listing page pulls in via inc_all / inc_all_client / inc_all_admin, * so the label is already correct per page ("Clients", "Recurring Invoices") * with nothing to maintain. */ if (!isset($num_rows) || intval($num_rows[0]) > 0) { return; } /* * Which GET keys are page furniture rather than a filter the user chose. * canned_date is here because filter_header.php WRITES it on every request * when absent, so its presence says nothing; the dates it resolves to are * what count, and those arrive as dtf/dtt. * * client_id is scope, not a filter - 33 of these pages run inside a client via * inc_all_client.php. Counting it would tell someone their empty client has * "no invoices matching the current filters" and offer a Clear filters link * that quietly drops them out of the client entirely. */ $empty_state_ignored_params = array('page', 'sort', 'order', 'canned_date', 'show_column', 'client_id'); $empty_state_filtered = false; foreach ($_GET as $empty_state_key => $empty_state_value) { if (in_array($empty_state_key, $empty_state_ignored_params, true)) { continue; } if (is_array($empty_state_value) ? count($empty_state_value) : strlen(trim((string)$empty_state_value))) { $empty_state_filtered = true; break; } } $empty_state_thing = strtolower($page_title ?? 'records'); ?>
No match the current filters.

Try widening the date range or clearing the search.

Clear filters

No yet.

Anything you add will show up here.