From 4926f1aac137284b9a1cfc15bb3122b316ed2253 Mon Sep 17 00:00:00 2001 From: sinbad Date: Mon, 8 Apr 2024 10:01:48 +0200 Subject: [PATCH] Pas encore good mais j'avance --- Request_Test/testHTTP.http | 44 +------------------------------------- rdv-praticien.php | 44 -------------------------------------- src/js/AJAX/index.js | 29 ++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 88 deletions(-) diff --git a/Request_Test/testHTTP.http b/Request_Test/testHTTP.http index 4f99b02..6091c94 100644 --- a/Request_Test/testHTTP.http +++ b/Request_Test/testHTTP.http @@ -1,48 +1,6 @@ -GET http://serveur-projet-s4.felix/src/API/requests.php/api/search?type=Généraliste&location=35 +GET http://ajax.yanisrff/src/API/requests.php/api/rdv-praticient?id=1 Accept: application/json -### -GET http://serveur-projet-s4.felix/src/API/requests.php/api/search-postal?postal=44 -Accept: application/json - -### -GET http://serveur-projet-s4.felix/src/API/requests.php/api/search-type?type=Généraliste -Accept: application/json - -### - -GET http://serveur-projet-s4.felix/src/API/requests.php/api/rdv-available?id=1 -Accept: application/json - -### -GET http://serveur-projet-s4.felix/src/API/requests.php/api/rdv-date?date=2024-03-18&id=1 -Accept: application/json - -### - -GET http://serveur-projet-s4.felix/src/API/requests.php/api/search?type=G%C3%A9n%C3%A9raliste&postal=35 -Accept: application/json - -### - -GET http://serveur-projet-s4.felix/src/API/requests.php/api/praticien?id=1 -Accept: application/json - -### - -PUT http://serveur-projet-s4.felix/src/API/requests.php/api/rdv -Content-Type: application/x-www-form-urlencoded - -rdv_id = 46792 & -patient_id = 1 - -### - -PUT http://serveur-projet-s4.felix/src/API/requests.php/api/requests -Content-Type: application/x-www-form-urlencoded - -test = "coucou" - ### POST http://serveur-projet-s4.felix/src/API/requests.php/api/requests diff --git a/rdv-praticien.php b/rdv-praticien.php index e4b8885..b37ad36 100644 --- a/rdv-praticien.php +++ b/rdv-praticien.php @@ -1,48 +1,4 @@ - - - - - RDV - - - - - - - - -
-
- -

- Doct'ISEN -

-
-
-
-
- -
-
-
diff --git a/src/js/AJAX/index.js b/src/js/AJAX/index.js index 919777b..cb8dee6 100644 --- a/src/js/AJAX/index.js +++ b/src/js/AJAX/index.js @@ -333,6 +333,7 @@ function DisplayRDVPraticient(rdv){ } else { for (let i = 0; i < count; i++){ + date = Date(rdv[i].rdv_date).toDateString(); if (rdv[i].p_mail !== "null") $('#content').append('' + '
' + @@ -366,7 +367,7 @@ function DisplayRDVPraticient(rdv){ function ButtonShowRdvPraticient() { try { - document.getElementById("CalendarPraticient").addEventListener("click", function () { + document.getElementById("PraticientCalendar").addEventListener("click", function () { ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient?id=" + 1, function (data) { DisplayRDVPraticient(data); }); @@ -378,6 +379,32 @@ function ButtonShowRdvPraticient() { } } +function DisplayRDVPatient(rdv){ + $rdvPatient = rdv[0]; + $lieux = rdv[1]; + + let count = $rdvPatient.length; + $('#content').empty(); + $('#content').html('
Vos rendez-vous à venir
'); + if(count === 0){ + $('#content').append('

Bienvenue sur Doct\'ISEN, veuillez prendre un rendez-vous en allant à l\'acceuil et en recherchant un praticient!

'); + } + else { + for (let i = 0; i < count; i++){ + if($rdvPatient !== "null") + $('#content').append('' + + '
' + + '
' + + '
' + + '

' + $rdvPatient[i].rdv_date + '

' + + '

' + $rdvPatient[i].rdv_time + '

' + + '
' + '
' + + '
' + + '