<?php
include '_db.php';

if($_SERVER['REQUEST_METHOD']=="POST"){
    // $userid = md5(date("Ymdhis").rand(203991, 483678));
    $wid = $_POST['wid'];
    $amount = $_POST['amount'];
    
    // $sql = $conn->query("SELECT * FROM ddeposit WHERE amount='$amount' AND wid ='$userid' AND dpass='$pass'");
   if (isset($_POST['btnEditAmount'])){
        $id = $_POST['id'];
        $sql = $conn->query("UPDATE withdrawals SET amount='$amount' WHERE id='$id'");
    }
    

    // Redirect back to the referring page (deposit_details.php)
    header("Location: " . $_SERVER['HTTP_REFERER']);
    exit();
    }

  