-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplaymembers.php
More file actions
123 lines (103 loc) · 4.42 KB
/
displaymembers.php
File metadata and controls
123 lines (103 loc) · 4.42 KB
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
<?php
session_start();
include_once './db/variables.php';
$ip_bloquee = '172.16.1.10';
$ip_visiteur = $_SERVER['REMOTE_ADDR'];
if ($ip_visiteur === $ip_bloquee) {
http_response_code(403);
die('Accès refusé');
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="Course, Running">
<meta name="description" content="Devenez adhérents à des courses à pied">
<meta name="author" content="QUEIROZ Florian">
<meta name="viewport" content="width=device-width">
<title>Club de course à pied</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/pages/displayMembers.css">
<link rel="shortcut icon" href="../media/favicon.png" type="image/x-icon">
</head>
<body>
<?php
include './components/header.php';
?>
<section>
<div class="div-page-title-container">
<h3>Liste des Adhérents</h3>
<div class="div-input-search">
<input type="text" name="" id="input-text-search" placeholder="Rechercher un adhérents">
<button id="btn-submit-search"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path d="M21.0002 21L16.7002 16.7M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke-linecap="round" stroke-linejoin="round"/>
</svg></button>
</div>
</div>
<table border="1" cellpadding="5" cellspacing="0">
<thead>
<tr>
<th>Numéro de licence</th>
<th>Photo de profile</th>
<th>Prénom</th>
<th>Nom</th>
<th>Sexe</th>
<th>Date de naissance</th>
<th>Mail</th>
</tr>
</thead>
<tbody>
<?php
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT
a.adh_licence,
a.adh_nom,
a.adh_prenom,
a.adh_dateNaissance,
a.adh_sexe,
a.adh_mail,
a.adh_avatar,
COUNT(i.ins_couId) AS nb_courses
FROM adherent a
LEFT JOIN inscrire i ON a.adh_licence = i.ins_adhLicence
GROUP BY a.adh_licence, a.adh_nom, a.adh_prenom
");
$stmt->execute();
$resultats = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($resultats) {
foreach ($resultats as $result){
?>
<tr>
<td><?php echo $result['adh_licence']; ?></td>
<td><a href="/profile.php?id=<?php echo $result['adh_licence']; ?>"><div class="div-avatar" style="background: url('/uploads/profile_picture/<?php echo $result['adh_avatar']; ?>')"></div></a></td>
<td><?php echo $result['adh_prenom']; ?></td>
<td><?php echo $result['adh_nom']; ?></td>
<td><?php echo $result['adh_sexe']; ?></td>
<td><?php echo $result['adh_dateNaissance']; ?></td>
<td><?php echo $result['adh_mail']; ?></td>
</tr>
<?php
}
}else {
$message ="error";
}
}
catch (PDOException $e) {
$message = "Echec de l'affichage :" . $e->getMessage();
}
if (!empty($message)){
echo $message;
}
?>
</tbody>
</table>
</section>
<script src="./js/searchs/searchMembers.js"></script>
<?php
include './components/footer.php';
?>
</body>
</html>