PATH: //home/hwyuvbry/pelanggan.waroenkhoki123.web.id/function
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 api_result.log
↓
X
📁 asset/
X
📄 checker.php
↓
X
📄 error_log
↓
X
📄 get-referral.php
↓
X
📄 get-referral.php#
↓
X
📄 get-referral.php#8999
↓
X
📄 last_deposit.php
↓
X
📄 last_withdraw.php
↓
X
📄 memo-store.php
↓
X
📄 profile_update.php
↓
X
📄 proses_bet.php
↓
X
📄 proses_daftar.php#off dulu
↓
X
📄 proses_depo_otomatis.php
↓
X
📄 proses_depo_otomatis.php#
↓
X
📄 proses_deposit.php
↓
X
📄 proses_deposit.php#
↓
X
📄 proses_login.php
↓
X
📄 proses_pengaturan.php
↓
X
📄 proses_withdraw.php
↓
X
📄 proses_withdraw.php#
↓
X
📄 qris_log.txt
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: proses_withdraw.php
<?php include '../db/koneksi.php'; include '../api/nexus.php'; include '../api/sgx.php'; session_start(); header('Content-Type: application/json'); if (!isset($_SESSION['username']) || !isset($_SESSION['extplayer'])) { echo json_encode(['status' => 'error', 'message' => 'Sesi login tidak valid.']); exit; } $extplayer = $_SESSION['extplayer']; $username = $_SESSION['username']; $bank_pilihan_form = $_POST['bank'] ?? ''; $amount = $_POST['amount'] ?? '0'; $cleanAmount = preg_replace('/[^0-9]/', '', $amount); $jumlah = (int)$cleanAmount; $min = 50000; $max = 100000000; if ($jumlah < $min) { echo json_encode(['status' => 'error', 'message' => 'Minimal withdraw adalah Rp ' . number_format($min, 0, ',', '.')]); exit; } if ($jumlah > $max) { echo json_encode(['status' => 'error', 'message' => 'Maksimal withdraw adalah Rp ' . number_format($max, 0, ',', '.')]); exit; } $q = mysqli_query($koneksi, "SELECT * FROM tb_user WHERE extplayer = '$extplayer'"); if (!$q || mysqli_num_rows($q) == 0) { echo json_encode(['status' => 'error', 'message' => 'User tidak ditemukan.']); exit; } $d = mysqli_fetch_assoc($q); $saldo = intval($d['saldo']); $bank_asal = mysqli_real_escape_string($koneksi, $d['bank'] . ' - ' . $d['nama_rekening'] . ' - ' . $d['nomor_rekening']); if ($jumlah > $saldo) { echo json_encode(['status' => 'error', 'message' => 'Saldo tidak mencukupi.']); exit; } // ========================================================================= // VALIDASI PROTEKSI TURNOVER // ========================================================================= $query_depo = mysqli_query($koneksi, "SELECT * FROM `tb_deposit` WHERE `username` = '" . mysqli_real_escape_string($koneksi, $username) . "' AND `status` = 'Sukses' AND `bonus` > 0 ORDER BY `id` DESC LIMIT 1"); if (mysqli_num_rows($query_depo) > 0) { $data_depo = mysqli_fetch_assoc($query_depo); $perkalianto = 15; $target_turnover = ($data_depo['jumlah'] + $data_depo['bonus']) * $perkalianto; $datetime_start = $data_depo['created_at']; $datetime_end = date('Y-m-d H:i:s'); $sql_bet = "SELECT SUM(CAST(JSON_EXTRACT(tc, '$.bet') AS DECIMAL(15,2))) as total_to FROM `tb_play` WHERE `user` = '" . mysqli_real_escape_string($koneksi, $username) . "' AND `gamestart` BETWEEN '$datetime_start' AND '$datetime_end'"; $query_bet = mysqli_query($koneksi, $sql_bet); $total_turnover = ($query_bet) ? (mysqli_fetch_assoc($query_bet)['total_to'] ?? 0) : 0; if ($total_turnover < $target_turnover) { $sisa_to = $target_turnover - $total_turnover; echo json_encode([ 'status' => 'error', 'message' => 'Withdraw Gagal! Kurang Rp ' . number_format($sisa_to, 0, ',', '.') . ' Turnover lagi.' ]); exit; } } // ========================================================================= // VALIDASI CEK WITHDRAW PENDING (MENCEGAH DOUBLE WITHDRAW) // ========================================================================= $query_cek_pending = mysqli_query($koneksi, "SELECT id FROM tb_withdraw WHERE username = '" . mysqli_real_escape_string($koneksi, $username) . "' AND status = 'Pending' LIMIT 1"); if (mysqli_num_rows($query_cek_pending) > 0) { echo json_encode([ 'status' => 'error', 'message' => 'Anda masih memiliki permintaan withdraw yang sedang diproses.' ]); exit; } // ========================================================================= // PROSES INSERT // ========================================================================= $ref = 'WD' . date('YmdHis') . strtoupper(substr(md5(uniqid(mt_rand(), true)), 0, 6)); $sql = "INSERT INTO tb_withdraw (extplayer, username, ref, jumlah, bank_asal, status, created_at, updated_at) VALUES ('$extplayer', '$username', '$ref', '$jumlah', '$bank_asal', 'Pending', NOW(), NOW())"; if (mysqli_query($koneksi, $sql)) { mysqli_query($koneksi, "UPDATE tb_user SET saldo = saldo - $jumlah WHERE extplayer = '$extplayer'"); $nx->withdraw_member($extplayer, $jumlah); $SGX->withdraw_member($extplayer, $jumlah); echo json_encode(['status' => 'success', 'message' => 'Permintaan withdraw berhasil diajukan.']); } else { echo json_encode(['status' => 'error', 'message' => 'Gagal menyimpan data: ' . mysqli_error($koneksi)]); } ?>
SIMPAN PERUBAHAN