Autosave: 20260221-114057
This commit is contained in:
parent
f954adc14c
commit
8579468ad0
@ -257,6 +257,14 @@ $translations = [
|
|||||||
'type_message' => '输入消息...',
|
'type_message' => '输入消息...',
|
||||||
'welcome_support' => '欢迎来到BYRO支持中心!有什么可以帮您的?',
|
'welcome_support' => '欢迎来到BYRO支持中心!有什么可以帮您的?',
|
||||||
'mining_desc' => '专业的云挖矿和质押平台,加入成千上万的用户。',
|
'mining_desc' => '专业的云挖矿和质押平台,加入成千上万的用户。',
|
||||||
|
'mining_profit' => '挖矿收益',
|
||||||
|
'mining_return' => '本金退回',
|
||||||
|
'mining_invest' => '参加挖矿',
|
||||||
|
'mining_rebate' => '挖矿返佣',
|
||||||
|
'spot_buy' => '现货买入',
|
||||||
|
'spot_sell' => '现货卖出',
|
||||||
|
'transfer_in' => '转入',
|
||||||
|
'transfer_out' => '转出',
|
||||||
'mining_pool' => '矿池',
|
'mining_pool' => '矿池',
|
||||||
'day' => '天',
|
'day' => '天',
|
||||||
'flexible' => '活期',
|
'flexible' => '活期',
|
||||||
@ -398,10 +406,13 @@ $translations = [
|
|||||||
'total' => '总计',
|
'total' => '总计',
|
||||||
'orders' => '订单',
|
'orders' => '订单',
|
||||||
'all' => '全部',
|
'all' => '全部',
|
||||||
|
'completed' => '已完成',
|
||||||
'pnl' => '盈亏',
|
'pnl' => '盈亏',
|
||||||
'completed' => '已完成',
|
'completed' => '已完成',
|
||||||
'lost' => '亏损',
|
'lost' => '亏损',
|
||||||
4 => '已拒绝',
|
'0' => '审核中',
|
||||||
|
'3' => '已通过',
|
||||||
|
'4' => '已拒绝',
|
||||||
'cancelled' => '已取消',
|
'cancelled' => '已取消',
|
||||||
'hosting' => '托管中',
|
'hosting' => '托管中',
|
||||||
'today_profit' => '今日收益',
|
'today_profit' => '今日收益',
|
||||||
@ -865,6 +876,14 @@ $translations = [
|
|||||||
'type_message' => 'Type message...',
|
'type_message' => 'Type message...',
|
||||||
'welcome_support' => 'Welcome to support center.',
|
'welcome_support' => 'Welcome to support center.',
|
||||||
'mining_desc' => 'Cloud mining platform.',
|
'mining_desc' => 'Cloud mining platform.',
|
||||||
|
'mining_profit' => 'Mining Profit',
|
||||||
|
'mining_return' => 'Principal Return',
|
||||||
|
'mining_invest' => 'Mining Invest',
|
||||||
|
'mining_rebate' => 'Mining Rebate',
|
||||||
|
'spot_buy' => 'Spot Buy',
|
||||||
|
'spot_sell' => 'Spot Sell',
|
||||||
|
'transfer_in' => 'Transfer In',
|
||||||
|
'transfer_out' => 'Transfer Out',
|
||||||
'mining_pool' => 'Mining Pool',
|
'mining_pool' => 'Mining Pool',
|
||||||
'day' => 'Day',
|
'day' => 'Day',
|
||||||
'flexible' => 'Flexible',
|
'flexible' => 'Flexible',
|
||||||
@ -1006,10 +1025,13 @@ $translations = [
|
|||||||
'total' => 'Total',
|
'total' => 'Total',
|
||||||
'orders' => 'Orders',
|
'orders' => 'Orders',
|
||||||
'all' => 'All',
|
'all' => 'All',
|
||||||
|
'completed' => 'Completed',
|
||||||
'pnl' => 'PnL',
|
'pnl' => 'PnL',
|
||||||
'completed' => 'Completed',
|
'completed' => 'Completed',
|
||||||
'lost' => 'Lost',
|
'lost' => 'Lost',
|
||||||
4 => 'Rejected',
|
'0' => 'Pending',
|
||||||
|
'3' => 'Approved',
|
||||||
|
'4' => 'Rejected',
|
||||||
'cancelled' => 'Cancelled',
|
'cancelled' => 'Cancelled',
|
||||||
'hosting' => 'Hosting',
|
'hosting' => 'Hosting',
|
||||||
'today_profit' => 'Today\'s Profit',
|
'today_profit' => 'Today\'s Profit',
|
||||||
|
|||||||
14
profile.php
14
profile.php
@ -286,11 +286,11 @@ $kycStatusColor = [
|
|||||||
<?php foreach ($transactions as $t):
|
<?php foreach ($transactions as $t):
|
||||||
$typeColor = 'text-primary';
|
$typeColor = 'text-primary';
|
||||||
$typeName = __($t['type']);
|
$typeName = __($t['type']);
|
||||||
if (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'binary_win' || $t['type'] === 'recharge') $typeColor = 'text-success';
|
if (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'binary_win' || $t['type'] === 'recharge' || $t['type'] === 'mining_profit') $typeColor = 'text-success';
|
||||||
elseif (strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'binary_loss') $typeColor = 'text-danger';
|
elseif (strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'binary_loss') $typeColor = 'text-danger';
|
||||||
$prefix = ($t['type'] === 'binary_win' || $t['type'] === 'deposit' || $t['type'] === 'recharge' || $t['type'] === 'contract_settle') ? '+' : (($t['type'] === 'binary_loss' || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'contract_margin') ? '-' : '');
|
$prefix = (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'recharge' || $t['type'] === 'contract_settle' || $t['type'] === 'mining_profit') ? '+' : ((strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'contract_margin') ? '-' : '');
|
||||||
$statusText = ($t['status'] === 'completed' || $t['status'] === 3) ? __(3) : ($t['status'] === 4 ? __(4) : __(0));
|
$statusText = ($t['status'] == 'completed' || $t['status'] == 3) ? __(3) : ($t['status'] == 4 ? __(4) : __(0));
|
||||||
$statusClass = ($t['status'] === 'completed' || $t['status'] === 3) ? 'text-success' : ($t['status'] === 4 ? 'text-danger' : 'text-warning');
|
$statusClass = ($t['status'] == 'completed' || $t['status'] == 2 || $t['status'] == 3) ? 'text-success' : ($t['status'] == 4 ? 'text-danger' : 'text-warning');
|
||||||
?>
|
?>
|
||||||
<tr class="border-secondary">
|
<tr class="border-secondary">
|
||||||
<td class="ps-4 py-3" style="width: 25%;"><span class="<?= $typeColor ?> fw-bold"><?= $typeName ?></span></td>
|
<td class="ps-4 py-3" style="width: 25%;"><span class="<?= $typeColor ?> fw-bold"><?= $typeName ?></span></td>
|
||||||
@ -314,9 +314,9 @@ $kycStatusColor = [
|
|||||||
foreach ($transactions as $t):
|
foreach ($transactions as $t):
|
||||||
$count++;
|
$count++;
|
||||||
$typeName = __($t['type']);
|
$typeName = __($t['type']);
|
||||||
$typeColor = (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'recharge') ? 'text-success' : ((strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal') ? 'text-danger' : 'text-primary');
|
$typeColor = (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'recharge' || $t['type'] === 'mining_profit') ? 'text-success' : ((strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal') ? 'text-danger' : 'text-primary');
|
||||||
$statusText = ($t['status'] === 'completed' || $t['status'] === 3) ? __(3) : ($t['status'] === 4 ? __(4) : __(0));
|
$statusText = ($t['status'] == 'completed' || $t['status'] == 3) ? __(3) : ($t['status'] == 4 ? __(4) : __(0));
|
||||||
$statusClass = ($t['status'] === 'completed' || $t['status'] === 3) ? 'text-success' : ($t['status'] === 4 ? 'text-danger' : 'text-warning');
|
$statusClass = ($t['status'] == 'completed' || $t['status'] == 3) ? 'text-success' : ($t['status'] == 4 ? 'text-danger' : 'text-warning');
|
||||||
?>
|
?>
|
||||||
<div class="p-3 mb-2 rounded-4 bg-black bg-opacity-20 border border-secondary border-opacity-50">
|
<div class="p-3 mb-2 rounded-4 bg-black bg-opacity-20 border border-secondary border-opacity-50">
|
||||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||||
|
|||||||
14
recharge.php
14
recharge.php
@ -96,7 +96,7 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary w-100 py-3 rounded-pill fw-bold shadow-lg" onclick="confirmFiatOrder()">
|
<button type="button" class="btn btn-primary w-100 py-3 rounded-pill fw-bold shadow-lg" onclick="confirmFiatOrder(this, event)">
|
||||||
<?= __('confirm_order') ?>
|
<?= __('confirm_order') ?>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -169,7 +169,7 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary w-100 py-3 rounded-pill fw-bold shadow-lg" onclick="confirmCryptoOrder()">
|
<button type="button" class="btn btn-primary w-100 py-3 rounded-pill fw-bold shadow-lg" onclick="confirmCryptoOrder(this, event)">
|
||||||
<?= __('i_have_paid') ?>
|
<?= __('i_have_paid') ?>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@ -917,7 +917,8 @@ function scrollModalToBottom() {
|
|||||||
if (container) container.scrollTop = container.scrollHeight;
|
if (container) container.scrollTop = container.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmFiatOrder() {
|
function confirmFiatOrder(btn, event) {
|
||||||
|
if (event) event.preventDefault();
|
||||||
const amountInput = document.getElementById('fiatAmount');
|
const amountInput = document.getElementById('fiatAmount');
|
||||||
const amount = parseFloat(amountInput.value);
|
const amount = parseFloat(amountInput.value);
|
||||||
const select = document.getElementById('fiatCurrency');
|
const select = document.getElementById('fiatCurrency');
|
||||||
@ -932,7 +933,6 @@ function confirmFiatOrder() {
|
|||||||
const estUsdt = amount / rate;
|
const estUsdt = amount / rate;
|
||||||
|
|
||||||
// Show loading state
|
// Show loading state
|
||||||
const btn = event.currentTarget || event.target;
|
|
||||||
const originalText = btn.innerHTML;
|
const originalText = btn.innerHTML;
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
btn.innerHTML = `<span class="spinner-border spinner-border-sm me-2"></span>${originalText}`;
|
btn.innerHTML = `<span class="spinner-border spinner-border-sm me-2"></span>${originalText}`;
|
||||||
@ -972,10 +972,10 @@ function confirmFiatOrder() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmCryptoOrder() {
|
function confirmCryptoOrder(btn, event) {
|
||||||
|
if (event) event.preventDefault();
|
||||||
const amountInput = document.getElementById('cryptoAmount');
|
const amountInput = document.getElementById('cryptoAmount');
|
||||||
const amount = parseFloat(amountInput.value);
|
const amount = parseFloat(amountInput.value);
|
||||||
const btn = event.currentTarget || event.target;
|
|
||||||
|
|
||||||
if (isNaN(amount) || amount <= 0) {
|
if (isNaN(amount) || amount <= 0) {
|
||||||
notify('warning', '<?= __("enter_amount") ?>');
|
notify('warning', '<?= __("enter_amount") ?>');
|
||||||
@ -1013,7 +1013,7 @@ function confirmCryptoOrder() {
|
|||||||
body: `message=${encodeURIComponent(message)}`
|
body: `message=${encodeURIComponent(message)}`
|
||||||
});
|
});
|
||||||
|
|
||||||
notify('success', '<?= __("recharge_request_submitted") ?>', '<?= __("recharge_request_submitted_text") ?>');
|
notify('success', '<?= __("recharge_success_title") ?>', '<?= __("recharge_success_text") ?>');
|
||||||
amountInput.value = '';
|
amountInput.value = '';
|
||||||
} else {
|
} else {
|
||||||
notify('error', data.error || '<?= __("request_failed") ?>');
|
notify('error', data.error || '<?= __("request_failed") ?>');
|
||||||
|
|||||||
45
withdraw.php
45
withdraw.php
@ -1,12 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/db/config.php';
|
||||||
require_once __DIR__ . '/includes/exchange.php';
|
require_once __DIR__ . '/includes/lang.php';
|
||||||
|
if (session_status() === PHP_SESSION_NONE) session_start();
|
||||||
|
|
||||||
|
$user = null;
|
||||||
|
if (isset($_SESSION['user_id'])) {
|
||||||
|
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||||
|
$stmt->execute([$_SESSION['user_id']]);
|
||||||
|
$user = $stmt->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
header('Location: /auth/login.php');
|
header('Location: /auth/login.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
|
require_once __DIR__ . '/includes/exchange.php';
|
||||||
|
|
||||||
$rates = get_exchange_rates();
|
$rates = get_exchange_rates();
|
||||||
|
|
||||||
$stmt = db()->prepare("SELECT available FROM user_balances WHERE user_id = ? AND symbol = 'USDT'");
|
$stmt = db()->prepare("SELECT available FROM user_balances WHERE user_id = ? AND symbol = 'USDT'");
|
||||||
@ -101,7 +112,7 @@ $available = $bal['available'] ?? 0;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-warning w-100 py-3 rounded-pill fw-bold shadow-lg text-dark" onclick="confirmCryptoWithdraw()">
|
<button type="button" class="btn btn-warning w-100 py-3 rounded-pill fw-bold shadow-lg text-dark" onclick="confirmCryptoWithdraw(this, event)">
|
||||||
<?= __('confirm') ?>
|
<?= __('confirm') ?>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -150,7 +161,7 @@ $available = $bal['available'] ?? 0;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-warning w-100 py-3 rounded-pill fw-bold shadow-lg text-dark" onclick="confirmFiatWithdraw()">
|
<button type="button" class="btn btn-warning w-100 py-3 rounded-pill fw-bold shadow-lg text-dark" onclick="confirmFiatWithdraw(this, event)">
|
||||||
<?= __('confirm') ?>
|
<?= __('confirm') ?>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -243,7 +254,8 @@ function calculateFiatWithdraw() {
|
|||||||
|
|
||||||
const userId = '<?= $user['uid'] ?? $user['id'] ?>';
|
const userId = '<?= $user['uid'] ?? $user['id'] ?>';
|
||||||
|
|
||||||
function confirmCryptoWithdraw() {
|
function confirmCryptoWithdraw(btn, event) {
|
||||||
|
if (event) event.preventDefault();
|
||||||
const addr = document.getElementById('withdrawAddress').value.trim();
|
const addr = document.getElementById('withdrawAddress').value.trim();
|
||||||
const amount = parseFloat(document.getElementById('withdrawAmount').value);
|
const amount = parseFloat(document.getElementById('withdrawAmount').value);
|
||||||
const password = document.getElementById('withdrawPassword').value;
|
const password = document.getElementById('withdrawPassword').value;
|
||||||
@ -253,6 +265,10 @@ function confirmCryptoWithdraw() {
|
|||||||
if (amount > <?= $available ?>) { notify('error', '<?= __("insufficient_balance") ?>'); return; }
|
if (amount > <?= $available ?>) { notify('error', '<?= __("insufficient_balance") ?>'); return; }
|
||||||
if (!password) { notify('warning', '<?= __("enter_password") ?>'); return; }
|
if (!password) { notify('warning', '<?= __("enter_password") ?>'); return; }
|
||||||
|
|
||||||
|
const originalText = btn.innerHTML;
|
||||||
|
btn.disabled = true;
|
||||||
|
btn.innerHTML = `<span class="spinner-border spinner-border-sm me-2"></span>${originalText}`;
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('action', 'withdraw');
|
formData.append('action', 'withdraw');
|
||||||
formData.append('amount', amount);
|
formData.append('amount', amount);
|
||||||
@ -266,6 +282,8 @@ function confirmCryptoWithdraw() {
|
|||||||
})
|
})
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.innerHTML = originalText;
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
let message = `<?= __('withdraw_msg_crypto') ?>`;
|
let message = `<?= __('withdraw_msg_crypto') ?>`;
|
||||||
message = message.replace('%uid%', userId)
|
message = message.replace('%uid%', userId)
|
||||||
@ -275,10 +293,15 @@ function confirmCryptoWithdraw() {
|
|||||||
} else {
|
} else {
|
||||||
notify('error', data.error || '<?= __('request_failed') ?>');
|
notify('error', data.error || '<?= __('request_failed') ?>');
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.innerHTML = originalText;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmFiatWithdraw() {
|
function confirmFiatWithdraw(btn, event) {
|
||||||
|
if (event) event.preventDefault();
|
||||||
const amountInput = document.getElementById('fiatWithdrawAmount');
|
const amountInput = document.getElementById('fiatWithdrawAmount');
|
||||||
const amount = parseFloat(amountInput.value);
|
const amount = parseFloat(amountInput.value);
|
||||||
const select = document.getElementById('fiatWithdrawCurrency');
|
const select = document.getElementById('fiatWithdrawCurrency');
|
||||||
@ -290,6 +313,10 @@ function confirmFiatWithdraw() {
|
|||||||
if (amount > <?= $available ?>) { notify('error', '<?= __("insufficient_balance") ?>'); return; }
|
if (amount > <?= $available ?>) { notify('error', '<?= __("insufficient_balance") ?>'); return; }
|
||||||
if (!password) { notify('warning', '<?= __("enter_password") ?>'); return; }
|
if (!password) { notify('warning', '<?= __("enter_password") ?>'); return; }
|
||||||
|
|
||||||
|
const originalText = btn.innerHTML;
|
||||||
|
btn.disabled = true;
|
||||||
|
btn.innerHTML = `<span class="spinner-border spinner-border-sm me-2"></span>${originalText}`;
|
||||||
|
|
||||||
const estFiat = amount * rate;
|
const estFiat = amount * rate;
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
@ -307,6 +334,8 @@ function confirmFiatWithdraw() {
|
|||||||
})
|
})
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.innerHTML = originalText;
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
let message = `<?= __('withdraw_msg_fiat') ?>`;
|
let message = `<?= __('withdraw_msg_fiat') ?>`;
|
||||||
const preciseRes = (amount * rate).toFixed(2);
|
const preciseRes = (amount * rate).toFixed(2);
|
||||||
@ -319,6 +348,10 @@ function confirmFiatWithdraw() {
|
|||||||
} else {
|
} else {
|
||||||
notify('error', data.error || '<?= __('request_failed') ?>');
|
notify('error', data.error || '<?= __('request_failed') ?>');
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.innerHTML = originalText;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user