PATH: /home/hwyuvbry/public_html/function
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 deposit.php
↓
X
📄 deposit_asli.php
↓
X
📄 deposit_qris.php
↓
X
📄 edit-user.php
↓
X
📄 error_log
↓
X
📄 index.php
↓
X
📄 konfirmasi.php
↓
X
📄 password.php
↓
X
📄 post-chat.php
↓
X
📄 post-reg.php
↓
X
📄 reset-proses.php
↓
X
📄 session.php
↓
X
📄 step-1.php
↓
X
📄 taruhan4d.php
↓
X
📄 taruhancb.php
↓
X
📄 taruhancb2d.php
↓
X
📄 taruhancj.php
↓
X
📄 taruhancn.php
↓
X
📄 taruhandasar.php
↓
X
📄 taruhankembang.php
↓
X
📄 taruhanshio.php
↓
X
📄 taruhansilang.php
↓
X
📄 taruhantengah.php
↓
X
📄 transferBalanceBack.php
↓
X
📄 upload.php
↓
X
📄 withdraw.php
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: deposit_qris.php
<?php session_start(); require_once('../config/koneksi.php'); // file koneksi ke database if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Ambil data dari form $username = mysqli_real_escape_string($conn, $_POST['extplayer']); $amount = intval(str_replace('.', '', $_POST['amount'])); // hapus titik (format rupiah) // Validasi input if (empty($username) || $amount <= 0) { die("Input tidak valid."); } // Ambil ID user dari database $query_user = mysqli_query($conn, "SELECT cuid FROM tb_users WHERE username='$username' LIMIT 1"); $user = mysqli_fetch_assoc($query_user); $userID = $user ? $user['cuid'] : 0; // Buat kode unik $kode_unik = rand(100, 999); $total_deposit = $amount + $kode_unik; // Tentukan metode pembayaran QRIS secara eksplisit $payment_method = "QRIS"; $payment_note = "Menunggu pembayaran via QRIS"; // ============================== // 🔹 UPLOAD BUKTI TRANSFER // ============================== $bukti_file = null; if (isset($_FILES['bukti_transfer']) && $_FILES['bukti_transfer']['error'] == 0) { $target_dir = "../upload/bukti/"; if (!is_dir($target_dir)) { mkdir($target_dir, 0777, true); } $allowed_ext = ['jpg', 'jpeg', 'png', 'gif', 'webp']; $file_name = $_FILES['bukti_transfer']['name']; $file_tmp = $_FILES['bukti_transfer']['tmp_name']; $file_size = $_FILES['bukti_transfer']['size']; $file_ext = strtolower(pathinfo($file_name, PATHINFO_EXTENSION)); if (!in_array($file_ext, $allowed_ext)) { die("Format file tidak didukung. Gunakan JPG, PNG, GIF, atau WEBP."); } if ($file_size > 5 * 1024 * 1024) { die("Ukuran file terlalu besar. Maksimal 5MB."); } $new_name = time() . "_" . uniqid() . "." . $file_ext; $target_file = $target_dir . $new_name; if (move_uploaded_file($file_tmp, $target_file)) { $bukti_file = $new_name; } else { die("Gagal mengunggah bukti transfer."); } } // ============================== // 🔹 SIMPAN DATA KE DATABASE // ============================== // Tambahkan nama file bukti ke kolom catatan biar terbaca di request_depo.php $payment_note_final = $payment_note; if (!empty($bukti_file)) { $payment_note_final = $bukti_file; } $insert = mysqli_query($conn, " INSERT INTO tb_deposit (userID, username, nominal, metode, status, tgl, catatan) VALUES ('$userID', '$username', '$total_deposit', '$payment_method', 'Pending', NOW(), '$payment_note_final') "); if ($insert) { // Simpan ke session agar halaman pembayaran bisa tampilkan data $_SESSION['username'] = $username; $_SESSION['amount'] = $amount; $_SESSION['kode_unik'] = $kode_unik; $_SESSION['total_deposit'] = $total_deposit; $_SESSION['payment_method'] = $payment_method; // simpan payment method QRIS $_SESSION['payment_note'] = $payment_note_final; // simpan nama file bukti jika ada // Redirect ke halaman history header('Location: ../m/history.php'); exit; } else { echo "Gagal menyimpan data deposit: " . mysqli_error($conn); } } ?>
SIMPAN PERUBAHAN