tout le front ok
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Paramètres de connexion à votre base de données GF
|
||||
$host = "localhost";
|
||||
$username = "root";
|
||||
$password = "sysadm-1963";
|
||||
$database = "GF";
|
||||
|
||||
try {
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$database;charset=utf8mb4", $username, $password);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// Requête pour récupérer les actions configurées avec afficher = 1 dans la table indice
|
||||
$stmt = $pdo->prepare("SELECT * FROM indice WHERE afficher = 1");
|
||||
$stmt->execute();
|
||||
$actionsConfig = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
echo json_encode([
|
||||
"status" => "success",
|
||||
"data" => $actionsConfig
|
||||
]);
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode([
|
||||
"status" => "error",
|
||||
"message" => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user