


<script>
document.addEventListener('DOMContentLoaded', function () {
    const filterButtons = document.querySelectorAll('.tm-license-filter');
    const ticketRows    = document.querySelectorAll('.tm-ticket-row');
    const filterBar     = document.getElementById('tm-license-filter-bar');
    const selectedText  = document.getElementById('tm-selected-license');
    const clearButton   = document.getElementById('tm-clear-license-filter');

    function filterTickets(licenseCode) {
        let visibleRows = 0;

        ticketRows.forEach(function (row) {
            const rowLicense = row.getAttribute('data-license');

            if (rowLicense === licenseCode) {
                row.style.display = '';
                visibleRows++;
            } else {
                row.style.display = 'none';
            }
        });

        if (filterBar && selectedText) {
            selectedText.textContent = licenseCode;
            filterBar.style.display = 'flex';
        }

        // اسکرول نرم به جدول پایین
        const ticketsTitle = document.querySelector('h2');
        if (ticketsTitle) {
            ticketsTitle.scrollIntoView({
                behavior: 'smooth',
                block: 'start'
            });
        }
    }

    function clearFilter() {
        ticketRows.forEach(function (row) {
            row.style.display = '';
        });

        if (filterBar) {
            filterBar.style.display = 'none';
        }
    }

    filterButtons.forEach(function (button) {
        button.addEventListener('click', function () {
            filterTickets(this.getAttribute('data-license'));
        });
    });

    if (clearButton) {
        clearButton.addEventListener('click', clearFilter);
    }
});
</script>


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://mashadiclub.ir/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://mashadiclub.ir/wp-sitemap-posts-page-1.xml</loc></sitemap></sitemapindex>
