diff --git a/forgotPassword-praticien.php b/forgotPassword-praticien.php index a8c3bdd..f83065d 100644 --- a/forgotPassword-praticien.php +++ b/forgotPassword-praticien.php @@ -21,7 +21,7 @@ $pdo = dbConnect(); ?>
Doct'ISEN
diff --git a/forgotPassword.php b/forgotPassword.php index 09030c7..a1f3016 100644 --- a/forgotPassword.php +++ b/forgotPassword.php @@ -21,7 +21,7 @@ $pdo = dbConnect(); ?>Doct'ISEN
diff --git a/index.php b/index.html similarity index 83% rename from index.php rename to index.html index 314c3b3..152c927 100644 --- a/index.php +++ b/index.html @@ -2,7 +2,7 @@ -
Doct'ISEN
diff --git a/login.php b/login.php index 9913c67..c564acc 100644 --- a/login.php +++ b/login.php @@ -23,7 +23,7 @@Doct'ISEN
@@ -60,7 +60,7 @@ if($login != false){ error_log("Login success"); $_SESSION['token'] = base64_encode("patient:".strval($login)); - echo ''; + echo ''; } else { error_log('Erreur de connexion'); } diff --git a/signup-praticien.php b/signup-praticien.php index 7cfb68d..87ba5de 100644 --- a/signup-praticien.php +++ b/signup-praticien.php @@ -23,7 +23,7 @@ session_start(); ?>Doct'ISEN
@@ -98,7 +98,7 @@ session_start(); if(SignupMedecin::insertMedecin($pdo,$name,$surname,$mail, $password,$specialite,$phone,$codePostal)){ error_log("Signup success"); $_SESSION['id'] = $mail; - echo ''; + echo ''; } else { error_log("Erreur d'inscription"); } diff --git a/signup.php b/signup.php index 44d3b94..c354103 100644 --- a/signup.php +++ b/signup.php @@ -23,7 +23,7 @@ session_start(); ?>Doct'ISEN
@@ -88,7 +88,7 @@ session_start(); if(SignupPatient::Insert($pdo,$name,$surname,$mail,$password,$phone)){ error_log("Signup success"); $_SESSION['id'] = $mail; - echo ''; + echo ''; } else { error_log('Erreur de connexion'); } diff --git a/src/API/requests.php b/src/API/requests.php index 90f2464..42e4ae4 100644 --- a/src/API/requests.php +++ b/src/API/requests.php @@ -128,7 +128,11 @@ $router->DELETE('/api/requests', ["test"], function($test){ $router->GET('/api/rdv-praticient', ["id"], function($id){ global $pdo; dbRequestRdvPraticien($pdo, $id); - //getAllLieux($pdo); +}); + +$router->GET('/api/rdv-praticient/getAllLieux', [], function(){ + global $pdo; + getAllLieux($pdo); }); $router->GET('/api/rdv-patient', ["id"], function($id){ diff --git a/src/API/src/response.php b/src/API/src/response.php index a886a02..733ed64 100644 --- a/src/API/src/response.php +++ b/src/API/src/response.php @@ -73,6 +73,6 @@ class Response header('Cache-control: no-store, no-cache, must-revalidate'); header('Pragma: no-cache'); http_response_code(418); - echo json_encode($data); + echo json_encode($data); // I'm a teapot } } \ No newline at end of file diff --git a/src/API/test/database.php b/src/API/test/database.php index cbdca98..6c0b3e8 100644 --- a/src/API/test/database.php +++ b/src/API/test/database.php @@ -111,6 +111,7 @@ function getAllLieux($pdo){ } function CreateRDV($pdo, $medID, $date, $time, $lieu){ + error_log($lieu. ', ' . $date . ', ' . $time . ', ' . $medID); $lieu = explode(', ', $lieu); $adress = $lieu[0] . ', ' . $lieu[1]; $postal = $lieu[2]; @@ -131,7 +132,9 @@ function CreateRDV($pdo, $medID, $date, $time, $lieu){ $statement->execute(); Response::HTTP200(["Success" => "RDV created"]); } - Response::HTTP404(["Error" => "Lieu not found"]); + else { + Response::HTTP404(["Error" => "Lieu not found"]); + } } function DeleteEmptyRdv($pdo, $id) diff --git a/src/js/AJAX/home.js b/src/js/AJAX/home.js index b67568f..2ce4fb1 100644 --- a/src/js/AJAX/home.js +++ b/src/js/AJAX/home.js @@ -45,7 +45,7 @@ function displayHomeTopBar() {Mes rendez-vous
+Mes rendez-vous
Mes rendez-vous practicien
+Mes rendez-vous practicien
`; diff --git a/src/js/AJAX/index.js b/src/js/AJAX/index.js index 1f85725..e335569 100644 --- a/src/js/AJAX/index.js +++ b/src/js/AJAX/index.js @@ -2,10 +2,10 @@ import {attachSearchEventListener} from "./search.js"; import {attachLoginUserDisplayEventListener, attachLoginPraticienDisplayEventListener, attachDisconnectEventListener} from "./login.js"; import {TokenDecode} from "./lib.js"; import {displayHome, displayHomeTopBar, attachReturnHomeEventListener} from "./home.js"; +import {ButtonShowRdvPraticient} from "./rdv-praticien.js"; console.log("index.js loaded"); - //Felix Part document.addEventListener("DOMContentLoaded", function() { @@ -14,103 +14,12 @@ document.addEventListener("DOMContentLoaded", function() { } }); - //Yanis Part document.addEventListener("DOMContentLoaded", function() { ButtonShowRdvPraticient(); }); -function ButtonShowRdvPraticient() { - try { - console.log("test1"); - document.getElementById("praticien-calendar").addEventListener("click", function () { - console.log("test2"); - ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient?id=" + 1, function (data) { - console.log("test3"); - DisplayRDVPraticient(data); - }); - }); - } - catch (e) { - //Do nothing - //console.error(e); - } -} - -function DisplayRDVPraticient(rdv){ - let count = rdv.length; - let content = document.getElementById("content"); - content.innerHTML = ""; - content.innerHTML = '' + rdv[i].rdv_date + '
' + - '' + rdv[i].rdv_time + '
' + - '' + rdv[i].rdv_date + '
' + - '' + rdv[i].rdv_time + '
' + - '' + $rdvPatient[i].rdv_date + '
' + - '' + $rdvPatient[i].rdv_time + '
' + - '' + rdv[i].rdv_date + '
' + @@ -17,13 +36,12 @@ function DisplayRDV(rdv){ '' + rdv[i].rdv_date + '
' + @@ -31,9 +49,63 @@ function DisplayRDV(rdv){ '