<?php
include "../../root.class.php";
$db = new db_safeguard();


if (isset($_POST["item_id"])) {
    $item_id = $_POST['item_id'];
    if ($_POST["amount"] == '') {
        $_POST["amount"] = "Null";
    }
    if (
        $db->query("stock_take_stock", "UPDATE stock_take_stock SET amount_counted = {$_POST["amount"]} WHERE item_id = $item_id AND stock_take_id = {$_GET['stock_take_id']}")
    ) {
        echo 1;
    }

}

