mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-01-18 16:47:35 +01:00
FIn de cours
This commit is contained in:
@@ -131,6 +131,11 @@ $router->GET('/api/rdv-praticient', ["id"], function($id){
|
||||
//getAllLieux($pdo);
|
||||
});
|
||||
|
||||
$router->GET('/api/rdv-praticient/getAllLieux', [], function(){
|
||||
global $pdo;
|
||||
getAllLieux($pdo);
|
||||
});
|
||||
|
||||
$router->GET('/api/rdv-patient', ["id"], function($id){
|
||||
global $pdo;
|
||||
dbRequestRdvPatient($pdo, $id);
|
||||
|
||||
@@ -23,11 +23,9 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
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");
|
||||
let user = TokenDecode(sessionStorage.getItem("token"));
|
||||
ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient?id=" + user.id, function (data) {
|
||||
DisplayRDVPraticient(data);
|
||||
});
|
||||
});
|
||||
@@ -47,9 +45,9 @@ function DisplayRDVPraticient(rdv){
|
||||
content.append('<h1>Vous n\'avez pas de rendez-vous</h1>');
|
||||
}
|
||||
else {
|
||||
for (let i = 0; i < count; i++){
|
||||
for (let i = 0; i < count; i++) {
|
||||
console.log(rdv[i]);
|
||||
if (rdv[i].p_mail !== null){
|
||||
if (rdv[i].p_mail !== null) {
|
||||
content.innerHTML = '' +
|
||||
'<div class="card rounded-4 mx-2 pointer">' +
|
||||
'<div class="card-header bg-danger">' +
|
||||
@@ -63,8 +61,7 @@ function DisplayRDVPraticient(rdv){
|
||||
'<br>' +
|
||||
'<a href="tel:0' + rdv[i].p_phone + '" class="card-subtitle mb-2 text-body-secondary">' + '0' + rdv[i].phone + '</a>' +
|
||||
'</div>' + '</div>';
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
content.innerHTML = '' +
|
||||
'<div class="card rounded-4 mx-2 pointer">' +
|
||||
'<div class="card-header bg-danger">' +
|
||||
@@ -76,11 +73,27 @@ function DisplayRDVPraticient(rdv){
|
||||
'<h5 class="card-title">Vous n\'avez pas de' + '<br>' + 'patient pour ce créneau</h5>' +
|
||||
'</div>' + '</div>';
|
||||
}
|
||||
content.innerHTML = '</div> <div id="addRDV" class="d-flex flex-row flex-wrap my-5 mx-5 gap-5 justify-content-center text-center" >';
|
||||
ShowAddRDV();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ShowAddRDV() {
|
||||
ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient/getAllLieux", function (data) {
|
||||
DisplayAddRDV(data);
|
||||
});
|
||||
}
|
||||
|
||||
function DisplayAddRDV(lieux) {
|
||||
let user = TokenDecode(sessionStorage.getItem("token"));
|
||||
let medID = user.id;
|
||||
let addRDV = document.getElementById("addRDV");
|
||||
addRDV.innerHTML = "";
|
||||
addRDV.innerHTML = '';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function DisplayRDVPatient(rdv){
|
||||
|
||||
Reference in New Issue
Block a user