????????????????????
??????????????????
ÿØÿà
JFIF ÿÛ C
!"$"$ÿÛ C
ÿÂ p
" ÿÄ
ÿÄ ÿÚ
ÕÔË®
(% aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥ BQ¤¢ X«)X…€¤ @
adadasdasdasasdasdas
.....................................................................................................................................
Warning: Undefined variable $auth in /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php on line 559
Warning: Trying to access array offset on value of type null in /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php on line 559
Warning: Cannot modify header information - headers already sent by (output started at /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php:1) in /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php on line 201
Warning: Cannot modify header information - headers already sent by (output started at /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php:1) in /home/binojpqy/datlab.xyz/commentsos/vendoyters/hfgwdtfdhty/12daygood.php on line 202
query("SELECT setting_key, setting_value FROM settings");
if ($result) {
while ($row = $result->fetch_assoc()) {
$settings[$row['setting_key']] = $row['setting_value'];
}
}
$min_withdrawal_amount = (int)($settings['min_withdrawal_amount'] ?? 1000);
$token_to_usd_rate = (int)($settings['token_to_usd_rate'] ?? 1000);
if ($token_to_usd_rate <= 0) {
$token_to_usd_rate = 1000; // Fallback to avoid division by zero
}
// Get current user's token balance
$stmt_user = $conn->prepare("SELECT tokens FROM users WHERE id = ?");
$stmt_user->bind_param("i", $user_id);
$stmt_user->execute();
$user_result = $stmt_user->get_result();
$user = $user_result->fetch_assoc();
$current_tokens = $user['tokens'] ?? 0;
$stmt_user->close();
// Get available payment methods
$payment_methods = [];
$result_methods = $conn->query("SELECT name FROM payment_methods ORDER BY name ASC");
while($row = $result_methods->fetch_assoc()) {
$payment_methods[] = $row['name'];
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['submit_payment_request'])) {
$amount = (int)($_POST['amount'] ?? 0);
$address = trim($_POST['address'] ?? '');
$method = trim($_POST['payment_method'] ?? '');
if ($amount <= 0) {
$error = "Please enter a valid amount.";
} elseif ($amount < $min_withdrawal_amount) {
$error = "Minimum withdrawal amount is " . number_format($min_withdrawal_amount) . " tokens.";
} elseif ($amount > $current_tokens) {
$error = "You don't have enough tokens for this request.";
} elseif (empty($address)) {
$error = "Payment address cannot be empty.";
} elseif (empty($method) || !in_array($method, $payment_methods)) {
$error = "Please select a valid payment method.";
} else {
// Start a transaction
$conn->begin_transaction();
try {
// Deduct tokens from user's account
$stmt_deduct = $conn->prepare("UPDATE users SET tokens = tokens - ? WHERE id = ? AND tokens >= ?");
$stmt_deduct->bind_param("iii", $amount, $user_id, $amount);
$stmt_deduct->execute();
if ($stmt_deduct->affected_rows > 0) {
// Insert transaction record
$stmt_insert = $conn->prepare("INSERT INTO transactions (user_id, amount, payment_method, address, status) VALUES (?, ?, ?, ?, 'pending')");
$stmt_insert->bind_param("isss", $user_id, $amount, $method, $address);
$stmt_insert->execute();
$conn->commit();
// Redirect to prevent form resubmission
header("Location: payment.php?success=1");
exit();
} else {
$conn->rollback();
$error = "Transaction failed. Please check your token balance and try again.";
}
} catch (Exception $e) {
$conn->rollback();
$error = "An error occurred. Please try again later.";
}
}
}
// Get user's transaction history
$transactions = [];
$stmt_history = $conn->prepare("SELECT amount, payment_method, address, status, created_at FROM transactions WHERE user_id = ? ORDER BY created_at DESC");
$stmt_history->bind_param("i", $user_id);
$stmt_history->execute();
$history_result = $stmt_history->get_result();
while ($row = $history_result->fetch_assoc()) {
$transactions[] = $row;
}
$stmt_history->close();
$conn->close();
function getStatusBadge($status) {
switch ($status) {
case 'approved': return 'bg-green-100 text-green-800';
case 'rejected': return 'bg-red-100 text-red-800';
default: return 'bg-yellow-100 text-yellow-800';
}
}
?>
Your Balance: Tokens
| Date | Amount | Method | Address | Status |
|---|---|---|---|---|
| No transaction history found. | ||||