Browse Our Design Catalog

Classic Men's Suit
Classic Men's Suit

Elegant two-piece suit for formal occasions.

By: tailor hamis

Women's Evening Dress
Women's Evening Dress

Elegant evening dress for special events.

By: tailor hamis

'; // Language switcher functionality function updateLanguage(lang) { document.documentElement.lang = lang; document.querySelectorAll('[data-translate]').forEach(element => { const key = element.getAttribute('data-translate'); if (translations[lang][key]) { if (element.closest('.alert')) { const originalText = element.textContent; element.textContent = translations[lang][key] + originalText; } else if (key === 'by_tailor') { const tailorName = element.textContent.split(': ')[1] || ''; element.textContent = translations[lang][key] + tailorName; } else { element.textContent = translations[lang][key]; } } }); document.querySelectorAll('[data-translate-placeholder]').forEach(element => { const key = element.getAttribute('data-translate-placeholder'); if (translations[lang][key]) { element.placeholder = translations[lang][key]; } }); document.title = translations[lang].title; document.querySelectorAll('.dropdown-item').forEach(item => { item.classList.toggle('active', item.getAttribute('data-lang') === lang); }); const dropdownToggle = document.querySelector('.navbar .dropdown-toggle span'); if (dropdownToggle) { dropdownToggle.textContent = translations[lang][`lang_${lang}`]; } localStorage.setItem('language', lang); fetch('set_language.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `language=${lang}&csrf_token=d657f0e0f443d3533bc9c22b290c208204c3394359535574bebf30204da8794c` }); } document.querySelectorAll('[data-lang]').forEach(item => { item.addEventListener('click', (e) => { e.preventDefault(); const lang = item.getAttribute('data-lang'); updateLanguage(lang); }); }); // Sidebar functionality sidebarToggle.addEventListener('click', () => sidebar.classList.toggle('active')); sidebarClose.addEventListener('click', () => sidebar.classList.remove('active')); document.addEventListener('click', (e) => { if (!sidebar.contains(e.target) && !sidebarToggle.contains(e.target) && sidebar.classList.contains('active')) { sidebar.classList.remove('active'); } }); // Filter functionality const categoryFilter = document.getElementById('categoryFilter'); const tailorFilter = document.getElementById('tailorFilter'); const searchInput = document.getElementById('searchInput'); const designItems = document.querySelectorAll('.design-item'); function filterDesigns() { const category = categoryFilter.value; const tailor = tailorFilter.value; const search = searchInput.value.toLowerCase(); designItems.forEach(item => { const matchesCategory = !category || item.dataset.category === category; const matchesTailor = !tailor || item.dataset.tailor === tailor; const matchesSearch = !search || item.dataset.search.includes(search); item.style.display = (matchesCategory && matchesTailor && matchesSearch) ? 'block' : 'none'; }); } categoryFilter.addEventListener('change', filterDesigns); tailorFilter.addEventListener('change', filterDesigns); searchInput.addEventListener('input', filterDesigns); // Admin action buttons document.querySelectorAll('.admin-action').forEach(button => { button.addEventListener('click', () => { const designId = button.dataset.designId; const action = button.classList.contains('approve-btn') ? 'approve' : 'reject'; fetch('update_design_status.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `design_id=${designId}&action=${action}&csrf_token=d657f0e0f443d3533bc9c22b290c208204c3394359535574bebf30204da8794c` }).then(response => response.json()).then(data => { if (data.success) { button.closest('.design-item').style.display = 'none'; } else { alert(data.message || translations[savedLang].error); } }); }); }); // Form validation for upload modal document.getElementById('uploadDesignForm').addEventListener('submit', (e) => { const fileInput = document.getElementById('designImage'); const file = fileInput.files[0]; if (file && file.size > 2 * 1024 * 1024) { e.preventDefault(); alert(translations[savedLang].error_image_size); } }); // Initialize language updateLanguage(savedLang); });