prepare("SELECT * FROM products WHERE name = ?"); $stmt->execute([$package_name]); $package = $stmt->fetch(PDO::FETCH_ASSOC); if (!$package) { die("Package not found."); } // Check if user owns this package $user_id = $_SESSION['user_id']; $stmt = $pdo->prepare("SELECT * FROM user_products WHERE user_id = ? AND product_id = ?"); $stmt->execute([$user_id, $package['id']]); $user_has_package = $stmt->fetch(PDO::FETCH_ASSOC); if (!$user_has_package) { die("You do not have access to this package."); } // Generate HTML for the package page $page_title = $package['name']; $package_content = generatePackageContent($package['name']); // Function to generate specific content based on package function generatePackageContent($package_name) { switch ($package_name) { case 'Diamond Package': return '

💎 Diamond Package Benefits

Your Diamond Package Stats

Total Earnings

KES 15,240.00

Active Investments

3

'; case 'Starlight Bundle': return '

✨ Starlight Bundle Benefits

'; // Add more cases for other packages default: return '

' . htmlspecialchars($package_name) . '

Welcome to your package dashboard. Here you can monitor your investments and benefits.

'; } } // Output the HTML page ?> <?php echo htmlspecialchars($page_title); ?> - Japanese Motors
Jmotors

Package Actions

Performance Metrics

Return on Investment

75%

Package Utilization

60%