// Company data (would be loaded from backend in production) var companyData = { 'company1': { name: 'Zanzibar Digital Solutions', type: 'Startup FZC', status: 'Active', registrationDate: '2025-04-01', purpose: 'Digital solutions and blockchain development', plan: 'Startup FZC - $50/month', nextBilling: '2025-06-01', paymentMethod: 'Credit Card (****4582)', shareholders: [ { name: 'John Smith', percentage: '60%' }, { name: 'Sarah Johnson', percentage: '40%' } ], contracts: [ { name: 'Articles of Incorporation', status: 'Signed' }, { name: 'Terms & Conditions', status: 'Signed' }, { name: 'Digital Asset Issuance', status: 'Signed' } ] }, 'company2': { name: 'Blockchain Innovations Ltd', type: 'Growth FZC', status: 'Active', registrationDate: '2025-03-15', purpose: 'Blockchain technology research and development', plan: 'Growth FZC - $100/month', nextBilling: '2025-06-15', paymentMethod: 'Bank Transfer', shareholders: [ { name: 'Michael Chen', percentage: '35%' }, { name: 'Aisha Patel', percentage: '35%' }, { name: 'David Okonkwo', percentage: '30%' } ], contracts: [ { name: 'Articles of Incorporation', status: 'Signed' }, { name: 'Terms & Conditions', status: 'Signed' }, { name: 'Digital Asset Issuance', status: 'Signed' }, { name: 'Physical Asset Holding', status: 'Signed' } ] }, 'company3': { name: 'Sustainable Energy Cooperative', type: 'Cooperative FZC', status: 'Pending', registrationDate: '2025-05-01', purpose: 'Renewable energy production and distribution', plan: 'Cooperative FZC - $200/month', nextBilling: 'Pending Activation', paymentMethod: 'Pending', shareholders: [ { name: 'Community Energy Group', percentage: '40%' }, { name: 'Green Future Initiative', percentage: '30%' }, { name: 'Sustainable Living Collective', percentage: '30%' } ], contracts: [ { name: 'Articles of Incorporation', status: 'Signed' }, { name: 'Terms & Conditions', status: 'Signed' }, { name: 'Cooperative Governance', status: 'Pending' } ] } }; // Current company ID for modal var currentCompanyId = null; // View company details function function viewCompanyDetails(companyId) { // Store current company ID currentCompanyId = companyId; // Get company data const company = companyData[companyId]; if (!company) return; // Update modal title document.getElementById('companyDetailsModalLabel').innerHTML = `${company.name} Details`; // Update general information document.getElementById('modal-company-name').textContent = company.name; document.getElementById('modal-company-type').textContent = company.type; document.getElementById('modal-registration-date').textContent = company.registrationDate; // Update status with appropriate badge const statusBadge = company.status === 'Active' ? `${company.status}` : `${company.status}`; document.getElementById('modal-status').innerHTML = statusBadge; document.getElementById('modal-purpose').textContent = company.purpose; // Update billing information document.getElementById('modal-plan').textContent = company.plan; document.getElementById('modal-next-billing').textContent = company.nextBilling; document.getElementById('modal-payment-method').textContent = company.paymentMethod; // Update shareholders table const shareholdersTable = document.getElementById('modal-shareholders'); shareholdersTable.innerHTML = ''; company.shareholders.forEach(shareholder => { const row = document.createElement('tr'); row.innerHTML = `