This commit is contained in:
sinbad
2024-05-21 17:46:45 +02:00
parent 8f665a4779
commit 6f7d6b7e82

View File

@@ -1,26 +0,0 @@
<?php
require_once "database.php";
$PDO = dbConnect();
$request = substr($_SERVER['PATH_INFO'], 1);
$request = explode('/', $request);
$requestRessource = array_shift($request);
$method = $_SERVER["REQUEST_METHOD"];
parse_str(file_get_contents('php://input'), $_PUT);
if($method === "GET" && isset($_GET)){ // Want tweets of a specific user
$rdvOfPraticien = dbRequestRdvPraticien($PDO, $_GET["login"]);
echo json_encode($rdvOfPraticien);
}
if($method === "POST" && isset($_POST)){
$success = CreateRDV($PDO, $_POST["login"], $_POST["date"], $_POST["time"], $_POST["lieu"]);
echo json_encode($success);
}
if($method === "DELETE" && isset($_GET)){
$id = array_shift($request);
$success = DeleteEmptyRdv($PDO, $_GET["rdv"]);
echo json_encode($success);
}