API api_connexions.php
This commit is contained in:
parent
f2653d73b4
commit
6e42f8e56d
17
api/api_connexions.php
Normal file
17
api/api_connexions.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Ce script renvoie un object JSON des connexions en cours
|
||||
include_once('../admin/connexions.php');
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$connexions = Connexion_machine();
|
||||
$tableau_connexions = [];
|
||||
foreach ($connexions as $machine => $conn) {
|
||||
$conn["machine"] = $machine; // ajout d'un champ dans le hash $conn
|
||||
array_push($tableau_connexions, $conn);
|
||||
}
|
||||
|
||||
$json_connexions = json_encode($tableau_connexions);
|
||||
echo($json_connexions);
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user