mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-01-19 09:07:28 +01:00
27 lines
786 B
PHP
27 lines
786 B
PHP
<?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);
|
|
}
|
|
|