
<?php
include("connection.php");

if (isset($_POST['order_id'])) {
    $user_name = mysqli_real_escape_string($conn, $_POST['user_name']);
    $credit = mysqli_real_escape_string($conn, $_POST['credit']);
    $virtual_credit = mysqli_real_escape_string($conn, $_POST['virtual_credit']);
    $order_id = $_POST['order_id'];

    $sql = "UPDATE credit SET user_name = '$user_name', credit = '$credit',virtual_credit = '$virtual_credit' WHERE order_id = $order_id";

    $result = mysqli_query($conn, $sql);

    if ($result) {
        header("Location: reseller-price.php?success=Order Sent Successfully!!!");
        exit();
    } else {
        header("Location: reseller-price.php?error=Failed insertion!!!");
        exit();
    }
} else {
    header("Location: reseller-price.php?error=Not submitted!!!");
    exit();
}
?>
