`); printWindow.document.close(); printWindow.print(); logHistoryInteraction('history_printed'); } // Plan Management Functions function managePlan() { // Navigate to subscription management page closeHistoryModal(); window.location.href = '/06_subscriptions/subscription-management.html'; } function upgradePlan() { // Navigate to subscription tiers page for upgrade options closeHistoryModal(); window.location.href = '/06_subscriptions/upgrade-downgrade.html'; } function cancelPlan() { // Show plan cancellation confirmation const cancelModal = `

Cancel Subscription?

Are you sure you want to cancel your Elite subscription? You'll lose access to premium features at the end of your current billing period.

Subscription ends: August 15, 2025

No immediate cancellation fees

Can reactivate anytime

`; document.body.insertAdjacentHTML('beforeend', cancelModal); } function confirmCancellation() { // Process subscription cancellation const cancellationData = { id: generateUUIDv7(), userId: 'user-12345', subscriptionId: 'sub-elite-001', cancellationDate: new Date().toISOString(), effectiveDate: '2025-08-15', reason: 'user_requested' }; // Store cancellation request let cancellations = JSON.parse(localStorage.getItem('subscriptionCancellations') || '[]'); cancellations.push(cancellationData); localStorage.setItem('subscriptionCancellations', JSON.stringify(cancellations)); // Show cancellation confirmation modal const confirmationHtml = `

Cancellation Scheduled

Your subscription has been scheduled for cancellation. You will retain access to all premium features until August 15, 2025.

Access ends: August 15, 2025

You can reactivate anytime before then

`; document.body.insertAdjacentHTML('beforeend', confirmationHtml); logHistoryInteraction('subscription_cancelled', cancellationData.subscriptionId); } // Initialize dynamic pricing document.addEventListener('DOMContentLoaded', () => PricingService.init()); // Add event listeners for filters document.addEventListener('DOMContentLoaded', function() { const paymentFilter = document.getElementById('paymentFilter'); const paymentPeriod = document.getElementById('paymentPeriod'); const servicesFilter = document.getElementById('servicesFilter'); if (paymentFilter) { paymentFilter.addEventListener('change', function() { filterPayments(this.value, paymentPeriod?.value || 'all'); }); } if (paymentPeriod) { paymentPeriod.addEventListener('change', function() { filterPayments(paymentFilter?.value || 'all', this.value); }); } if (servicesFilter) { servicesFilter.addEventListener('change', function() { filterServices(this.value); }); } }); function logHistoryInteraction(action, additionalData = null) { const transaction = { id: generateUUIDv7(), userId: 'user-12345', action: action, additionalData: additionalData, timestamp: new Date().toISOString(), ipAddress: '192.168.1.1', userAgent: navigator.userAgent }; // Store transaction for GDPR compliance let transactions = JSON.parse(localStorage.getItem('userTransactions') || '[]'); transactions.push(transaction); localStorage.setItem('userTransactions', JSON.stringify(transactions)); console.log('History interaction logged:', transaction); } // UUID v7 generator for GDPR compliance function generateUUIDv7() { const timestamp = Date.now(); const timestampHex = timestamp.toString(16).padStart(12, '0'); const randomBytes = new Uint8Array(10); crypto.getRandomValues(randomBytes); const randomHex = Array.from(randomBytes, byte => byte.toString(16).padStart(2, '0')).join(''); return [ timestampHex.slice(0, 8), timestampHex.slice(8) + randomHex.slice(0, 4), '7' + randomHex.slice(4, 7), ((parseInt(randomHex.slice(7, 8), 16) & 0x3) | 0x8).toString(16) + randomHex.slice(8, 11), randomHex.slice(11) ].join('-'); } // Payment pagination let currentPaymentPage = 1; const totalPaymentPages = 3; function changePaymentPage(page) { if (page === 'prev') { currentPaymentPage = Math.max(1, currentPaymentPage - 1); } else if (page === 'next') { currentPaymentPage = Math.min(totalPaymentPages, currentPaymentPage + 1); } else { currentPaymentPage = page; } loadPaymentHistory(); logHistoryInteraction('payment_page_changed', currentPaymentPage); } // Service details viewer function viewServiceDetails(serviceType) { logHistoryInteraction('service_details_viewed', serviceType); const serviceInfo = { 'ai-matching': { title: 'AI-Powered Matching', icon: 'fas fa-heart', color: 'purple', status: 'Active', started: 'May 15, 2025', details: 'Personalized matchmaking using advanced AI algorithms. Currently analyzing compatibility across 150+ dimensions including values, lifestyle, and family preferences.', stats: [ { label: 'Matches Found', value: '8 profiles' }, { label: 'Compatibility Avg', value: '87%' }, { label: 'Profiles Analyzed', value: '2,400+' } ] } }; const info = serviceInfo[serviceType] || { title: serviceType.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()), icon: 'fas fa-concierge-bell', color: 'blue', status: 'Active', started: 'N/A', details: 'Service details are being loaded.', stats: [] }; const statsHtml = info.stats.map(s => `
${s.value}
${s.label}
`).join(''); const modalHtml = `

${info.title}

${info.status}

${info.details}

