<?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);
        
       
        $pub=$db->prepare('SELECT prix_repas.id AS id,CONCAT(repas.nom," ", prix_repas.designation) AS nom FROM repas, prix_repas WHERE repas.id=prix_repas.repas AND prix_repas.est_un_accompagnement=? AND prix_repas.qte_stock >?');
        $pub->execute(array(1,0));
        $pubs = $pub->fetchAll();    
        
        echo(json_encode(['data' => $pubs]));
        
