<?php
include '_db.php';

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

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

  