<?php
session_start();
    header('Access-Control-Allow-Origin:*');
    header('Content-Type; application/json; charset=utf-8');
    header('Access-control-Allow-Method: POST');
    header('Access-control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-request-With');
    include('db.php');
        $inputdata = json_decode(file_get_contents("php://input"), true);
        $destinataire = $inputdata['destinataire'];
        $pub=$db->prepare('SELECT COUNT(*) AS nbr FROM tbl_product WHERE pstock <= seuil_faible');
        $pub->execute(array());
        $user = $pub->fetch();    
        echo(json_encode(['data' => $user]));