<?php

    require_once "config/connection.php";

    $arr = array();

    foreach ($_POST["chk_product_stock_id"] as $idx => $product_stock_id)
    {
        $sql = "delete from `product_stock` 
            where `product_stock_id` = " . $product_stock_id;

        if (!mysql_query($sql))
        {
            $arr["status"] = 0;
            $arr["message"] = mysql_error();
            die(json_encode($arr));
        }
    }

    $arr["status"] = 1;
    $arr["message"] = "Produit(s) supprimé(s) avec succès.";
    echo json_encode($arr);
    