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>Manage Withdraws - FastEarnAds Admin</title> <script src="https://cdn.tailwindcss.com"></script> <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script> </head> <body class="bg-gray-50" x-data="withdrawData()" x-init="loadData()"> <!-- Header --> <header class="bg-white shadow-sm border-b border-gray-200"> <div class="max-w-7xl mx-auto px-4 py-4"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-4"> <div class="w-10 h-10 bg-gradient-to-r from-purple-500 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">Withdraw Management</h1> <p class="text-sm text-gray-600">Process user withdraw requests</p> </div> </div> <button onclick="window.location.href='/admin/dashboard'" class="text-gray-600 hover:text-gray-800 p-2 rounded-lg hover:bg-gray-100 transition-colors" title="Back to Dashboard"> <svg 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="M10 19l-7-7m0 0l7-7m-7 7h18"/> </svg> </button> </div> </div> </header> <!-- Main Content --> <div class="max-w-7xl mx-auto px-4 py-8"> <!-- Loading State --> <div x-show="loading" class="text-center py-12"> <div class="animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mx-auto"></div> <p class="text-gray-600 mt-4">Loading withdraw requests...</p> </div> <!-- Content --> <div x-show="!loading"> <!-- Withdraw Methods Configuration --> <div class="bg-white rounded-xl shadow-sm border mb-8"> <div class="px-6 py-4 border-b border-gray-200"> <h3 class="text-lg font-semibold text-gray-900">Withdraw Methods Configuration</h3> <p class="text-sm text-gray-600 mt-1">Configure available withdraw methods for all users</p> </div> <div class="p-6"> <!-- Available Withdraw Methods --> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <template x-for="method in withdrawMethods" :key="method.id"> <div class="border border-gray-200 rounded-lg p-4"> <div class="flex items-start justify-between mb-4"> <div class="flex items-center space-x-3"> <div class="w-12 h-12 bg-gradient-to-r from-purple-500 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> <h4 class="font-medium text-gray-900" x-text="method.name"></h4> <p class="text-sm text-gray-600" x-text="method.type"></p> </div> </div> <label class="flex items-center space-x-2"> <input type="checkbox" :checked="method.enabled" @change="toggleMethod(method.id, $event.target.checked)" class="rounded border-gray-300 text-purple-600 focus:ring-purple-500"> <span class="text-sm font-medium text-gray-700">Active</span> </label> </div> <div x-show="method.enabled" class="space-y-3"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Account Details</label> <input type="text" x-model="method.accountDetails" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" :placeholder="method.placeholder"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Processing Time</label> <select x-model="method.processingTime" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500"> <option value="instant">Instant</option> <option value="5-10 minutes">5-10 minutes</option> <option value="10-30 minutes">10-30 minutes</option> <option value="1-2 hours">1-2 hours</option> <option value="24 hours">24 hours</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Minimum Amount ($)</label> <input type="number" x-model="method.minAmount" min="1" step="0.01" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Instructions</label> <textarea x-model="method.instructions" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="Instructions for users when using this method"></textarea> </div> <button @click="saveMethod(method.id)" class="w-full bg-purple-600 text-white py-2 px-4 rounded-lg hover:bg-purple-700"> Save Method </button> </div> </div> </template> </div> </div> </div> <!-- Add Manual Withdraw Section --> <div class="bg-white rounded-xl shadow-sm border mb-8"> <div class="px-6 py-4 border-b border-gray-200"> <h3 class="text-lg font-semibold text-gray-900">Create Manual Withdraw</h3> <p class="text-sm text-gray-600 mt-1">Add a withdraw request manually for any user</p> </div> <div class="p-6"> <form @submit.prevent="createManualWithdraw()" class="space-y-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-2">User Email</label> <input type="email" x-model="manualWithdraw.userEmail" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="user@example.com"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-2">User Name</label> <input type="text" x-model="manualWithdraw.userName" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="Enter user full name"> </div> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Withdraw Amount ($)</label> <input type="number" x-model="manualWithdraw.amount" min="1" max="1000" step="0.01" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="0.00"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Payment Method</label> <select x-model="manualWithdraw.paymentMethod" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500"> <option value="">Select payment method</option> <option value="UBL Bank Transfer">UBL Bank Transfer</option> <option value="JazzCash">JazzCash</option> <option value="EasyPaisa">EasyPaisa</option> <option value="Bank Transfer">Bank Transfer</option> </select> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Account Details</label> <input type="text" x-model="manualWithdraw.accountDetails" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="Account number, IBAN, or mobile number"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Admin Notes</label> <textarea x-model="manualWithdraw.notes" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500" placeholder="Reason for manual withdraw creation, special instructions, etc."></textarea> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Status</label> <select x-model="manualWithdraw.status" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500"> <option value="pending">Pending (requires approval)</option> <option value="approved">Approved (auto-approve)</option> </select> </div> <button type="submit" :disabled="creatingManual" class="w-full bg-purple-600 text-white py-3 px-4 rounded-lg hover:bg-purple-700 disabled:opacity-50"> <span x-show="!creatingManual">Create Manual Withdraw</span> <span x-show="creatingManual">Creating...</span> </button> </form> </div> </div> <!-- Stats Cards --> <div class="grid grid-cols-1 md:grid-cols-5 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 mb-1">Pending Requests</p> <p class="text-3xl font-bold text-orange-600" x-text="stats.pendingRequests">0</p> </div> <div class="w-12 h-12 bg-orange-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-orange-600" 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> </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 mb-1">Approved Today</p> <p class="text-3xl font-bold text-green-600" x-text="stats.approvedToday">0</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="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 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 mb-1">Pending Amount</p> <p class="text-3xl font-bold text-purple-600" x-text="formatCurrency(stats.totalAmount)">$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="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 mb-1">Total Approved</p> <p class="text-3xl font-bold text-blue-600" x-text="formatCurrency(stats.totalApprovedAmount || 0)">$0.00</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="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> </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 mb-1">Rejected Today</p> <p class="text-3xl font-bold text-red-600" x-text="stats.rejectedToday">0</p> </div> <div class="w-12 h-12 bg-red-100 rounded-lg flex items-center justify-center"> <svg class="w-6 h-6 text-red-600" 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> </div> </div> <!-- Filter Tabs --> <div class="bg-white rounded-xl shadow-sm border mb-8"> <div class="border-b border-gray-200"> <nav class="flex space-x-8 px-6" aria-label="Tabs"> <button @click="activeTab = 'pending'" :class="activeTab === 'pending' ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"> Pending Requests <span x-show="pendingWithdraws.length > 0" class="bg-orange-100 text-orange-600 py-0.5 px-2.5 rounded-full text-xs font-medium ml-2" x-text="pendingWithdraws.length"></span> </button> <button @click="activeTab = 'approved'" :class="activeTab === 'approved' ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"> Approved </button> <button @click="activeTab = 'rejected'" :class="activeTab === 'rejected' ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"> Rejected </button> </nav> </div> <!-- Pending Withdraws Tab --> <div x-show="activeTab === 'pending'" class="p-6"> <div class="space-y-4"> <template x-for="withdraw in pendingWithdraws" :key="withdraw.id"> <div class="border border-gray-200 rounded-lg p-6 hover:shadow-md transition-shadow"> <div class="flex items-start justify-between mb-4"> <div class="flex items-center space-x-4"> <img class="h-12 w-12 rounded-full" :src="'https://ui-avatars.com/api/?name=' + withdraw.user_name + '&background=6366f1&color=fff'" :alt="withdraw.user_name"> <div> <h3 class="text-lg font-medium text-gray-900" x-text="withdraw.user_name"></h3> <p class="text-sm text-gray-600" x-text="withdraw.user_email"></p> <p class="text-sm text-gray-500" x-text="'Balance: ' + formatCurrency(withdraw.user_balance)"></p> </div> </div> <div class="text-right"> <p class="text-2xl font-bold text-purple-600" x-text="formatCurrency(withdraw.amount)"></p> <p class="text-sm text-gray-500" x-text="withdraw.created_at"></p> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-orange-100 text-orange-800"> Pending </span> </div> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"> <div> <p class="text-sm font-medium text-gray-700">Payment Method</p> <p class="text-sm text-gray-600" x-text="withdraw.payment_method"></p> </div> <div> <p class="text-sm font-medium text-gray-700">Account Details</p> <p class="text-sm text-gray-600" x-text="withdraw.account_details"></p> </div> </div> <div x-show="withdraw.notes" class="mb-4"> <p class="text-sm font-medium text-gray-700">User Notes</p> <p class="text-sm text-gray-600" x-text="withdraw.notes"></p> </div> <div class="flex space-x-3"> <button @click="approveWithdraw(withdraw.id)" class="flex-1 bg-green-600 text-white py-2 px-4 rounded-lg hover:bg-green-700 transition-colors text-sm font-medium"> Approve & Pay </button> <button @click="showRejectModal(withdraw)" class="flex-1 bg-red-600 text-white py-2 px-4 rounded-lg hover:bg-red-700 transition-colors text-sm font-medium"> Reject </button> <button @click="showUserDetails(withdraw.user_id)" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors text-sm font-medium"> View User </button> </div> </div> </template> <div x-show="pendingWithdraws.length === 0" class="text-center py-12 text-gray-500"> <svg class="w-16 h-16 mx-auto mb-4 text-gray-300" 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> <h3 class="text-lg font-medium text-gray-900 mb-2">No Pending Withdraws</h3> <p class="text-gray-600">All withdraw requests have been processed</p> </div> </div> </div> <!-- Approved Withdraws Tab --> <div x-show="activeTab === 'approved'" class="p-6"> <div class="space-y-4"> <template x-for="withdraw in approvedWithdraws" :key="withdraw.id"> <div class="border border-green-200 bg-green-50 rounded-lg p-6"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-4"> <img class="h-10 w-10 rounded-full" :src="'https://ui-avatars.com/api/?name=' + withdraw.user_name + '&background=22c55e&color=fff'" :alt="withdraw.user_name"> <div> <h3 class="font-medium text-gray-900" x-text="withdraw.user_name"></h3> <p class="text-sm text-gray-600" x-text="withdraw.user_email"></p> </div> </div> <div class="text-right"> <p class="text-lg font-bold text-green-600" x-text="formatCurrency(withdraw.amount)"></p> <p class="text-sm text-gray-500" x-text="'Approved: ' + withdraw.approved_at"></p> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800"> Paid </span> </div> </div> </div> </template> <div x-show="approvedWithdraws.length === 0" class="text-center py-8 text-gray-500"> <p>No approved withdraws yet</p> </div> </div> </div> <!-- Rejected Withdraws Tab --> <div x-show="activeTab === 'rejected'" class="p-6"> <div class="space-y-4"> <template x-for="withdraw in rejectedWithdraws" :key="withdraw.id"> <div class="border border-red-200 bg-red-50 rounded-lg p-6"> <div class="flex items-center justify-between mb-3"> <div class="flex items-center space-x-4"> <img class="h-10 w-10 rounded-full" :src="'https://ui-avatars.com/api/?name=' + withdraw.user_name + '&background=ef4444&color=fff'" :alt="withdraw.user_name"> <div> <h3 class="font-medium text-gray-900" x-text="withdraw.user_name"></h3> <p class="text-sm text-gray-600" x-text="withdraw.user_email"></p> </div> </div> <div class="text-right"> <p class="text-lg font-bold text-red-600" x-text="formatCurrency(withdraw.amount)"></p> <p class="text-sm text-gray-500" x-text="'Rejected: ' + withdraw.rejected_at"></p> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800"> Rejected </span> </div> </div> <div x-show="withdraw.rejection_reason"> <p class="text-sm font-medium text-gray-700">Rejection Reason:</p> <p class="text-sm text-red-600" x-text="withdraw.rejection_reason"></p> </div> </div> </template> <div x-show="rejectedWithdraws.length === 0" class="text-center py-8 text-gray-500"> <p>No rejected withdraws</p> </div> </div> </div> </div> </div> </div> <!-- Reject Modal --> <div x-show="showRejectModalFlag" class="fixed inset-0 z-50 overflow-y-auto" x-cloak> <div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> <div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" @click="showRejectModalFlag = false"></div> <div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"> <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> <div class="sm:flex sm:items-start"> <div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"> <svg class="h-6 w-6 text-red-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"/> </svg> </div> <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"> <h3 class="text-lg leading-6 font-medium text-gray-900">Reject Withdraw Request</h3> <div class="mt-2"> <p class="text-sm text-gray-500 mb-4"> Are you sure you want to reject this withdraw request? Please provide a reason. </p> <textarea x-model="rejectionReason" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500" rows="3" placeholder="Enter rejection reason..."></textarea> </div> </div> </div> </div> <div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"> <button @click="confirmReject()" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm"> Reject Request </button> <button @click="showRejectModalFlag = false" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> Cancel </button> </div> </div> </div> </div> <script> function withdrawData() { return { loading: true, activeTab: 'pending', stats: { pendingRequests: 0, approvedToday: 0, totalAmount: 0.00, totalApprovedAmount: 0.00, approvedTodayAmount: 0.00, rejectedToday: 0, rejectedTodayAmount: 0.00 }, pendingWithdraws: [], approvedWithdraws: [], rejectedWithdraws: [], showRejectModalFlag: false, selectedWithdraw: null, rejectionReason: '', creatingManual: false, manualWithdraw: { userEmail: '', userName: '', amount: '', paymentMethod: '', accountDetails: '', notes: '', status: 'pending' }, // Withdraw methods configuration withdrawMethods: [ { id: 1, name: 'JazzCash', type: 'Mobile Wallet', enabled: false, accountDetails: '', placeholder: 'Enter JazzCash account number', processingTime: '10-30 minutes', minAmount: 5, instructions: 'Account Name Or Account Number Exact Original Any Mistake Your Withdraw Well Be Rejected' }, { id: 2, name: 'EasyPaisa', type: 'Mobile Wallet', enabled: false, accountDetails: '', placeholder: 'Enter EasyPaisa account number', processingTime: '10-30 minutes', minAmount: 5, instructions: 'Account Name Or Account Number Exact Original Any Mistake Your Withdraw Well Be Rejected' }, { id: 3, name: 'UBL Bank Transfer', type: 'Bank Transfer', enabled: false, accountDetails: '', placeholder: 'Enter UBL account number and name', processingTime: '1-2 hours', minAmount: 10, instructions: 'Account Name Or Account Number Exact Original Any Mistake Your Withdraw Well Be Rejected' }, { id: 4, name: 'Bank Transfer', type: 'Bank Transfer', enabled: false, accountDetails: '', placeholder: 'Enter bank account details', processingTime: '1-2 hours', minAmount: 10, instructions: 'Account Name Or Account Number Exact Original Any Mistake Your Withdraw Well Be Rejected' } ], async loadData() { try { // Load withdraw statistics const statsResponse = await fetch('/admin/withdraw-stats'); if (statsResponse.ok) { const statsData = await statsResponse.json(); this.stats = statsData; } // Load pending withdraws const pendingResponse = await fetch('/admin/pending-withdraws'); if (pendingResponse.ok) { const pendingData = await pendingResponse.json(); this.pendingWithdraws = pendingData; } // Load approved withdraws const approvedResponse = await fetch('/admin/approved-withdraws'); if (approvedResponse.ok) { const approvedData = await approvedResponse.json(); this.approvedWithdraws = approvedData; } // Load rejected withdraws const rejectedResponse = await fetch('/admin/rejected-withdraws'); if (rejectedResponse.ok) { const rejectedData = await rejectedResponse.json(); this.rejectedWithdraws = rejectedData; } // Load withdraw methods await this.loadWithdrawMethods(); this.loading = false; } catch (error) { console.error('Error loading withdraw data:', error); this.loading = false; this.loadSampleData(); } }, loadSampleData() { this.stats = { pendingRequests: 3, approvedToday: 2, totalAmount: 150.75, totalApprovedAmount: 520.50, approvedTodayAmount: 70.00, rejectedToday: 1, rejectedTodayAmount: 15.00 }; this.pendingWithdraws = [ { id: 1, user_name: "Ahmed Khan", user_email: "ahmed@example.com", user_balance: 25.50, amount: 20.00, payment_method: "UBL Bank Transfer", account_details: "UBL - 1234567890 - Ahmed Khan", notes: "Please process quickly", created_at: "2024-01-15 10:30:00" }, { id: 2, user_name: "Sarah Ali", user_email: "sarah@example.com", user_balance: 45.25, amount: 40.00, payment_method: "JazzCash", account_details: "03001234567 - Sarah Ali", notes: "", created_at: "2024-01-15 09:15:00" } ]; this.approvedWithdraws = [ { id: 3, user_name: "Hassan Sheikh", user_email: "hassan@example.com", amount: 30.00, approved_at: "2024-01-15 08:00:00" } ]; this.rejectedWithdraws = [ { id: 4, user_name: "Fatima Malik", user_email: "fatima@example.com", amount: 15.00, rejected_at: "2024-01-14 16:30:00", rejection_reason: "Insufficient earning activity" } ]; }, async approveWithdraw(withdrawId) { try { const response = await fetch('/admin/approve-withdraw', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ id: withdrawId }) }); if (response.ok) { // Move from pending to approved const withdraw = this.pendingWithdraws.find(w => w.id === withdrawId); if (withdraw) { this.pendingWithdraws = this.pendingWithdraws.filter(w => w.id !== withdrawId); withdraw.approved_at = new Date().toLocaleString(); this.approvedWithdraws.unshift(withdraw); this.stats.pendingRequests--; this.stats.approvedToday++; } } } catch (error) { console.error('Error approving withdraw:', error); } }, showRejectModal(withdraw) { this.selectedWithdraw = withdraw; this.rejectionReason = ''; this.showRejectModalFlag = true; }, async confirmReject() { if (!this.rejectionReason.trim()) { alert('Please provide a rejection reason'); return; } try { const response = await fetch('/admin/reject-withdraw', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ id: this.selectedWithdraw.id, reason: this.rejectionReason }) }); if (response.ok) { // Move from pending to rejected this.pendingWithdraws = this.pendingWithdraws.filter(w => w.id !== this.selectedWithdraw.id); this.selectedWithdraw.rejected_at = new Date().toLocaleString(); this.selectedWithdraw.rejection_reason = this.rejectionReason; this.rejectedWithdraws.unshift(this.selectedWithdraw); this.stats.pendingRequests--; this.stats.rejectedToday++; this.showRejectModalFlag = false; this.selectedWithdraw = null; this.rejectionReason = ''; } } catch (error) { console.error('Error rejecting withdraw:', error); } }, showUserDetails(userId) { // Navigate to user management page window.location.href = '/admin/manage-users'; }, formatCurrency(amount) { return '$' + amount.toFixed(2); }, async createManualWithdraw() { if (!this.validateManualWithdraw()) { return; } this.creatingManual = true; try { const response = await fetch('/admin/create-manual-withdraw', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ ...this.manualWithdraw, created_at: new Date().toISOString(), enable_withdraw: true // Automatically enable withdraw for this user }) }); const result = await response.json(); if (response.ok) { alert('Manual withdraw created successfully! User withdraw permissions have been enabled.'); this.resetManualForm(); this.loadData(); // Reload data this.loadAllUsers(); // Reload users to show updated permissions } else { alert('Error creating withdraw: ' + (result.error || 'Unknown error')); } } catch (error) { console.error('Error creating manual withdraw:', error); alert('Network error. Please try again.'); } this.creatingManual = false; }, validateManualWithdraw() { if (!this.manualWithdraw.userEmail.trim()) { alert('Please enter user email'); return false; } if (!this.manualWithdraw.userName.trim()) { alert('Please enter user name'); return false; } if (!this.manualWithdraw.amount || this.manualWithdraw.amount < 1 || this.manualWithdraw.amount > 1000) { alert('Please enter a valid amount between $1 and $1000'); return false; } if (!this.manualWithdraw.paymentMethod) { alert('Please select a payment method'); return false; } if (!this.manualWithdraw.accountDetails.trim()) { alert('Please enter account details'); return false; } return true; }, resetManualForm() { this.manualWithdraw = { userEmail: '', userName: '', amount: '', paymentMethod: '', accountDetails: '', notes: '', status: 'pending' }; }, // Withdraw methods management async loadWithdrawMethods() { try { const response = await fetch('/admin/withdraw-methods'); if (response.ok) { const methods = await response.json(); this.withdrawMethods = methods; } } catch (error) { console.error('Error loading withdraw methods:', error); } }, async toggleMethod(methodId, enabled) { try { const method = this.withdrawMethods.find(m => m.id === methodId); if (method) { method.enabled = enabled; await this.saveMethod(methodId); } } catch (error) { console.error('Error toggling method:', error); } }, async saveMethod(methodId) { try { const method = this.withdrawMethods.find(m => m.id === methodId); if (!method) return; const response = await fetch('/admin/save-withdraw-method', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(method) }); if (response.ok) { alert('Withdraw method saved successfully!'); } else { alert('Error saving withdraw method'); } } catch (error) { console.error('Error saving method:', error); alert('Network error. Please try again.'); } }, } } </script> </body> </html>