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 /
deployment_package /
Delete
Unzip
Name
Size
Permission
Date
Action
admin
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
assets
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
db
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
includes
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
uploads
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
user
[ DIR ]
drwxr-xr-x
2025-10-18 01:48
DEPLOYMENT_INSTRUCTIONS.md
3.05
KB
-rw-r--r--
2025-10-18 01:48
FIX_DUPLICATE_COMMISSIONS.md
3.63
KB
-rw-r--r--
2025-10-18 00:32
FIX_USER_EDIT_ISSUE.md
6.15
KB
-rw-r--r--
2025-10-18 00:44
IMPROVEMENTS_SUMMARY.md
4.11
KB
-rw-r--r--
2025-10-18 00:40
README.txt
2.34
KB
-rw-r--r--
2025-10-17 23:08
README_DEPLOYMENT.txt
1.74
KB
-rw-r--r--
2025-10-18 01:49
README_REFERRAL_COMMISSIONS.md
4.02
KB
-rw-r--r--
2025-10-18 00:22
SQL_CHANGES_SUMMARY.md
2.02
KB
-rw-r--r--
2025-10-18 00:25
apply_database_fixes.php
5.17
KB
-rw-r--r--
2025-10-18 00:39
check_commission_levels.php
3.16
KB
-rw-r--r--
2025-10-18 00:53
check_database_structure.php
3.9
KB
-rw-r--r--
2025-10-18 00:55
check_duplicate_commissions.php
4.38
KB
-rw-r--r--
2025-10-18 00:32
check_referrals_table.php
2.28
KB
-rw-r--r--
2025-10-18 00:39
complete_setup.sql
5.34
KB
-rw-r--r--
2025-10-18 00:25
complete_setup_for_import.sql
5.36
KB
-rw-r--r--
2025-10-18 01:59
create_table_direct.php
3.44
KB
-rw-r--r--
2025-10-18 00:09
css_test.php
999
B
-rw-r--r--
2025-10-18 02:06
debug_referral_chain.php
6.88
KB
-rw-r--r--
2025-10-18 00:54
fix_duplicate_commissions.php
2.67
KB
-rw-r--r--
2025-10-18 00:31
fix_referral_commissions.sql
677
B
-rw-r--r--
2025-10-18 00:25
fix_referral_commissions_for_import.sql
705
B
-rw-r--r--
2025-10-18 01:59
index.php
25.74
KB
-rw-r--r--
2025-10-18 02:05
index_with_css_fix.php
25.82
KB
-rw-r--r--
2025-10-18 02:06
login.php
4.15
KB
-rw-r--r--
2025-10-18 02:05
logout.php
88
B
-rw-r--r--
2025-10-17 23:02
register.php
6.58
KB
-rw-r--r--
2025-10-18 02:05
run_setup.bat
714
B
-rw-r--r--
2025-10-18 00:23
setup_referral_commissions.php
2.73
KB
-rw-r--r--
2025-10-18 00:21
test.php
59
B
-rw-r--r--
2025-10-17 23:16
test_commission_application.php
6.93
KB
-rw-r--r--
2025-10-18 00:55
test_commission_display.php
3.26
KB
-rw-r--r--
2025-10-18 00:19
test_commission_fix.php
3.16
KB
-rw-r--r--
2025-10-18 00:39
test_mobile_menu.php
2.73
KB
-rw-r--r--
2025-10-18 01:24
test_referral.php
2.07
KB
-rw-r--r--
2025-10-17 23:55
update_referral_commissions.sql
682
B
-rw-r--r--
2025-10-18 00:25
update_referral_commissions_for_import.sql
710
B
-rw-r--r--
2025-10-18 01:59
update_referrals_table.sql
398
B
-rw-r--r--
2025-10-18 00:31
update_referrals_table_for_import.sql
426
B
-rw-r--r--
2025-10-18 01:59
verify_commissions.php
3.28
KB
-rw-r--r--
2025-10-18 00:20
verify_commissions_working.php
8.2
KB
-rw-r--r--
2025-10-18 00:56
Save
Rename
<?php require_once 'includes/db.php'; echo "<h2>Verify Commissions Are Working</h2>"; try { // Check if referral commissions exist $stmt = $pdo->prepare("SELECT * FROM referral_commissions ORDER BY level ASC"); $stmt->execute(); $commission_levels = $stmt->fetchAll(); if (count($commission_levels) == 0) { echo "<p style='color: orange;'>No commission levels found. Creating default levels...</p>"; // Insert default commission levels $stmt = $pdo->prepare("INSERT IGNORE INTO referral_commissions (level, commission_percentage) VALUES (?, ?), (?, ?), (?, ?)"); $stmt->execute([1, 10.00, 2, 5.00, 3, 2.00]); // Re-fetch $stmt = $pdo->prepare("SELECT * FROM referral_commissions ORDER BY level ASC"); $stmt->execute(); $commission_levels = $stmt->fetchAll(); if (count($commission_levels) > 0) { echo "<p style='color: green;'>✓ Default commission levels created successfully</p>"; } } echo "<h3>Current Commission Levels:</h3>"; if (count($commission_levels) > 0) { echo "<table border='1' cellpadding='5' cellspacing='0'>"; echo "<tr><th>Level</th><th>Commission %</th></tr>"; foreach ($commission_levels as $level) { echo "<tr><td>" . $level['level'] . "</td><td>" . number_format($level['commission_percentage'], 2) . "%</td></tr>"; } echo "</table>"; } // Test commission calculation echo "<h3>Testing Commission Calculation:</h3>"; // Include the commission calculation function include 'user/membership.php'; // Create a test scenario $test_amount = 1000.00; echo "<p>Test amount: ₨" . number_format($test_amount, 2) . "</p>"; // Calculate expected commissions $total_expected = 0; echo "<p>Expected commissions:</p>"; echo "<ul>"; foreach ($commission_levels as $level_data) { $level = $level_data['level']; $percentage = $level_data['commission_percentage']; $commission = ($test_amount * $percentage) / 100; $total_expected += $commission; echo "<li>Level " . $level . " (" . $percentage . "%): ₨" . number_format($commission, 2) . "</li>"; } echo "<li><strong>Total: ₨" . number_format($total_expected, 2) . "</strong></li>"; echo "</ul>"; // Test the getReferrerAtLevel function echo "<h3>Testing Referral Chain:</h3>"; // Create test users if they don't exist $stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute(['commission_test_referrer@example.com']); $referrer = $stmt->fetch(); if (!$referrer) { // Create referrer $stmt = $pdo->prepare("INSERT INTO users (fullname, email, phone, password, referral_code, balance) VALUES (?, ?, ?, ?, ?, ?)"); $stmt->execute([ 'Test Referrer', 'commission_test_referrer@example.com', '03000000001', password_hash('password123', PASSWORD_DEFAULT), 'TESTREF001', 0.00 ]); $referrer_id = $pdo->lastInsertId(); echo "<p style='color: green;'>✓ Created referrer user with ID: " . $referrer_id . "</p>"; } else { $referrer_id = $referrer['id']; echo "<p>Using existing referrer with ID: " . $referrer_id . "</p>"; } // Create referred user $stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute(['commission_test_referred@example.com']); $referred = $stmt->fetch(); if (!$referred) { $stmt = $pdo->prepare("INSERT INTO users (fullname, email, phone, password, referral_code, referred_by, balance) VALUES (?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([ 'Test Referred', 'commission_test_referred@example.com', '03000000002', password_hash('password123', PASSWORD_DEFAULT), 'TESTREF002', $referrer_id, 0.00 ]); $referred_id = $pdo->lastInsertId(); echo "<p style='color: green;'>✓ Created referred user with ID: " . $referred_id . "</p>"; } else { $referred_id = $referred['id']; echo "<p>Using existing referred user with ID: " . $referred_id . "</p>"; } // Get referrer's balance before $stmt = $pdo->prepare("SELECT balance FROM users WHERE id = ?"); $stmt->execute([$referrer_id]); $balance_before = $stmt->fetch()['balance']; echo "<p>Referrer balance before test: ₨" . number_format($balance_before, 2) . "</p>"; // Test the getReferrerAtLevel function echo "<h4>Testing getReferrerAtLevel function:</h4>"; for ($i = 1; $i <= 3; $i++) { $referrer_result = getReferrerAtLevel($pdo, $referred_id, $i); if ($referrer_result) { echo "<p>Level " . $i . " referrer: ID " . $referrer_result['id'] . "</p>"; } else { echo "<p>Level " . $i . " referrer: None</p>"; } } // Test commission calculation echo "<h4>Testing commission calculation:</h4>"; // Clear any existing test referrals for this user $stmt = $pdo->prepare("DELETE FROM referrals WHERE referred_user_id = ? AND source_transaction_id = ?"); $stmt->execute([$referred_id, 999999]); // Calculate commissions calculateReferralCommissions($pdo, $referred_id, $test_amount, 999999); // Get referrer's balance after $stmt = $pdo->prepare("SELECT balance FROM users WHERE id = ?"); $stmt->execute([$referrer_id]); $balance_after = $stmt->fetch()['balance']; echo "<p>Referrer balance after test: ₨" . number_format($balance_after, 2) . "</p>"; $actual_commission = $balance_after - $balance_before; echo "<p>Actual commission earned: ₨" . number_format($actual_commission, 2) . "</p>"; if (abs($actual_commission - $total_expected) < 0.01) { echo "<p style='color: green; font-weight: bold;'>✓ Commission calculation is working correctly!</p>"; } else { echo "<p style='color: red; font-weight: bold;'>✗ Commission calculation is NOT working correctly!</p>"; echo "<p>Expected: ₨" . number_format($total_expected, 2) . "</p>"; echo "<p>Actual: ₨" . number_format($actual_commission, 2) . "</p>"; echo "<p>Difference: ₨" . number_format(abs($actual_commission - $total_expected), 2) . "</p>"; } // Check referral records echo "<h3>Referral Records Created:</h3>"; $stmt = $pdo->prepare("SELECT * FROM referrals WHERE referred_user_id = ? AND source_transaction_id = ? ORDER BY level ASC"); $stmt->execute([$referred_id, 999999]); $referrals = $stmt->fetchAll(); if (count($referrals) > 0) { echo "<table border='1' cellpadding='5' cellspacing='0'>"; echo "<tr><th>ID</th><th>Level</th><th>Amount</th><th>User ID</th></tr>"; foreach ($referrals as $referral) { echo "<tr>"; echo "<td>" . $referral['id'] . "</td>"; echo "<td>" . $referral['level'] . "</td>"; echo "<td>₨" . number_format($referral['commission_amount'], 2) . "</td>"; echo "<td>" . $referral['user_id'] . "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "<p>No referral records found.</p>"; } // Clean up test data echo "<h3>Cleaning up test data:</h3>"; $stmt = $pdo->prepare("DELETE FROM referrals WHERE source_transaction_id = ?"); $stmt->execute([999999]); $stmt = $pdo->prepare("UPDATE users SET balance = ? WHERE id = ?"); $stmt->execute([$balance_before, $referrer_id]); echo "<p style='color: green;'>✓ Test data cleaned up</p>"; } catch (PDOException $e) { echo "<p style='color: red;'>Database error: " . $e->getMessage() . "</p>"; } echo "<hr>"; echo "<p><a href='admin/referral_commissions.php'>Go to Admin Referral Commissions</a> | "; echo "<a href='user/dashboard.php'>Go to User Dashboard</a> | "; echo "<a href='check_commission_levels.php'>Check Commission Levels</a></p>"; ?>