mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-22 14:33:27 +08:00
Update customers.tpl
Functionality to filter table rows based on admin input
This commit is contained in:
parent
d31edde9d6
commit
dbc3a2623c
1 changed files with 22 additions and 1 deletions
|
@ -18,7 +18,7 @@
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<form id="site-search" method="post" action="{$_url}customers/list/">
|
<form id="site-search" method="post" action="{$_url}customers/list/">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" name="search" value="{$search}" class="form-control"
|
<input type="text" id="search-input" name="search" value="{$search}" class="form-control"
|
||||||
placeholder="{Lang::T('Search')}...">
|
placeholder="{Lang::T('Search')}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success" type="submit"><span
|
<button class="btn btn-success" type="submit"><span
|
||||||
|
@ -79,4 +79,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Functionality to filter table rows based on admin input
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
var searchInput = document.getElementById('search-input');
|
||||||
|
var tableRows = document.querySelectorAll('tbody tr');
|
||||||
|
|
||||||
|
searchInput.addEventListener('input', function () {
|
||||||
|
var searchText = this.value.toLowerCase();
|
||||||
|
|
||||||
|
tableRows.forEach(function (row) {
|
||||||
|
var rowData = row.textContent.toLowerCase();
|
||||||
|
|
||||||
|
if (rowData.includes(searchText)) {
|
||||||
|
row.style.display = '';
|
||||||
|
} else {
|
||||||
|
row.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
Loading…
Reference in a new issue