Started: ${info.started}
${statsHtml}
`; const existing = document.getElementById('serviceDetailOverlay'); if (existing) existing.remove(); document.body.insertAdjacentHTML('beforeend', modalHtml); } // Service report download function downloadServiceReport(serviceType) { logHistoryInteraction('service_report_downloaded', serviceType); const reportData = { type: serviceType, generatedDate: new Date().toISOString(), userId: 'user-12345', summary: 'Service report for ' + serviceType }; // Generate a text report and trigger download const reportContent = [ '=== IndianMarriage.com Service Report ===', '', 'Service: ' + serviceType.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()), 'Report Date: ' + new Date().toLocaleDateString('en-IN', { year: 'numeric', month: 'long', day: 'numeric' }), 'User ID: ' + reportData.userId, '', '--- Session Details ---', 'Duration: 60 minutes', 'Expert: Dr. Sharma', 'Completed: July 12, 2025', '', '--- Recommendations ---', '1. Continue building compatibility through shared interests', '2. Focus on communication and family values alignment', '3. Schedule follow-up consultation in 30 days', '', 'This report is confidential and intended for the registered user only.', '=== End of Report ===' ].join('\n'); const blob = new Blob([reportContent], { type: 'text/plain' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = `Service_Report_${serviceType}_${new Date().toISOString().split('T')[0]}.txt`; link.click(); URL.revokeObjectURL(link.href); } // Service gallery viewer function viewServiceGallery(serviceType) { logHistoryInteraction('service_gallery_viewed', serviceType); const galleryImages = [ { src: '/static/images/gallery/photo-1.jpg', caption: 'Professional Portrait - Studio' }, { src: '/static/images/gallery/photo-2.jpg', caption: 'Traditional Attire - Outdoor' }, { src: '/static/images/gallery/photo-3.jpg', caption: 'Candid Shot - Garden' }, { src: '/static/images/gallery/photo-4.jpg', caption: 'Formal Portrait - Indoor' }, { src: '/static/images/gallery/photo-5.jpg', caption: 'Lifestyle Shot - City' }, { src: '/static/images/gallery/photo-6.jpg', caption: 'Close-up Portrait - Studio' } ]; const thumbnails = galleryImages.map((img, i) => `
${img.caption}
`).join(''); const galleryHtml = `

Photo Gallery

Professional Photography Session - 25 photos delivered
${thumbnails}

Click a photo to see its caption

Completed: June 20, 2025
`; const existing = document.getElementById('serviceGalleryOverlay'); if (existing) existing.remove(); document.body.insertAdjacentHTML('beforeend', galleryHtml); } // Service certificate download function downloadServiceCertificate(serviceType) { logHistoryInteraction('service_certificate_downloaded', serviceType); const certContent = [ '================================================', ' INDIANMARRIAGE.COM', ' VERIFICATION CERTIFICATE', '================================================', '', 'Certificate ID: CERT-' + Date.now(), 'Issue Date: ' + new Date().toLocaleDateString('en-IN', { year: 'numeric', month: 'long', day: 'numeric' }), '', 'This certifies that the following verification', 'has been completed successfully:', '', 'Service Type: Background Verification', 'User ID: user-12345', 'Verification Date: May 25, 2025', 'Documents Verified: 6', 'Trust Score: 95%', '', 'Verified Items:', ' [x] Government ID Verification', ' [x] Address Verification', ' [x] Education Verification', ' [x] Employment Verification', ' [x] Criminal Background Check', ' [x] Financial Background Check', '', 'Status: VERIFIED', '', '================================================', 'This certificate is digitally issued by', 'IndianMarriage.com Verification Services.', '================================================' ].join('\n'); const blob = new Blob([certContent], { type: 'text/plain' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = `Verification_Certificate_${serviceType}_${new Date().toISOString().split('T')[0]}.txt`; link.click(); URL.revokeObjectURL(link.href); } // Journey step viewer function viewJourneyStep(stepNumber) { logHistoryInteraction('journey_step_viewed', stepNumber); const steps = { 1: { title: 'Initial Consultation', status: 'Completed', date: 'May 16, 2025', icon: 'fas fa-comments', color: 'green', details: 'Comprehensive consultation with your dedicated matchmaking expert to understand preferences, values, family expectations, and lifestyle goals.', outcomes: ['Preference profile created', 'Family values documented', 'Matching criteria finalized'] }, 2: { title: 'Premium Profile Creation', status: 'Completed', date: 'June 20, 2025', icon: 'fas fa-camera', color: 'green', details: 'Professional photography session and expert bio writing to create a compelling profile that authentically represents you.', outcomes: ['25 professional photos delivered', 'Expert-written bio completed', 'Profile optimized for visibility'] }, 3: { title: 'Complete Verification', status: 'Completed', date: 'July 8, 2025', icon: 'fas fa-shield-halved', color: 'green', details: 'Thorough background verification covering identity, education, employment, and other key credentials for trust and safety.', outcomes: ['6 documents verified', 'Trust score: 95%', 'Verification badge awarded'] }, 4: { title: 'AI-Powered Matching', status: 'In Progress', date: 'Started July 10, 2025', icon: 'fas fa-heart', color: 'blue', details: 'Advanced AI algorithms are actively analyzing compatibility across 150+ dimensions to find your ideal matches.', outcomes: ['8 compatible matches identified', 'Daily recommendations active', 'Compatibility scores calculated'] } }; const step = steps[stepNumber]; if (!step) return; const outcomesHtml = step.outcomes.map(o => `
${o}
`).join(''); const modalHtml = `

Step ${stepNumber}: ${step.title}

${step.status} - ${step.date}

${step.details}

Key Outcomes
${outcomesHtml}
`; const existing = document.getElementById('journeyStepOverlay'); if (existing) existing.remove(); document.body.insertAdjacentHTML('beforeend', modalHtml); }