Merge branch 'main' into cfouche

This commit is contained in:
cfouche
2024-04-08 09:19:33 +02:00
committed by GitHub
13 changed files with 758 additions and 378 deletions

View File

@@ -5,6 +5,8 @@ require_once '../php/constants.php';
require_once '../php/db/dbconnect.php';
require_once '../php/db/Search.php';
require_once '../php/db/Login.php';
require_once '../php/db/Calendrier.php';
require_once 'test/database.php';
ini_set('display_errors', 1);
error_reporting(E_ALL);
$pdo = dbConnect();
@@ -16,22 +18,44 @@ $router->GET('/api/requests', ["test"], function($test){
echo json_encode($test);
});
$router->GET('/api/search', ["type"], function($type){
$router->GET('/api/search-type', ["type"], function($type){
global $pdo;
searchDoctor($pdo, $type);
});
/*
$router->GET('/api/search', ["type", "location"], function($type, $location){
$router->GET('/api/search-postal', ["postal"], function($postal){
global $pdo;
searchDoctorByLocation($pdo, $location, $type);
searchDoctorByLocation($pdo, $postal);
});
$router->GET('/api/search', ["location"], function($location){
$router->GET('/api/search', ["type", "postal"], function($type, $postal){
global $pdo;
searchDoctorByLocation($pdo, $location);
searchDoctorByLocation($pdo, $postal, $type);
})
$router->GET('/api/rdv', ["id"], function($id){
global $pdo;
getNumberOfRDVByMedecin($pdo, $id);
});
$router->GET('/api/rdv-available', ["id"], function($id){
global $pdo;
selectRDVTimeByID($pdo, $id);
});
$router->GET('/api/rdv-date', ["date", "id"], function($date, $id){
global $pdo;
selectRDVForDate($pdo, $date, $id);
});
$router->GET('/api/praticien', ["id"], function($id){
global $pdo;
getPraticienDetails($pdo, $id);
});
$router->PUT('/api/rdv', ["rdv_id", "patient_id"], function($rdv_id, $patient_id){
global $pdo;
takeRDV($pdo, $rdv_id, $patient_id);
});
*/
$router->POST('/api/requests', ["test"], function($test){
echo json_encode($test);
});
@@ -53,4 +77,31 @@ $router->DELETE('/api/requests', ["test"], function($test){
echo json_encode($test);
});
$router->GET('/api/rdv-praticient', ["id"], function($id){
global $pdo;
dbRequestRdvPraticien($pdo, $id);
getAllLieux($pdo);
});
$router->GET('/api/rdv-patient', ["id"], function($id){
global $pdo;
dbRequestRdvPatient($pdo, $id);
getPastRdvByPatient($pdo, $id);
});
$router->DELETE('/api/delete-empty', ["id"], function($id){
global $pdo;
DeleteEmptyRdv($pdo, $id);
});
$router->DELETE('/api/cancel-rdv', ["id"], function($id){
global $pdo;
CancelRDV($pdo, $id);
});
$router->POST('/api/create-rdv', ["id", "date", "time", "lieu"], function($id, $date, $time, $lieu){
global $pdo;
createRDV($pdo, $id, $date, $time, $lieu);
});
$router->run();