// Mock data for admin panel const mockContacts = [ { id: 1, name: "John Doe", email: "john@example.com", phone: "555-1234", city: "New York", attachments: [ { name: "project-brief.pdf", url: "http://static.photos/document/640x360/1" }, { name: "reference.jpg", url: "http://static.photos/nature/640x360/1" } ] }, { id: 2, name: "Jane Smith", email: "jane@example.com", phone: "555-5678", city: "Los Angeles", attachments: [] } ]; const mockSubscribers = [ { id: 1, email: "user1@example.com", date: "2023-01-15" }, { id: 2, email: "user2@example.com", date: "2023-02-20" } ]; // DOM elements const adminContent = document.getElementById('admin-content'); // Navigation functions function loadProjectsManagement() { adminContent.innerHTML = `

Projects Management

${mockProjects.map(project => ` `).join('')}
Image Name Description Actions
${project.name} ${project.name} ${project.description.substring(0, 50)}...
`; feather.replace(); // Form toggle document.getElementById('add-project-btn').addEventListener('click', () => { document.getElementById('add-project-form').classList.toggle('hidden'); }); document.getElementById('cancel-project-btn').addEventListener('click', () => { document.getElementById('add-project-form').classList.add('hidden'); }); // Form submission document.getElementById('project-form').addEventListener('submit', (e) => { e.preventDefault(); alert('Project saved successfully!'); document.getElementById('add-project-form').classList.add('hidden'); document.getElementById('project-form').reset(); }); } function loadClientsManagement() { adminContent.innerHTML = `

Clients Management

${mockClients.map(client => ` `).join('')}
Image Name Designation Testimonial Actions
${client.name} ${client.name} ${client.designation} "${client.description.substring(0, 50)}..."
`; feather.replace(); // Form toggle document.getElementById('add-client-btn').addEventListener('click', () => { document.getElementById('add-client-form').classList.toggle('hidden'); }); document.getElementById('cancel-client-btn').addEventListener('click', () => { document.getElementById('add-client-form').classList.add('hidden'); }); // Form submission document.getElementById('client-form').addEventListener('submit', (e) => { e.preventDefault(); alert('Client saved successfully!'); document.getElementById('add-client-form').classList.add('hidden'); document.getElementById('client-form').reset(); }); } function loadContactResponses() { adminContent.innerHTML = `

Contact Form Responses

${mockContacts.map(contact => ` `).join('')}
Name Email Phone City Actions
${contact.name} ${contact.email} ${contact.phone} ${contact.city}
${contact.attachments.length > 0 ? `
` : ''}
`; feather.replace(); } function loadSubscribers() { adminContent.innerHTML = `

Newsletter Subscribers

${mockSubscribers.map(subscriber => ` `).join('')}
Email Subscription Date Actions
${subscriber.email} ${subscriber.date}
`; feather.replace(); } // Initialize admin panel document.addEventListener('DOMContentLoaded', function() { // This would be set based on navigation in the sidebar component // For now, we'll default to projects management loadProjectsManagement(); });