Linux spg1.cloudpowerdns.com 5.14.0-611.34.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 18 05:51:10 EST 2026 x86_64
LiteSpeed
Server IP : 176.9.63.151 & Your IP : 216.73.217.60
Domains :
Cant Read [ /etc/named.conf ]
User : fastear1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
fastear1 /
.trash /
user.1 /
Delete
Unzip
Name
Size
Permission
Date
Action
ads.php
4.94
KB
-rw-r--r--
2025-10-17 23:43
dashboard.php
10.78
KB
-rw-r--r--
2025-10-18 00:40
deposit.php
6.02
KB
-rw-r--r--
2025-10-17 23:02
deposit_history.php
3.23
KB
-rw-r--r--
2025-10-17 23:03
dpin.php
5.9
KB
-rw-r--r--
2025-10-17 23:03
footer.php
565
B
-rw-r--r--
2025-10-17 23:02
header.php
12.32
KB
-rw-r--r--
2025-10-18 02:06
invite.php
3.53
KB
-rw-r--r--
2025-10-18 00:19
membership.php
11.7
KB
-rw-r--r--
2025-10-18 00:56
profile.php
5.27
KB
-rw-r--r--
2025-10-17 23:04
team.php
5.26
KB
-rw-r--r--
2025-10-17 23:50
transactions.php
3.85
KB
-rw-r--r--
2025-10-17 23:04
withdraw.php
6.19
KB
-rw-r--r--
2025-10-17 23:03
Save
Rename
<?php $title = 'Membership Plans'; include 'header.php'; // Function to calculate and distribute referral commissions function calculateReferralCommissions($pdo, $user_id, $amount, $transaction_id = null) { try { // If transaction_id is provided, check if commissions have already been calculated for this transaction if ($transaction_id) { $stmt = $pdo->prepare("SELECT COUNT(*) as count FROM referrals WHERE source_transaction_id = ?"); $stmt->execute([$transaction_id]); if ($stmt->fetch()['count'] > 0) { // Commissions already calculated for this transaction return; } } // Get referral commission levels $stmt = $pdo->prepare("SELECT * FROM referral_commissions ORDER BY level ASC"); $stmt->execute(); $commission_levels = $stmt->fetchAll(); // Get user's referrer $stmt = $pdo->prepare("SELECT referred_by FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); if (!$user || !$user['referred_by']) { return; // No referrer } // Calculate commissions for each level foreach ($commission_levels as $level_data) { $level = $level_data['level']; $percentage = $level_data['commission_percentage']; // Get the referrer at this level $referrer = getReferrerAtLevel($pdo, $user_id, $level); if ($referrer) { $commission_amount = ($amount * $percentage) / 100; // Add commission to referrer's balance $stmt = $pdo->prepare("UPDATE users SET balance = balance + ? WHERE id = ?"); $stmt->execute([$commission_amount, $referrer['id']]); // Add transaction record $stmt = $pdo->prepare("INSERT INTO transactions (user_id, type, amount, note) VALUES (?, 'commission', ?, ?)"); $stmt->execute([$referrer['id'], $commission_amount, 'Referral commission (Level ' . $level . '): ' . $percentage . '% of ₨' . number_format($amount, 2)]); // Get the transaction ID of the newly inserted commission transaction $commission_transaction_id = $pdo->lastInsertId(); // Add referral record if ($transaction_id) { // If we have a transaction ID, include it in the referral record $stmt = $pdo->prepare("INSERT INTO referrals (user_id, referred_user_id, level, commission_amount, transaction_id, source_transaction_id) VALUES (?, ?, ?, ?, ?, ?)"); $stmt->execute([$referrer['id'], $user_id, $level, $commission_amount, $commission_transaction_id, $transaction_id]); } else { // If we don't have a transaction ID, insert without it $stmt = $pdo->prepare("INSERT INTO referrals (user_id, referred_user_id, level, commission_amount, transaction_id) VALUES (?, ?, ?, ?, ?)"); $stmt->execute([$referrer['id'], $user_id, $level, $commission_amount, $commission_transaction_id]); } } } } catch (PDOException $e) { // Log error but don't stop the process error_log('Referral commission calculation failed: ' . $e->getMessage()); } } // Function to get referrer at a specific level function getReferrerAtLevel($pdo, $user_id, $level) { try { $current_user_id = $user_id; // Traverse up the referral chain for ($i = 1; $i <= $level; $i++) { $stmt = $pdo->prepare("SELECT referred_by FROM users WHERE id = ?"); $stmt->execute([$current_user_id]); $user = $stmt->fetch(); if (!$user || !$user['referred_by']) { return null; // No referrer at this level } $current_user_id = $user['referred_by']; } // Get the referrer details $stmt = $pdo->prepare("SELECT id FROM users WHERE id = ?"); $stmt->execute([$current_user_id]); return $stmt->fetch(); } catch (PDOException $e) { return null; } } $error = ''; $success = ''; // Handle plan purchase if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['plan_id'])) { $plan_id = intval($_POST['plan_id']); try { // Get plan details $stmt = $pdo->prepare("SELECT * FROM plans WHERE id = ? AND status = 'active'"); $stmt->execute([$plan_id]); $plan = $stmt->fetch(); if (!$plan) { $error = 'Invalid or inactive plan selected.'; } elseif ($user['balance'] < $plan['price']) { $error = 'Insufficient balance to purchase this plan.'; } else { // Check if user already has an active plan if ($user['current_plan']) { // Get current plan details $stmt = $pdo->prepare("SELECT * FROM plans WHERE id = ?"); $stmt->execute([$user['current_plan']]); $current_plan = $stmt->fetch(); if ($current_plan) { $error = 'You already have an active plan (' . htmlspecialchars($current_plan['name']) . '). Please wait until it expires to purchase a new one.'; } } if (empty($error)) { // Deduct plan price from user balance $stmt = $pdo->prepare("UPDATE users SET balance = balance - ?, current_plan = ? WHERE id = ?"); $stmt->execute([$plan['price'], $plan_id, $_SESSION['user_id']]); // Add transaction record $stmt = $pdo->prepare("INSERT INTO transactions (user_id, type, amount, note) VALUES (?, 'deposit', ?, ?)"); $stmt->execute([$_SESSION['user_id'], $plan['price'], 'Membership plan purchase: ' . $plan['name']]); // Get the transaction ID of the newly inserted transaction $transaction_id = $pdo->lastInsertId(); // Calculate and distribute referral commissions calculateReferralCommissions($pdo, $_SESSION['user_id'], $plan['price'], $transaction_id); $success = 'Plan purchased successfully! Your ' . htmlspecialchars($plan['name']) . ' is now active.'; // Update user data for display $user['balance'] -= $plan['price']; $user['current_plan'] = $plan_id; } } } catch (PDOException $e) { $error = 'Failed to purchase plan. Please try again.'; } } // Get all active plans try { $stmt = $pdo->prepare("SELECT * FROM plans WHERE status = 'active' ORDER BY price ASC"); $stmt->execute(); $plans = $stmt->fetchAll(); } catch (PDOException $e) { $plans = []; $error = 'Failed to fetch membership plans.'; } ?> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> <h1 class="h2">Membership Plans</h1> </div> <?php if ($error): ?> <div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div> <?php endif; ?> <?php if ($success): ?> <div class="alert alert-success"><?php echo htmlspecialchars($success); ?></div> <?php endif; ?> <div class="row"> <div class="col-md-8"> <div class="card"> <div class="card-body"> <h5 class="card-title">Your Current Balance</h5> <h3>₨<?php echo number_format($user['balance'], 2); ?></h3> <?php if ($user['current_plan']): ?> <?php // Get current plan details $stmt = $pdo->prepare("SELECT * FROM plans WHERE id = ?"); $stmt->execute([$user['current_plan']]); $current_plan = $stmt->fetch(); ?> <?php if ($current_plan): ?> <p class="text-muted">Current Plan: <strong><?php echo htmlspecialchars($current_plan['name']); ?></strong></p> <?php endif; ?> <?php else: ?> <p class="text-muted">You don't have an active plan. Purchase one below to start earning!</p> <?php endif; ?> </div> </div> </div> <div class="col-md-4"> <div class="card"> <div class="card-body"> <h5 class="card-title">How to Purchase</h5> <ol> <li>Choose a plan that fits your needs</li> <li>Click "Buy Now" to purchase with your balance</li> <li>Start earning immediately!</li> </ol> <p class="mb-0">Need more balance? <a href="deposit.php">Deposit funds</a></p> </div> </div> </div> </div> <div class="row mt-4"> <div class="col-12"> <div class="card"> <div class="card-body"> <h5 class="card-title">Available Membership Plans</h5> <?php if (count($plans) > 0): ?> <div class="row"> <?php foreach ($plans as $plan): ?> <div class="col-md-4 mb-4"> <div class="card h-100"> <div class="card-header bg-primary text-white"> <h4 class="my-0 fw-normal"><?php echo htmlspecialchars($plan['name']); ?></h4> </div> <div class="card-body"> <h1 class="card-title pricing-card-title">₨<?php echo number_format($plan['price'], 2); ?><small class="text-muted fw-light">/mo</small></h1> <ul class="list-unstyled mt-3 mb-4"> <li><?php echo $plan['daily_ads']; ?> Ads Per Day</li> <li>₨<?php echo number_format($plan['per_ad_earning'], 2); ?> Per Ad</li> <li><?php echo $plan['duration']; ?> Days Validity</li> <li>24/7 Support</li> </ul> <?php if ($user['balance'] >= $plan['price'] && !$user['current_plan']): ?> <form method="POST"> <input type="hidden" name="plan_id" value="<?php echo $plan['id']; ?>"> <button type="submit" class="w-100 btn btn-lg btn-primary">Buy Now</button> </form> <?php elseif ($user['current_plan']): ?> <button class="w-100 btn btn-lg btn-secondary" disabled>Already Purchased</button> <?php else: ?> <button class="w-100 btn btn-lg btn-secondary" disabled>Insufficient Balance</button> <?php endif; ?> </div> </div> </div> <?php endforeach; ?> </div> <?php else: ?> <p>No membership plans available at the moment. Please check back later.</p> <?php endif; ?> </div> </div> </div> </div> <?php include 'footer.php'; ?>