forked from space192/PiscineWeb22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AffichageRDV.php
238 lines (185 loc) · 8.6 KB
/
AffichageRDV.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Omnes Santé : Trouver des médecins généralistes</title>
<meta name="description" content="Prenez facilement rendez-vous avec vos professionnels de santé et communiquez avec eux en direct.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style2.css">
<link rel="stylesheet" href="AffichageRDV.css">
<link rel="stylesheet" href="Index.css">
<?php include_once 'const.php' ?>
<script src="Index.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="icon" href="images/Decor/LogoOmnesSante2.ico">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
function effacer(t) {
if(confirm("Voulez vous annulez ce rendez-vous?"))
{
let date = event.target.getAttribute('data-arg1');
document.cookie = "DateEff=" + date+ "; SameSite=None; Secure";
let client = event.target.getAttribute('data-arg2');
document.cookie = "ClientEff=" + client + "; SameSite=None; Secure";
document.cookie = "RDV=" + t + "; SameSite=None; Secure";
location.href = "EffacerRDV.php";
}
}
</script>
</head>
<body>
<div id="Wrapper">
<header id="Header">
<?php include 'navBar.php' ?>
<?php include 'NavBarStatique.php' ?>
<div id="Darkmode"><button onclick="switchTheme()" title="Changer de thème de couleur">◐</button></div>
</header>
<section id="Milieu" >
<?php
$memberStatement = $mysqlConnection->prepare("SELECT * FROM EDT_Medecin ;");
$memberStatement->execute();
$result = $memberStatement->fetchAll();
$idU = -1;
if (isset($_SESSION["LOGGED"]) || isset($_COOKIE["LOGGED_USER"]))
{
include 'queryAccount.php' ;
$resultU = getAccount() ;
$idU = $resultU["ID"];
}
echo ('<div id="contenant">');
echo ('<div id="deroulant">');
echo ('<div class="titreSpe"> Mes rendez-vous avec des practiciens:');
echo('</div>');
foreach($result as $RDV)
{
if($RDV["ID_Client"] == $idU )
{
$id = $RDV["ID_Medecin"];
$memberStatement = $mysqlConnection->prepare("SELECT * FROM Medecin WHERE id= $id ;");
$memberStatement->execute();
$data = $memberStatement->fetchAll();
echo ('<div id="cardRDV">');
// echo ('<div class="detailsRDV">');
echo ('<div class="detailsProfil">');
echo('<div class="titre">');
echo('Votre practicien : <br>');
echo($data[0]["Prenom"] . " ". $data[0]["Nom"]);
echo ('</div>');
echo ('<div class="photoProfil">');
echo ('<img src="' . $data[0]["pp"] . '" class="image">');
echo ('</div> ');
echo ('</div> ');
// echo ('</div>');
echo ('<div class="detailsRDV">');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Date :');
echo ('</div>');
echo('<div class="descriptionD">');
echo(substr($RDV["Date"],0,10));
echo ('</div>');
echo ('</div>');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Heure :');
echo ('</div>');
echo('<div class="descriptionD">');
echo(substr($RDV["Date"],10));
echo ('</div>');
echo ('</div>');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Localisation :');
echo ('</div>');
echo('<div class="descriptionD">');
echo($data[0]["Localisation"]);
echo ('</div>');
echo ('</div>');
echo ('</div>');
echo ('<button class="annuler" onClick="effacer(1)" title="Annuler votre rendez-vous" data-arg1="');
echo($RDV["Date"]);
echo('" data-arg2="');
echo($RDV["ID_Client"]);
echo('">');
echo ('</button>');
echo ('</div>');
}
}
echo ('<div class="titreSpe"> Mes rendez-vous en laboratoire:');
echo('</div>');
$memberStatement = $mysqlConnection->prepare("SELECT * FROM EDT_Labo ;");
$memberStatement->execute();
$result = $memberStatement->fetchAll();
foreach($result as $RDV)
{
if($RDV["ID_Client"] == $idU )
{
$id = $RDV["ID_Labo"];
$memberStatement = $mysqlConnection->prepare("SELECT * FROM Labo WHERE ID_Labo= $id ;");
$memberStatement->execute();
$data = $memberStatement->fetchAll();
$idS = $RDV["ID_Service"];
$memberStatement = $mysqlConnection->prepare("SELECT * FROM Service WHERE ID_Service= $idS ;");
$memberStatement->execute();
$service = $memberStatement->fetchAll();
echo ('<div id="cardRDV">');
// echo ('<div id="detailsRDV">');
echo ('<div class="detailsProfil">');
echo('<div class="titre">');
echo($data[0]["Nom"]);
echo ('</div>');
echo ('</div> ');
// echo ('</div>');
echo ('<div class="detailsRDV">');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Date :');
echo ('</div>');
echo('<div class="descriptionD">');
echo(substr($RDV["Date"],0,10));
echo ('</div>');
echo ('</div>');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Heure :');
echo ('</div>');
echo('<div class="descriptionD">');
echo(substr($RDV["Date"],10));
echo ('</div>');
echo ('</div>');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Localisation :');
echo ('</div>');
echo('<div class="descriptionD">');
echo($data[0]["Localisation"]);
echo ('</div>');
echo ('</div>');
echo ('<div class="textDetails">');
echo('<div class="titreD">');
echo('Service :');
echo ('</div>');
echo('<div class="descriptionD">');
echo($service[0]["Nom"]);
echo ('</div>');
echo ('</div>');
echo ('</div>');
echo ('<button class="annuler" onClick="effacer(2)" title="Annuler votre rendez-vous" data-arg1="');
echo($RDV["Date"]);
echo('" data-arg2="');
echo($RDV["ID_Client"]);
echo('">');
echo ('</button>');
echo ('</div>');
}
}
echo ('</deroulant>');
echo('</div>');
?>
</section>
</div>
<?php include 'footer.php' ?>
</body>
</html>