function delete_product(indx,product_id, name) {
    var userChoice=confirm("are you sure you want to delete this product: "+name);
    if(!userChoice) return false;
    fetch('/delete/product/' + product_id, {
        method: 'DELETE',
        headers: {
            'Content-type': 'application/json; charset=UTF-8'
        }
    }).then(response => response.json()).then(function (res) {
        if (res.message == "success") {
$("#tr_product_"+indx).hide();
        }
        else {
            alert("something went wrong");
        }
    });
}
