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>My Withdrawals - 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; } .modal-enter { animation: modalEnter 0.3s ease-out; } @keyframes modalEnter { from { opacity: 0; transform: scale(0.9) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } } .status-pulse { animation: statusPulse 0.8s ease-in-out infinite; } @keyframes statusPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } } </style> </head> <body class="bg-gray-50" x-data="withdrawalsData()" x-init="loadData()"> <!-- Header --> <header class="bg-white shadow-sm border-b border-gray-200"> <div class="max-w-4xl 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-purple-600 to-pink-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="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> <h1 class="text-xl font-bold text-gray-900">My Withdrawals</h1> <p class="text-sm text-gray-600">Manage your earnings withdrawal</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"> ← 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-4xl mx-auto px-4 py-8"> <!-- Balance Card --> <div class="bg-gradient-to-r from-purple-500 to-pink-600 rounded-xl p-6 text-white mb-8"> <div class="text-center"> <div class="w-16 h-16 bg-white bg-opacity-20 rounded-full flex items-center justify-center mx-auto mb-4"> <svg class="w-8 h-8 text-white" 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> <h2 class="text-xl font-bold mb-2">Available Balance</h2> <p class="text-3xl font-bold" x-text="'$' + userBalance">$0.00</p> <p class="text-purple-100 mt-2">Ready for withdrawal</p> </div> </div> <!-- Quick Withdraw Section --> <div class="bg-white rounded-xl shadow-sm border p-6 mb-8"> <h3 class="text-lg font-semibold text-gray-900 mb-4">Quick Withdraw</h3> <!-- Available Methods --> <div x-show="enabledMethods.length > 0" class="space-y-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <template x-for="method in enabledMethods" :key="method"> <div class="border border-gray-200 rounded-lg p-4 hover:border-purple-300 transition-colors"> <div class="flex items-center justify-between mb-2"> <span class="font-medium text-gray-900" x-text="method"></span> <span class="text-xs text-green-600 bg-green-100 px-2 py-1 rounded">Available</span> </div> <p class="text-sm text-gray-600 mb-3" x-text="getMethodDescription(method)"></p> <button @click="window.location.href='/user/withdraw?method=' + encodeURIComponent(method)" class="w-full bg-purple-600 text-white py-2 px-4 rounded-lg hover:bg-purple-700 text-sm"> Withdraw via <span x-text="method"></span> </button> </div> </template> </div> </div> <!-- No Methods Available --> <div x-show="enabledMethods.length === 0" class="text-center py-8"> <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="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2-2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/> </svg> </div> <h3 class="text-lg font-medium text-gray-900 mb-2">Withdraw Not Available</h3> <p class="text-gray-600 mb-4">Admin has not enabled withdraw methods yet.</p> <a href="/dashboard" class="inline-block bg-purple-600 text-white py-2 px-4 rounded-lg hover:bg-purple-700 text-sm"> Back to Dashboard </a> </div> </div> <!-- Withdraw History --> <div class="bg-white rounded-xl shadow-sm border"> <div class="p-6 border-b border-gray-200"> <h3 class="text-lg font-semibold text-gray-900">Withdraw History</h3> <p class="text-sm text-gray-600 mt-1">All your withdrawal requests and transactions</p> </div> <div class="p-6"> <!-- Loading State --> <div x-show="loading" class="text-center py-8"> <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 history...</p> </div> <!-- History List --> <div x-show="!loading" class="space-y-3"> <template x-for="transaction in withdrawHistory" :key="transaction.id"> <div @click="showStatusModal(transaction)" class="flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 sm:p-4 border border-gray-200 rounded-lg hover:bg-gray-50 hover:border-purple-300 cursor-pointer transition-all duration-200"> <!-- Main transaction info --> <div class="flex items-center space-x-3 mb-3 sm:mb-0"> <div class="w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0" :class="{ 'bg-green-100 text-green-600': transaction.status === 'approved', 'bg-yellow-100 text-yellow-600': transaction.status === 'pending', 'bg-red-100 text-red-600': transaction.status === 'rejected' }"> <!-- Approved Icon --> <svg x-show="transaction.status === 'approved'" class="w-5 h-5" 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> <!-- Pending Icon --> <svg x-show="transaction.status === 'pending'" class="w-5 h-5" 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> <!-- Rejected Icon --> <svg x-show="transaction.status === 'rejected'" class="w-5 h-5" 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> </div> <div class="flex-1 min-w-0"> <p class="font-semibold text-gray-900 text-sm sm:text-base" x-text="transaction.payment_method + ' Withdrawal'"></p> <p class="text-xs sm:text-sm text-gray-600" x-text="formatDate(transaction.created_at)"></p> </div> </div> <!-- Amount and status info --> <div class="flex items-center justify-between sm:flex-col sm:items-end sm:text-right"> <div> <p class="font-bold text-lg sm:text-xl text-gray-900" x-text="'$' + parseFloat(transaction.amount).toFixed(2)"></p> <div class="flex items-center justify-start sm:justify-end mt-1"> <span x-text="transaction.status.charAt(0).toUpperCase() + transaction.status.slice(1)" :class="{ 'text-green-600 bg-green-100': transaction.status === 'approved', 'text-yellow-600 bg-yellow-100': transaction.status === 'pending', 'text-red-600 bg-red-100': transaction.status === 'rejected' }" class="text-xs sm:text-sm font-semibold px-2 py-1 rounded-full"></span> </div> </div> <div class="flex items-center text-purple-600 ml-3 sm:ml-0 sm:mt-2"> <span class="text-xs font-medium mr-1">View Details</span> <svg class="w-4 h-4" 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> </div> </div> </div> </template> <div x-show="withdrawHistory.length === 0" class="text-center py-12 text-gray-500"> <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 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/> </svg> </div> <p class="text-lg font-medium">No withdrawals yet</p> <p class="text-sm mt-1">Your withdrawal history will appear here</p> </div> </div> </div> </div> </div> <!-- Enhanced Professional Modal with Detailed Information --> <div x-show="showModal" x-cloak class="fixed inset-0 z-50 flex items-center justify-center p-4"> <!-- Enhanced backdrop --> <div class="fixed inset-0 bg-gradient-to-br from-black to-gray-900 bg-opacity-70 backdrop-blur-sm" x-show="showModal" x-transition:enter="ease-out duration-300" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="ease-in duration-200" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" @click="closeModal()"></div> <!-- Enhanced detailed modal --> <div class="relative bg-white w-full max-w-md mx-auto rounded-2xl shadow-2xl overflow-hidden" x-show="showModal" x-transition:enter="ease-out duration-300" x-transition:enter-start="opacity-0 translate-y-8 scale-95" x-transition:enter-end="opacity-100 translate-y-0 scale-100" x-transition:leave="ease-in duration-200" x-transition:leave-start="opacity-100 translate-y-0 scale-100" x-transition:leave-end="opacity-0 translate-y-8 scale-95"> <!-- Success Header with Icon --> <div class="text-center pt-8 pb-6 px-6"> <div class="w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-4 shadow-lg" :class="{ 'bg-gradient-to-br from-emerald-400 to-green-600': selectedTransaction?.status === 'approved', 'bg-gradient-to-br from-amber-400 to-orange-500': selectedTransaction?.status === 'pending', 'bg-gradient-to-br from-red-400 to-rose-600': selectedTransaction?.status === 'rejected' }"> <!-- Approved --> <svg x-show="selectedTransaction?.status === 'approved'" class="w-10 h-10 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/> </svg> <!-- Pending --> <svg x-show="selectedTransaction?.status === 'pending'" class="w-10 h-10 text-white animate-spin" fill="none" viewBox="0 0 24 24" stroke="currentColor" style="animation-duration: 2s;"> <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> <!-- Rejected --> <svg x-show="selectedTransaction?.status === 'rejected'" class="w-10 h-10 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M6 18L18 6M6 6l12 12"/> </svg> </div> <h3 class="text-2xl font-bold text-gray-900 mb-2" x-text="selectedTransaction?.status === 'approved' ? 'Withdrawal Completed!' : selectedTransaction?.status === 'pending' ? 'Withdrawal Pending' : 'Withdrawal Rejected'">Withdrawal Status</h3> <p class="text-gray-600 text-sm" x-text="selectedTransaction?.status === 'approved' ? 'Your withdrawal has been successfully processed and paid to your account.' : selectedTransaction?.status === 'pending' ? 'Your withdrawal request is being processed by our team.' : 'Your withdrawal request has been rejected. Amount refunded to your balance.'">Status description</p> </div> <!-- Detailed Information Cards --> <div class="px-6 pb-6"> <div class="bg-gray-50 rounded-xl p-4 space-y-3"> <!-- Amount --> <div class="flex justify-between items-center py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Amount:</span> <span class="text-lg font-bold text-purple-600" x-text="'$' + parseFloat(selectedTransaction?.amount || 0).toFixed(2)">$0.00</span> </div> <!-- Payment Method --> <div class="flex justify-between items-center py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Payment Method:</span> <span class="text-sm font-semibold text-gray-900 capitalize" x-text="selectedTransaction?.payment_method || 'N/A'">-</span> </div> <!-- Account Details --> <div class="flex justify-between items-center py-2 border-b border-gray-200" x-show="selectedTransaction?.account_details"> <span class="text-sm font-medium text-gray-700">Account Details:</span> <span class="text-sm text-gray-900 font-mono" x-text="selectedTransaction?.account_details || 'N/A'">-</span> </div> <!-- Request Date --> <div class="flex justify-between items-center py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Request Date:</span> <span class="text-sm text-gray-900" x-text="formatDetailedDate(selectedTransaction?.created_at)">-</span> </div> <!-- Processed Date (for approved) --> <div x-show="selectedTransaction?.status === 'approved' && selectedTransaction?.approved_at" class="flex justify-between items-center py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Processed Date:</span> <span class="text-sm text-gray-900" x-text="formatDetailedDate(selectedTransaction?.approved_at)">-</span> </div> <!-- Status --> <div class="flex justify-between items-center py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Status:</span> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium capitalize" :class="{ 'bg-green-100 text-green-800': selectedTransaction?.status === 'approved', 'bg-yellow-100 text-yellow-800': selectedTransaction?.status === 'pending', 'bg-red-100 text-red-800': selectedTransaction?.status === 'rejected' }" x-text="selectedTransaction?.status || 'Unknown'">Status</span> </div> <!-- Notes (if any) --> <div x-show="selectedTransaction?.notes" class="flex justify-between items-start py-2 border-b border-gray-200"> <span class="text-sm font-medium text-gray-700">Your Notes:</span> <span class="text-sm text-gray-900 text-right max-w-48" x-text="selectedTransaction?.notes">-</span> </div> <!-- Transaction ID --> <div class="flex justify-between items-center py-2"> <span class="text-sm font-medium text-gray-700">Transaction ID:</span> <span class="text-xs text-gray-600 font-mono bg-gray-100 px-2 py-1 rounded" x-text="selectedTransaction?.id || 'N/A'">N/A</span> </div> </div> </div> <!-- Action Buttons --> <div class="border-t border-gray-200 px-6 py-4"> <div class="flex gap-3"> <button @click="makeNewWithdraw()" class="flex-1 bg-gradient-to-r from-blue-600 to-indigo-600 text-white py-3 px-4 rounded-lg text-sm font-semibold hover:from-blue-700 hover:to-indigo-700 transition-all duration-200 shadow-md hover:shadow-lg"> <svg class="w-4 h-4 inline mr-2" 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> New Withdraw </button> <button x-show="selectedTransaction?.status === 'pending'" @click="cancelWithdraw()" class="flex-1 bg-gradient-to-r from-red-500 to-rose-600 text-white py-3 px-4 rounded-lg text-sm font-semibold hover:from-red-600 hover:to-rose-700 transition-all duration-200 shadow-md hover:shadow-lg"> <svg class="w-4 h-4 inline mr-2" 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> Cancel </button> <button @click="closeModal()" class="px-6 bg-gradient-to-r from-gray-400 to-gray-500 text-white py-3 rounded-lg text-sm font-semibold hover:from-gray-500 hover:to-gray-600 transition-all duration-200 shadow-md hover:shadow-lg"> <svg class="w-4 h-4 inline mr-1" 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> Close </button> </div> </div> </div> </div> <script> function withdrawalsData() { return { loading: true, userBalance: 0.00, enabledMethods: [], withdrawHistory: [], showModal: false, selectedTransaction: null, async loadData() { try { // Load user balance const balanceResponse = await fetch('/user/balance'); if (balanceResponse.ok) { const data = await balanceResponse.json(); this.userBalance = parseFloat(data.balance || 0).toFixed(2); } // Load withdraw status const withdrawResponse = await fetch('/user/withdraw-status'); if (withdrawResponse.ok) { const withdrawData = await withdrawResponse.json(); this.enabledMethods = (withdrawData.enabledMethods || []).map(method => method.name || method); } // Load withdraw history const historyResponse = await fetch('/user/withdraw-history'); if (historyResponse.ok) { const historyData = await historyResponse.json(); this.withdrawHistory = historyData || []; } this.loading = false; } catch (error) { console.error('Error loading withdraw data:', error); this.loading = false; } }, getMethodDescription(method) { const descriptions = { 'UBL Bank Transfer': 'Direct transfer to your UBL bank account', 'JazzCash': 'Mobile wallet transfer to your JazzCash account', 'EasyPaisa': 'Mobile wallet transfer to your EasyPaisa account', 'Bank Transfer': 'Transfer to any local bank account' }; return descriptions[method] || 'Transfer to your account'; }, formatDate(dateString) { const date = new Date(dateString); return date.toLocaleDateString() + ' at ' + date.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}); }, formatDetailedDate(dateString) { if (!dateString) return 'N/A'; const date = new Date(dateString); const options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: true }; return date.toLocaleDateString('en-US', options).replace(',', ' at'); }, showStatusModal(transaction) { this.selectedTransaction = transaction; this.showModal = true; }, closeModal() { this.showModal = false; this.selectedTransaction = null; }, makeNewWithdraw() { this.closeModal(); window.location.href = '/user/withdraw'; }, async cancelWithdraw() { if (!this.selectedTransaction || this.selectedTransaction.status !== 'pending') { return; } // Confirm cancellation if (!confirm('Are you sure you want to cancel this withdrawal request? The amount will be refunded to your balance.')) { return; } try { const response = await fetch('/user/cancel-withdraw', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ withdrawId: this.selectedTransaction.id }) }); if (response.ok) { const result = await response.json(); // Update the transaction status locally this.selectedTransaction.status = 'cancelled'; // Update the withdrawal history const transactionIndex = this.withdrawHistory.findIndex(t => t.id === this.selectedTransaction.id); if (transactionIndex !== -1) { this.withdrawHistory[transactionIndex].status = 'cancelled'; } // Update balance if provided if (result.newBalance !== undefined) { this.userBalance = parseFloat(result.newBalance).toFixed(2); } alert('Withdrawal request cancelled successfully. Amount refunded to your balance.'); this.closeModal(); // Reload data to get updated information this.loadData(); } else { const error = await response.json(); alert('Error cancelling withdrawal: ' + (error.message || 'Unknown error')); } } catch (error) { console.error('Error cancelling withdrawal:', error); alert('Network error. Please try again.'); } } } } </script> </body> </html>