Commit 532c8496a68461ab8a0d27afcecbb8f95af9a067
1 parent
acc8777f
api/utilisateur/liste
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once("../commun.php"); | ||
4 | + | ||
5 | +verifierDroit(3); | ||
6 | + | ||
7 | +$requete = $db->prepare("SELECT login, idCarte, droit FROM Utilisateurs"); | ||
8 | +if (!$requete->execute()) { | ||
9 | + retour("erreur_bdd", ["message" => $requete->error]); | ||
10 | +} | ||
11 | +$requete->bind_result($login, $idCarte, $droit); | ||
12 | +$utilisateurs = []; | ||
13 | +while ($requete->fetch()) { | ||
14 | + $utilisateur = ["login" => $login, "idCarte" => $idCarte, "droit" => $droit]; | ||
15 | + $utilisateurs[] = $utilisateur; | ||
16 | +} | ||
17 | +$requete->close(); | ||
18 | + | ||
19 | + | ||
20 | +retour("ok", ["utilisateurs" => $utilisateurs]); | ||
21 | + | ||
22 | +?> |