Skip to content

Commit d3cb72c

Browse files
authored
Update back.php
1 parent d5216f9 commit d3cb72c

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

pay/back.php

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171

172172
function doAction($payRowId, $gateType){
173173
global $connection, $admin, $botUrl, $mainKeys;
174+
$time = time();
174175
$stmt = $connection->prepare("SELECT * FROM `pays` WHERE `id` = ? AND `state` = 'pending'");
175176
$stmt->bind_param("i", $payRowId);
176177
$stmt->execute();
@@ -259,13 +260,7 @@ function doAction($payRowId, $gateType){
259260
$server_info = $stmt->get_result()->fetch_assoc();
260261
$stmt->close();
261262

262-
if($server_info['ucount'] != 0) {
263-
$stmt = $connection->prepare("UPDATE `server_info` SET `ucount` = `ucount` - ? WHERE `id`=?");
264-
$stmt->bind_param("ii", $accountCount, $server_id);
265-
$stmt->execute();
266-
$stmt->close();
267-
268-
} else {
263+
if($server_info['ucount'] <= 0) {
269264
showForm('پرداخت شما انجام شد ولی ظرفیت این سرور پر شده است، مبلغ ' . number_format($amount) . " تومان به کیف پول شما اضافه شد",$payDescription, false);
270265

271266
$stmt = $connection->prepare("UPDATE `users` SET `wallet` = `wallet` + ? WHERE `userid` = ?");
@@ -276,13 +271,6 @@ function doAction($payRowId, $gateType){
276271
sendMessage("✅ مبلغ " . number_format($amount) . " تومان به کیف پول کاربر $user_id توسط درگاه اضافه شد میخواست کانفیگ بخره، ظرفیت پر بود",null,null,$admin);
277272
exit;
278273
}
279-
}else{
280-
if($acount != 0) {
281-
$stmt = $connection->prepare("UPDATE `server_plans` SET `acount` = `acount` - ? WHERE id=?");
282-
$stmt->bind_param("ii", $accountCount, $fid);
283-
$stmt->execute();
284-
$stmt->close();
285-
}
286274
}
287275

288276
$stmt = $connection->prepare("SELECT * FROM `server_info` WHERE `id`=?");
@@ -377,17 +365,24 @@ function doAction($payRowId, $gateType){
377365

378366
foreach($vraylink as $vray_link){
379367
$acc_text = "
380-
😍 سفارش جدید شما
381-
📡 پروتکل: $protocol
382-
🔮 نام سرویس: $remark
383-
🔋حجم سرویس: $volume گیگ
384-
⏰ مدت سرویس: $days روز
385-
386-
💝 config : <code>$vray_link</code>
387-
388-
🌐 subscription : <code>$subLink</code>
368+
😍 سفارش جدید شما
369+
📡 پروتکل: $protocol
370+
🔮 نام سرویس: $remark
371+
🔋حجم سرویس: $volume گیگ
372+
⏰ مدت سرویس: $days روز
373+
".
374+
($botState['configLinkState'] == "on"?
375+
"
376+
💝 config : <code>$vray_link</code>":"").
377+
($botState['subLinkState']=="on"?
378+
"
379+
380+
🔋 Volume web: <code> $botUrl"."search.php?id=".$uniqid."</code>
381+
382+
383+
🌐 subscription : <code>$subLink</code>
389384
390-
";
385+
":"");
391386

392387
$file = RandomString() .".png";
393388
$ecc = 'L';
@@ -421,7 +416,17 @@ function doAction($payRowId, $gateType){
421416
$user_info = $stmt->get_result()->fetch_assoc();
422417
$stmt->close();
423418

424-
419+
if($inbound_id == 0) {
420+
$stmt = $connection->prepare("UPDATE `server_info` SET `ucount` = `ucount` - ? WHERE `id`=?");
421+
$stmt->bind_param("ii", $accountCount, $server_id);
422+
$stmt->execute();
423+
$stmt->close();
424+
}else{
425+
$stmt = $connection->prepare("UPDATE `server_plans` SET `acount` = `acount` - ? WHERE id=?");
426+
$stmt->bind_param("ii", $accountCount, $fid);
427+
$stmt->execute();
428+
$stmt->close();
429+
}
425430

426431
if($user_info['refered_by'] != null){
427432
$stmt = $connection->prepare("SELECT * FROM `setting` WHERE `type` = 'INVITE_BANNER_AMOUNT'");

0 commit comments

Comments
 (0)