<?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 tbl_invoice.*, serveur.nom, tbl_user.username FROM tbl_invoice, serveur, tbl_user, point_journalier WHERE tbl_invoice.serveur=serveur.id AND tbl_user.id=point_journalier.user AND point_journalier.identifiant=tbl_invoice.id_point_journalier AND tbl_invoice.paye=? ORDER BY tbl_invoice.id DESC');
        $pub->execute(array(1));
        $image = $pub->fetchAll();    
        echo(json_encode(['data' => $image]));