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 /
public /
Delete
Unzip
Name
Size
Permission
Date
Action
data
[ DIR ]
drwxr-xr-x
2025-09-15 23:22
uploads
[ DIR ]
drwxr-xr-x
2025-09-15 18:00
COMPLETE_SETUP_GUIDE.md
5.02
KB
-rw-r--r--
2025-09-15 23:45
DATABASE_SETUP.md
2.84
KB
-rw-r--r--
2025-09-15 23:41
FIX_ACCESS_DENIED.md
2.36
KB
-rw-r--r--
2025-09-16 00:07
MIGRATION_SUMMARY.md
4.28
KB
-rw-r--r--
2025-09-15 23:45
NEXT_STEPS.md
2.18
KB
-rw-r--r--
2025-09-15 23:45
PHPMYADMIN_SETUP_GUIDE.md
3.61
KB
-rw-r--r--
2025-09-15 23:43
QUICK_FIX_INSTRUCTIONS.md
1.99
KB
-rw-r--r--
2025-09-16 00:09
admin-dashboard.html
25.26
KB
-rw-r--r--
2025-09-15 17:29
admin-login.html
5.25
KB
-rw-r--r--
2025-09-15 02:24
admin-profile.html
24.21
KB
-rw-r--r--
2025-09-15 17:43
analytics.html
25.08
KB
-rw-r--r--
2025-09-15 16:13
check_mysql.php
1.33
KB
-rw-r--r--
2025-09-15 23:44
cleanup_duplicates.php
1.46
KB
-rw-r--r--
2025-09-15 23:08
complete_workflow_test.php
4.46
KB
-rw-r--r--
2025-09-15 23:22
create_test_user.php
1.15
KB
-rw-r--r--
2025-09-15 23:20
database.php
4.29
KB
-rw-r--r--
2025-09-15 23:43
database_mysql.php
9.98
KB
-rw-r--r--
2025-09-16 00:08
db_config.php
587
B
-rw-r--r--
2025-09-16 00:07
demo-enhanced.html
45.46
KB
-rw-r--r--
2025-09-15 01:43
deposit.html
10.83
KB
-rw-r--r--
2025-09-15 17:08
error_log
825
B
-rw-r--r--
2025-10-04 15:48
fastearnads.sql
6.12
KB
-rw-r--r--
2025-09-15 23:39
fastearnads_tables_only.sql
5.96
KB
-rw-r--r--
2025-09-16 00:07
final_test.php
4.73
KB
-rw-r--r--
2025-09-15 23:29
import_database.bat
1.03
KB
-rw-r--r--
2025-09-15 23:45
index.php
50.11
KB
-rw-r--r--
2025-09-15 23:40
manage-ads.html
25.39
KB
-rw-r--r--
2025-09-15 16:12
manage-users.html
42.4
KB
-rw-r--r--
2025-09-15 16:54
manage-withdraws.html
49.19
KB
-rw-r--r--
2025-09-15 15:54
migrate_data.php
1.6
KB
-rw-r--r--
2025-09-15 23:40
simple-login.html
1.19
KB
-rw-r--r--
2025-09-15 02:08
start_mysql.bat
948
B
-rw-r--r--
2025-09-15 23:45
test_admin_approval.php
3.55
KB
-rw-r--r--
2025-09-15 23:21
test_connection_with_user.php
1.9
KB
-rw-r--r--
2025-09-15 19:19
test_db_connection.php
1.54
KB
-rw-r--r--
2025-09-15 23:41
test_deposit_fix.php
2.88
KB
-rw-r--r--
2025-09-15 23:09
test_frontend.html
3.49
KB
-rw-r--r--
2025-09-15 23:22
test_user_activity_history.php
2.96
KB
-rw-r--r--
2025-09-15 23:21
user-ads.html
18.36
KB
-rw-r--r--
2025-09-15 14:39
user-dashboard.html
47.77
KB
-rw-r--r--
2025-09-15 23:26
user-login.html
5.78
KB
-rw-r--r--
2025-09-15 02:27
user-profile.html
33.93
KB
-rw-r--r--
2025-09-15 18:33
user-register.html
7.56
KB
-rw-r--r--
2025-09-15 02:27
user-transactions.html
31.83
KB
-rw-r--r--
2025-09-15 22:58
user-withdraw.html
29.48
KB
-rw-r--r--
2025-09-15 21:52
user-withdrawals.html
29.17
KB
-rw-r--r--
2025-09-15 21:51
waiting-approval.html
5.46
KB
-rw-r--r--
2025-09-15 03:23
Save
Rename
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>All Transactions - FastEarnAds</title> <script src="https://cdn.tailwindcss.com"></script> <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script> <style> [x-cloak] { display: none !important; } .transaction-enter { animation: slideInUp 0.3s ease-out; } @keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .filter-active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; } </style> </head> <body class="bg-gray-50" x-data="transactionsData()" x-init="loadData()"> <!-- Header --> <header class="bg-white shadow-sm border-b border-gray-200"> <div class="max-w-6xl mx-auto px-4 py-4"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-3"> <div class="w-10 h-10 bg-gradient-to-r from-blue-600 to-purple-600 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v4a2 2 0 01-2 2H9a2 2 0 00-2 2z"/> </svg> </div> <div> <h1 class="text-xl font-bold text-gray-900">All Transactions</h1> <p class="text-sm text-gray-600">Complete history of your activities</p> </div> </div> <div class="flex items-center space-x-4"> <a href="/dashboard" class="text-gray-600 hover:text-gray-800 text-sm font-medium flex items-center"> <svg class="w-4 h-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z"/> </svg> Back to Dashboard </a> <form action="/user/logout" method="POST" class="inline"> <button type="submit" class="text-red-600 hover:text-red-700 text-sm font-medium"> Logout </button> </form> </div> </div> </div> </header> <!-- Main Content --> <div class="max-w-6xl mx-auto px-4 py-8"> <!-- Summary Cards --> <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8"> <div class="bg-white rounded-xl p-6 shadow-sm border"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-600">Total Earned</p> <p class="text-2xl font-bold text-green-600" x-text="'$' + summary.totalEarned">$0.00</p> </div> <div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1"/> </svg> </div> </div> </div> <div class="bg-white rounded-xl p-6 shadow-sm border"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-600">Ads Watched</p> <p class="text-2xl font-bold text-blue-600" x-text="summary.adsWatched">0</p> </div> <div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/> </svg> </div> </div> </div> <div class="bg-white rounded-xl p-6 shadow-sm border"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-600">Total Withdrawals</p> <p class="text-2xl font-bold text-purple-600" x-text="'$' + summary.totalWithdrawn">$0.00</p> </div> <div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z"/> </svg> </div> </div> </div> <div class="bg-white rounded-xl p-6 shadow-sm border"> <div class="flex items-center justify-between"> <div> <p class="text-sm font-medium text-gray-600">Current Balance</p> <p class="text-2xl font-bold text-indigo-600" x-text="'$' + summary.currentBalance">$0.00</p> </div> <div class="w-12 h-12 bg-indigo-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/> </svg> </div> </div> </div> </div> <!-- Filters --> <div class="bg-white rounded-xl shadow-sm border p-6 mb-8"> <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4"> <h3 class="text-lg font-semibold text-gray-900">Transaction History</h3> <div class="flex flex-wrap gap-2"> <button @click="setFilter('all')" :class="activeFilter === 'all' ? 'filter-active' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'" class="px-4 py-2 rounded-lg text-sm font-medium transition-colors"> All </button> <button @click="setFilter('ad_watch')" :class="activeFilter === 'ad_watch' ? 'filter-active' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'" class="px-4 py-2 rounded-lg text-sm font-medium transition-colors"> Ad Earnings </button> <button @click="setFilter('withdraw')" :class="activeFilter === 'withdraw' ? 'filter-active' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'" class="px-4 py-2 rounded-lg text-sm font-medium transition-colors"> Withdrawals </button> <button @click="setFilter('deposit')" :class="activeFilter === 'deposit' ? 'filter-active' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'" class="px-4 py-2 rounded-lg text-sm font-medium transition-colors"> Deposits </button> </div> </div> </div> <!-- Transactions List --> <div class="bg-white rounded-xl shadow-sm border"> <!-- Loading State --> <div x-show="loading" class="p-8 text-center"> <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600 mx-auto"></div> <p class="text-gray-600 mt-2">Loading transactions...</p> </div> <!-- Transactions --> <div x-show="!loading" class="divide-y divide-gray-200"> <template x-for="(transaction, index) in filteredTransactions" :key="transaction.id"> <div class="p-6 hover:bg-gray-50 transition-colors transaction-enter" :style="'animation-delay: ' + (index * 50) + 'ms'"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-4"> <!-- Transaction Icon --> <div class="w-12 h-12 rounded-full flex items-center justify-center flex-shrink-0" :class="{ 'bg-green-100 text-green-600': transaction.type === 'ad_watch', 'bg-blue-100 text-blue-600': transaction.type === 'deposit', 'bg-purple-100 text-purple-600': transaction.type === 'withdraw_approved', 'bg-yellow-100 text-yellow-600': transaction.type === 'withdraw_pending', 'bg-red-100 text-red-600': transaction.type === 'withdraw_rejected', 'bg-orange-100 text-orange-600': transaction.type === 'withdraw_refund', 'bg-indigo-100 text-indigo-600': transaction.type === 'withdraw_request', 'bg-gray-100 text-gray-600': !transaction.type }"> <!-- Ad Watch Icon --> <svg x-show="transaction.type === 'ad_watch'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/> </svg> <!-- Deposit Icon --> <svg x-show="transaction.type === 'deposit'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/> </svg> <!-- Withdraw Request Submit Icon --> <svg x-show="transaction.type === 'withdraw_request'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/> </svg> <!-- Withdraw Approved Icon --> <svg x-show="transaction.type === 'withdraw_approved'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/> </svg> <!-- Withdraw Pending Icon --> <svg x-show="transaction.type === 'withdraw_pending'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/> </svg> <!-- Withdraw Rejected Icon --> <svg x-show="transaction.type === 'withdraw_rejected'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/> </svg> <!-- Withdraw Refund Icon --> <svg x-show="transaction.type === 'withdraw_refund'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"/> </svg> <!-- Default Icon --> <svg x-show="!transaction.type || transaction.type === 'other'" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/> </svg> </div> <!-- Transaction Details --> <div class="min-w-0 flex-1"> <h4 class="text-sm font-medium text-gray-900 truncate" x-text="transaction.description"></h4> <div class="flex items-center mt-1 space-x-4"> <p class="text-sm text-gray-500" x-text="formatDate(transaction.created_at)"></p> <span x-show="transaction.status" class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium" :class="{ 'bg-green-100 text-green-800': transaction.status === 'approved' || transaction.status === 'completed', 'bg-yellow-100 text-yellow-800': transaction.status === 'pending', 'bg-red-100 text-red-800': transaction.status === 'rejected' }" x-text="transaction.status.charAt(0).toUpperCase() + transaction.status.slice(1)"> </span> </div> </div> </div> <!-- Amount --> <div class="text-right flex-shrink-0"> <div class="flex items-center"> <span class="text-lg font-bold" :class="{ 'text-green-600': parseFloat(transaction.amount) > 0, 'text-red-600': parseFloat(transaction.amount) < 0, 'text-gray-500': parseFloat(transaction.amount) === 0 }"> <span x-show="parseFloat(transaction.amount) > 0">+</span><span x-text="'$' + Math.abs(parseFloat(transaction.amount)).toFixed(2)"></span> </span> </div> <p class="text-xs text-gray-500 mt-1" x-text="getTransactionCategory(transaction.type)"></p> </div> </div> <!-- Additional Details --> <div x-show="transaction.payment_method || transaction.ad_title || transaction.plan_name" class="mt-3 pt-3 border-t border-gray-100"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"> <div x-show="transaction.payment_method"> <span class="font-medium text-gray-700">Payment Method:</span> <span class="text-gray-600 ml-1" x-text="transaction.payment_method"></span> </div> <div x-show="transaction.ad_title"> <span class="font-medium text-gray-700">Ad Title:</span> <span class="text-gray-600 ml-1" x-text="transaction.ad_title"></span> </div> <div x-show="transaction.plan_name"> <span class="font-medium text-gray-700">Plan:</span> <span class="text-gray-600 ml-1" x-text="transaction.plan_name"></span> </div> <div x-show="transaction.plan_amount_pkr"> <span class="font-medium text-gray-700">Amount (PKR):</span> <span class="text-gray-600 ml-1" x-text="'PKR ' + parseFloat(transaction.plan_amount_pkr || 0).toFixed(0)"></span> </div> <div x-show="transaction.transaction_id"> <span class="font-medium text-gray-700">Transaction ID:</span> <span class="text-gray-600 ml-1 font-mono text-xs" x-text="transaction.transaction_id"></span> </div> </div> </div> </div> </template> <!-- Empty State --> <div x-show="!loading && filteredTransactions.length === 0" class="p-12 text-center"> <div class="w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4"> <svg class="w-8 h-8 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v4a2 2 0 01-2 2H9a2 2 0 00-2 2z"/> </svg> </div> <h3 class="text-lg font-medium text-gray-900 mb-2">No Transactions Found</h3> <p class="text-gray-600 mb-4">No transactions match your current filter.</p> <button @click="setFilter('all')" class="inline-flex items-center text-purple-600 hover:text-purple-700 font-medium text-sm"> View All Transactions <svg class="w-4 h-4 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/> </svg> </button> </div> </div> </div> </div> <script> function transactionsData() { return { loading: true, activeFilter: 'all', allTransactions: [], summary: { totalEarned: '0.00', adsWatched: 0, totalWithdrawn: '0.00', currentBalance: '0.00' }, async loadData() { try { // Load all transaction types const responses = await Promise.all([ fetch('/user/activity-history'), fetch('/user/withdraw-history'), fetch('/user/stats'), fetch('/user/balance') ]); const [activityData, withdrawData, statsData, balanceData] = await Promise.all( responses.map(async (response, index) => { if (response.ok) { const data = await response.json(); return data; } // If API fails, load sample data directly if (index === 0) { return this.loadSampleActivityData(); } return index === 0 ? [] : (index === 2 ? {} : { balance: 0 }); }) ); // Debug logging console.log('Activity Data:', activityData); console.log('Withdraw Data:', withdrawData); // Combine all transactions this.allTransactions = [ ...this.formatActivityTransactions(activityData), ...this.formatWithdrawTransactions(withdrawData) ].sort((a, b) => new Date(b.created_at) - new Date(a.created_at)); console.log('All Transactions:', this.allTransactions); console.log('Deposit Transactions:', this.allTransactions.filter(t => t.type === 'deposit')); // Update summary this.summary = { totalEarned: parseFloat(statsData.totalEarned || 0).toFixed(2), adsWatched: statsData.adsWatched || 0, totalWithdrawn: this.calculateTotalWithdrawn().toFixed(2), currentBalance: parseFloat(balanceData.balance || 0).toFixed(2) }; this.loading = false; } catch (error) { console.error('Error loading transactions:', error); // Load sample data as fallback this.loadSampleData(); this.loading = false; } }, loadSampleActivityData() { return [ { "user_email": "fastearnofficial@gmail.com", "type": "deposit", "description": "Premium Plan", "amount": 50, "plan_name": "Premium Plan", "plan_amount_pkr": 650, "status": "completed", "created_at": "2025-09-15 19:00:00", "id": "deposit_68c74acf57842" }, { "user_email": "fastearnofficial@gmail.com", "ad_id": "68c74d2a5372c", "reward": 1, "type": "ad_watch", "description": "Watched ad and earned reward", "created_at": "2025-09-15 01:18:44", "id": "68c74d54145a6" }, { "user_email": "fastearnofficial@gmail.com", "type": "withdraw_request", "description": "Withdraw request submitted", "amount": -25, "created_at": "2025-09-15 13:01:45", "id": "68c7f219ee744" } ]; }, loadSampleData() { const sampleData = this.loadSampleActivityData(); this.allTransactions = this.formatActivityTransactions(sampleData); this.summary = { totalEarned: '3.05', adsWatched: 4, totalWithdrawn: '152.00', currentBalance: '53.05' }; }, formatActivityTransactions(activities) { return (activities || []).map(activity => { let description = this.formatActivityDescription(activity); // For deposit transactions, include plan information if (activity.type === 'deposit' && activity.plan_name) { description = activity.plan_name; } // For ad watch activities, use reward field instead of amount let amount = activity.amount || '0.00'; if (activity.type === 'ad_watch' && activity.reward) { amount = activity.reward; } return { id: activity.id, type: activity.type || 'ad_watch', description: description, amount: amount, created_at: activity.created_at, status: activity.status || 'completed', ad_title: activity.ad_title, plan_name: activity.plan_name, plan_amount_pkr: activity.plan_amount_pkr, transaction_id: activity.id }; }); }, formatWithdrawTransactions(withdrawals) { return (withdrawals || []).map(withdrawal => { let type; let description; if (withdrawal.status === 'pending') { type = 'withdraw_request'; description = 'Withdraw request submitted'; } else if (withdrawal.status === 'rejected') { type = 'withdraw_rejected'; description = 'Withdraw request rejected'; } else if (withdrawal.status === 'approved') { type = 'withdraw_approved'; description = 'Withdraw request approved'; } else { type = `withdraw_${withdrawal.status}`; description = 'Withdraw request'; } return { id: withdrawal.id, type: type, description: description, amount: `-${withdrawal.amount}`, created_at: withdrawal.created_at, status: withdrawal.status, payment_method: withdrawal.payment_method, transaction_id: withdrawal.id }; }); }, formatActivityDescription(activity) { switch (activity.type) { case 'ad_watch': return activity.ad_title ? `Watched: ${activity.ad_title}` : 'Watched Advertisement'; case 'deposit': return 'Account Deposit'; case 'bonus': return 'Bonus Credit'; default: return activity.description || 'Activity'; } }, calculateTotalWithdrawn() { return this.allTransactions .filter(t => t.type.startsWith('withdraw_') && t.type !== 'withdraw_rejected') .reduce((total, t) => total + Math.abs(parseFloat(t.amount)), 0); }, setFilter(filter) { this.activeFilter = filter; }, get filteredTransactions() { if (this.activeFilter === 'all') { return this.allTransactions; } const filterMap = { 'ad_watch': ['ad_watch', 'bonus'], 'withdraw': ['withdraw_approved', 'withdraw_pending', 'withdraw_rejected', 'withdraw_refund', 'withdraw_request'], 'deposit': ['deposit'] }; const allowedTypes = filterMap[this.activeFilter] || []; return this.allTransactions.filter(t => allowedTypes.includes(t.type)); }, formatDate(dateString) { const date = new Date(dateString); const now = new Date(); const diffMs = now - date; const diffMins = Math.floor(diffMs / 60000); const diffHours = Math.floor(diffMins / 60); const diffDays = Math.floor(diffHours / 24); if (diffMins < 1) return 'Just now'; if (diffMins < 60) return `${diffMins}m ago`; if (diffHours < 24) return `${diffHours}h ago`; if (diffDays < 7) return `${diffDays}d ago`; return date.toLocaleDateString(); }, getTransactionCategory(type) { const categories = { 'ad_watch': 'Earnings', 'deposit': 'Deposit', 'withdraw_request': 'Request', 'withdraw_approved': 'Withdrawal', 'withdraw_pending': 'Pending', 'withdraw_rejected': 'Rejected', 'withdraw_refund': 'Refund', 'bonus': 'Bonus' }; return categories[type] || 'Activity'; } } } </script> </body> </html>