<?php 
include "functions.php";
use SAPb1\Filters\Equal;
use SAPb1\Filters\InArray;

try 
{
    session_start();

    $sap = Login();
    $ConsultationsList = $sap->getService("view.svc/B1_ListCONSULTATIONB1SLQuery");
    $Consultations_result = $ConsultationsList->queryBuilder()
    ->select('DocEntry,NomPatient,U_DateConsultation,U_Notes,U_ActivityType,U_Statut')
    ->where(new Equal("Salariée", $_SESSION["EmployeeID"] ))
    ->findAll();

    $Consultations = json_decode(json_encode($Consultations_result), TRUE);
    echo json_encode($Consultations['value']);
    

 

} catch (Exception $e) {
    echo $e->getMessage();    
}