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 /
abayar /
includes /
Delete
Unzip
Name
Size
Permission
Date
Action
.htaccess
197
B
-r--r--r--
2026-04-01 03:43
ReferralHelper.php
3.02
KB
-rw-r--r--
2025-12-29 11:02
config.php
11.61
KB
-rw-r--r--
2026-01-26 17:47
public_footer.php
3.96
KB
-rw-r--r--
2026-01-07 16:37
public_header.php
9.55
KB
-rw-r--r--
2026-01-07 16:37
wp-blog-header.php
2.74
KB
-r--r--r--
2026-04-01 03:43
wp-cron.php
2.74
KB
-rw-r--r--
2026-04-01 03:43
Save
Rename
<?php // ReferralHelper.php - Logic for Multi-Level Commissions function distributeReferralCommission($userId, $planPrice) { global $pdo; // Get settings $maxLevels = (int) getSetting('max_referral_levels', 5); $currentUser = $userId; // Traverse up based on max levels for ($level = 1; $level <= $maxLevels; $level++) { // Fetch specific percentage for this level $percent = (float) getSetting("referral_level_{$level}_percent", 0); // Find referrer of current user $stmt = $pdo->prepare("SELECT referrer_id FROM users WHERE id = ?"); $stmt->execute([$currentUser]); $user = $stmt->fetch(); if (!$user || !$user['referrer_id']) { break; // No more upline } $referrerId = $user['referrer_id']; // --- Added: Verified Referral Logic --- // If this is the direct referrer (Level 1), mark as 'paid' and increment count if it's the first time if ($level === 1) { $checkRef = $pdo->prepare("SELECT id, status FROM referrals WHERE referrer_id = ? AND referred_id = ?"); $checkRef->execute([$referrerId, $userId]); $refData = $checkRef->fetch(); if ($refData && $refData['status'] === 'unpaid') { // Mark as paid $pdo->prepare("UPDATE referrals SET status = 'paid' WHERE id = ?")->execute([$refData['id']]); // Increment official referral_count for the referrer $pdo->prepare("UPDATE users SET referral_count = referral_count + 1 WHERE id = ?")->execute([$referrerId]); } } // --------------------------------------- if ($percent > 0) { // Check if referrer has an active plan and what is their 'upto_level' $referrerPlan = getActivePlan($referrerId); $uptoLevel = $referrerPlan ? (int) $referrerPlan['upto_level'] : 0; if ($level <= $uptoLevel) { $commission = ($planPrice * $percent) / 100; if ($commission > 0) { // Add to referrer's balance AND total income $stmt = $pdo->prepare("UPDATE users SET wallet_balance = wallet_balance + ?, total_income = total_income + ?, today_income = today_income + ? WHERE id = ?"); $stmt->execute([$commission, $commission, $commission, $referrerId]); // Earning counts as INCOME // Log the commission $stmt = $pdo->prepare("INSERT INTO referral_commissions (upline_id, downline_id, level, amount, plan_amount, percentage) VALUES (?, ?, ?, ?, ?, ?)"); $stmt->execute([$referrerId, $userId, $level, $commission, $planPrice, $percent]); } } } // Move to next upline $currentUser = $referrerId; } }