-
Notifications
You must be signed in to change notification settings - Fork 0
/
profil_coach_test.php
397 lines (367 loc) · 16.6 KB
/
profil_coach_test.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!-- --------------------------------------------- ChatBox -------------------------------------------------------------------------- -->
<?php
session_start();
function isCo()
{
if ($_COOKIE["connection"] == false) {
loginForm();
} else {
$_SESSION['name'] = $_COOKIE["Session_name_user"];
}
}
function isClient_php()
{
if ($_COOKIE["Session_type_user"] != 'client') {
echo "<script> document.getElementById('button-chatbox-container').style.display = 'none'; <script> ";
}
}
if ($_COOKIE["Session_type_user"] == null) {
$client = 0;
} else {
$client = $_COOKIE["Session_type_user"];
}
?>
<!-- -------------------------------------------------------------------------------------------------------------------------------- -->
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Base</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8">
<!-- main css -->
<link rel="stylesheet" href="style_base.css">
<!-- css for the page -->
<link rel="stylesheet" href="test_coach.css">
<script type="text/javascript" src="script_base.js"></script>
<script type="text/javascript" src="script_chatbox.js"></script>
<script src="https://code.iconify.design/2/2.2.1/iconify.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<div class="page" id="page">
<div class="haut">
<div class="logo_slogan">
<div class="logo">
<img id="img_logo" src="Image/Logo_Omnes_Sport_bordure.png">
</div>
<div class="slogan" id="slogan">
<span class="text_slogan">Omnes Sport</span>
</div>
</div>
<div class="div_button">
<button class="nav-button" id="accueil"><a class="nav-page" href="accueil.html">Accueil</a></button>
<button class="nav-button" id="parcourir"><a class="nav-page" href="toutParcourir.html">Tout
parcourir</a></button>
<button class="nav-button" id="rdv"><a class="nav-page" href="Rendezvous.html">Rendez vous</a></button>
</div>
<div class="search-box-co">
<div class="search-box">
<input type="text" id="search" placeholder="Rechercher..." />
<div id="display"></div>
<script type="text/javascript">
$(document).ready(function() {
$("#search").keyup(function() {
var name = $('#search').val();
if (name == "") {
$("#display").html("");
} else {
$.ajax({
type: "POST",
url: "ajax.php",
data: {
search: name
},
success: function(html) {
$("#display").html(html).show();
}
});
}
});
});
</script>
</div>
<div class="btnRegLog">
<button class="reg-log" id="disco" onclick="btnDeco()"><i class="iconify" id="deco" data-icon="material-symbols:exit-to-app"></i></button>
<button class="reg-log" id="reg-log" onclick="openForm()"><i class="iconify" id="compte" data-icon="uil:user"></i></button>
</div>
</div>
</div>
<div class="milieu" id="content">
<!-- ---------------------------------------------------ChatBox--------------------------------------------------------------------- -->
<div class="chatbox-list-container">
<table class="liste-client">
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
<tr>
<td class="client">Thierry</td>
</tr>
</table>
</div>
<div id="chatbox-container">
<?php
isCo();
?> <div id="chatbox-wrapper">
<div id="chatbox">
<?php
if (file_exists("Discussion/" . $_COOKIE['Session_Id_user'] . "log" . $client . ".html") && filesize("Discussion/" . $_COOKIE['Session_Id_user'] . "log" . $client . ".html") > 0) {
$contents = file_get_contents("Discussion/" . $_COOKIE['Session_Id_user'] . "log" . $client . ".html");
echo $contents;
}
?>
</div>
<div class="chat-input-container">
<form class="chat-input-form" name="message" action="">
<div id="chat-input-text">
<input class="chat-input" name="usermsg" type="text" id="usermsg" />
</div>
<div id="chat-input-button">
<input class="chat-input" name="submitmsg" type="submit" id="submitmsg" value="Envoyer" />
</div>
</form>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script type="text/javascript">
// jQuery Document
$(document).ready(function() {
$("#submitmsg").click(function() {
var clientmsg = $("#usermsg").val();
$.post('post_coach.php', {
text: clientmsg
});
$("#usermsg").val("");
return false;
});
function loadLog() {
var oldscrollHeight = $("#chatbox")[0].scrollHeight - 20; //Hauteur de défilement avant la requête
var dir = "Discussion/" + getCookie('Session_Id_user') + "_log_" + getCookie('clientConsulte') + ".html";
$.ajax({
url: dir,
cache: false,
success: function(html) {
$("#chatbox").html(html); //Insérez le log de chat dans la #chatbox div
//Auto-scroll
var newscrollHeight = $("#chatbox")[0].scrollHeight - 20; //Hauteur de défilement apres la requête
if (newscrollHeight > oldscrollHeight) {
$("#chatbox").animate({
scrollTop: newscrollHeight
}, 'normal'); //Défilement automatique
}
}
});
}
setInterval(loadLog, 2500);
});
</script>
</div>
<!-- ------------------------------------------------------------------------------------------------------------------------------ -->
</div>
<div class="footer" id="footer">
<div class="copyright">
<p>ceci est un copyright</p>
</div>
<div class="text">
<p>footer</p>
</div>
</div>
</div>
<!--Form de Connection/Inscription-->
<div id="CoIns-window">
<div class="section" id="section-form">
<div id="img-CoIns"><img id="imgCoIns" src="Image/marbreblanc.jpg" width="100%" height="100%"></div>
<div class="CoIns">
<div id="closeForm-container">
<button class="closeForm"><i class="iconify" id="close" data-icon="eva:close-circle-outline" onclick="closeForm()"></i></button>
</div>
<nav class="nav nav-tabs" id="myTab">
<a class="nav-item nav-link active" id="tab-co" href="#Co" data-toggle="tab">Connexion</a>
<a class="nav-item nav-link" id="tab-ins" href="#Ins" data-toggle="tab">Inscription</a>
</nav>
<div class="tab-content">
<div class="tab-pane active" id="Co">
<form action="Connexion.php" method="post">
<div class="form-input">
<input type="email" name="mail" class="form-style" placeholder="Votre e-mail" id="mail" autocomplete="off">
<i class="input-icon uil uil-at"></i>
</div>
<div class="form-input mt-2">
<input type="password" name="password" class="form-style" placeholder="Votre Mot de passe" id="mdp" autocomplete="off">
<i class="input-icon uil uil-lock-alt"></i>
</div>
<input type="submit" class="btnValid" name="Se_Connecter" value="Envoyer">
<div class="mdp-forget-container">
<p class="mdp-forget"><a href="#0" class="link">Mot de passe oublié ?</a></p>
</div>
</form>
</div>
<div class="tab-pane" id="Ins">
<form action="Connexion.php" method="post">
<div class="form-input">
<input type="text" name="nom" class="form-style" placeholder="Votre nom" id="nom" autocomplete="off">
<i class="input-icon uil uil-user"></i>
</div>
<div class="form-input">
<input type="email" name="mail" class="form-style" placeholder="Votre e-mail" id="mail" autocomplete="off">
<i class="input-icon uil uil-at"></i>
</div>
<div class="form-input">
<input type="password" name="mdp" class="form-style" placeholder="Votre mot de passe" id="mdp" autocomplete="off">
<i class="input-icon uil uil-lock-alt"></i>
</div>
<input type="submit" class="btnValid" name="creer_Compte" value="Validate">
</form>
</div>
</div>
</div>
</div>
</div>
<!--Fin du Form de Connection/Inscription-->
<script type="text/javascript">
$(document).ready(function() {
autoIncrementId();
});
function autoIncrementId() {
var i = 0;
$('.client').each(function() {
i++;
$(this).attr('id', i);
});
}
$(".liste-client").on("click", "td", function() {
var id = $(this).attr("id");
document.cookie = "clientConsulte = " + id;
window.location.reload();
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>
<script>
const options = {
bottom: '64px', // default: '32px'
right: 'unset', // default: '32px'
left: '32px', // default: 'unset'
time: '0.5s', // default: '0.3s'
mixColor: '#fff', // default: '#fff'
backgroundColor: '#fff', // default: '#fff'
buttonColorDark: '#100f2c', // default: '#100f2c'
buttonColorLight: '#fff', // default: '#fff'
saveInCookies: true, // default: true,
label: '🌓', // default: ''
autoMatchOsTheme: true // default: true
}
const darkmode = new Darkmode(options);
darkmode.showWidget();
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>