<?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);
        //$type_v = $inputdata['type_v'];
        $pub=$db->prepare('SELECT stock_boisson.*, boisson.nom, boisson.qte_stock, tbl_user.username FROM boisson, stock_boisson, tbl_user WHERE stock_boisson.boisson=boisson.id AND stock_boisson.user=tbl_user.id AND stock_boisson.valid=? ORDER BY stock_boisson.id DESC');
        $pub->execute(array(1));
        $image = $pub->fetchAll();    
        echo(json_encode(['data' => $image]));