Changed Client-side Search to Server-side Search
This commit is contained in:
@ -227,6 +227,71 @@ td:nth-child(2) span {
|
||||
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
|
||||
.search-container {
|
||||
margin: 20px 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
flex: 1;
|
||||
min-width: 300px;
|
||||
padding: 10px 15px;
|
||||
border: 2px solid #ddd;
|
||||
border-radius: 5px;
|
||||
font-size: 16px;
|
||||
transition: border-color 0.3s;
|
||||
}
|
||||
|
||||
.search-box:focus {
|
||||
outline: none;
|
||||
border-color: #007cba;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
padding: 10px 20px;
|
||||
background-color: #007cba;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.search-btn:hover {
|
||||
background-color: #005a87;
|
||||
}
|
||||
|
||||
.clear-search-btn {
|
||||
padding: 10px 15px;
|
||||
background-color: #6c757d;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.clear-search-btn:hover {
|
||||
background-color: #545b62;
|
||||
}
|
||||
|
||||
/* Show search results info */
|
||||
.search-results-info {
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
background-color: #e7f3ff;
|
||||
border-left: 4px solid #007cba;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Status Filter Dropdown */
|
||||
.status-filter-container {
|
||||
position: relative;
|
||||
|
||||
@ -15,7 +15,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
if (isDashboard) {
|
||||
// Dashboard-specific initialization
|
||||
initSearch();
|
||||
initStatusFilter();
|
||||
initTableSorting();
|
||||
|
||||
@ -192,22 +191,6 @@ function initThemeToggle() {
|
||||
document.body.appendChild(toggle);
|
||||
}
|
||||
|
||||
function initSearch() {
|
||||
const searchBox = document.createElement('input');
|
||||
searchBox.type = 'text';
|
||||
searchBox.placeholder = 'Search tickets...';
|
||||
searchBox.className = 'search-box';
|
||||
searchBox.oninput = (e) => {
|
||||
const searchTerm = e.target.value.toLowerCase();
|
||||
const rows = document.querySelectorAll('tbody tr');
|
||||
rows.forEach(row => {
|
||||
const text = row.textContent.toLowerCase();
|
||||
row.style.display = text.includes(searchTerm) ? '' : 'none';
|
||||
});
|
||||
};
|
||||
document.querySelector('h1').after(searchBox);
|
||||
}
|
||||
|
||||
function initStatusFilter() {
|
||||
const filterContainer = document.createElement('div');
|
||||
filterContainer.className = 'status-filter-container';
|
||||
|
||||
Reference in New Issue
Block a user