-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbureau.php
More file actions
274 lines (266 loc) · 9.7 KB
/
bureau.php
File metadata and controls
274 lines (266 loc) · 9.7 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
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
<?php
// Start session and include database configuration
require 'config.php';
// Vérifier si l'utilisateur est connecté
$isLoggedIn = isset($_SESSION['user_id']);
// Fetch current bureau members
$current_bureau = [];
$bureau_history = [];
try {
$stmt = $conn->prepare("SELECT bm.*, u.full_name, u.profile_picture
FROM bureau_members bm
JOIN users u ON bm.user_id = u.id
WHERE bm.is_current = 1
ORDER BY
CASE
WHEN bm.position = 'Président' THEN 1
WHEN bm.position = 'Vice-Président' THEN 2
WHEN bm.position = 'Secrétaire' THEN 3
WHEN bm.position = 'Trésorier' THEN 4
ELSE 5
END");
$stmt->execute();
$current_bureau = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
$stmt->close();
// Fetch bureau history
$stmt = $conn->prepare("SELECT * FROM bureau_history ORDER BY year_range DESC");
$stmt->execute();
$bureau_history = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);
$stmt->close();
} catch (Exception $e) {
// Handle database errors gracefully
error_log("Database error: " . $e->getMessage());
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SIGMA Alumni - Bureau</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
:root {
--primary-blue: #0056b3;
--dark-blue: #003366;
--light-blue: #e6f0ff;
--accent-gray: #4a4a4a;
--light-gray: #f5f5f5;
--white: #ffffff;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: var(--light-gray);
color: var(--accent-gray);
line-height: 1.6;
}
/* Hero Section */
.bureau-hero {
background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
color: var(--white);
text-align: center;
padding: 8rem 5% 4rem;
margin-top: 70px;
}
.bureau-hero h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
}
.bureau-hero p {
max-width: 700px;
margin: 0 auto;
}
/* Bureau Content */
.bureau-container {
max-width: 1200px;
margin: 3rem auto;
padding: 0 5%;
}
.section-title {
text-align: center;
margin-bottom: 3rem;
}
.section-title h2 {
font-size: 2rem;
color: var(--dark-blue);
margin-bottom: 1rem;
}
.section-title p {
color: var(--accent-gray);
}
/* Current Bureau */
.current-bureau {
background: var(--white);
border-radius: 10px;
padding: 2rem;
box-shadow: var(--shadow);
margin-bottom: 3rem;
}
.members-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 2rem;
margin-top: 2rem;
}
.member-card {
text-align: center;
transition: transform 0.3s;
}
.member-card:hover {
transform: translateY(-5px);
}
.member-avatar {
width: 150px;
height: 150px;
border-radius: 50%;
overflow: hidden;
margin: 0 auto 1rem;
border: 3px solid var(--light-blue);
}
.member-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.member-info h3 {
color: var(--dark-blue);
margin-bottom: 0.5rem;
}
.member-position {
color: var(--primary-blue);
font-weight: 600;
margin-bottom: 0.5rem;
}
.member-promo {
font-size: 0.9rem;
color: var(--accent-gray);
}
/* Bureau History */
.bureau-history {
background: var(--light-blue);
border-radius: 10px;
padding: 2rem;
}
.history-item {
margin-bottom: 2rem;
padding-bottom: 2rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.history-item:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.history-year {
font-size: 1.3rem;
color: var(--dark-blue);
margin-bottom: 1rem;
}
.history-members {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
.history-member {
background: var(--white);
padding: 0.8rem 1.2rem;
border-radius: 50px;
font-size: 0.9rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
/* Responsive Design */
@media (max-width: 768px) {
.bureau-hero {
padding: 6rem 5% 3rem;
}
.bureau-hero h1 {
font-size: 2rem;
}
.members-grid {
grid-template-columns: 1fr 1fr;
}
}
@media (max-width: 480px) {
.members-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<?php include 'header.php'; ?>
<!-- Hero Section -->
<section class="bureau-hero">
<h1>Notre Bureau</h1>
<p>Découvrez les membres qui dirigent notre association et contribuent à son succès.</p>
</section>
<!-- Bureau Content -->
<div class="bureau-container">
<!-- Current Bureau Section -->
<div class="current-bureau">
<div class="section-title">
<h2>Bureau Actuel (<?php echo date('Y'); ?>-<?php echo date('Y')+1; ?>)</h2>
<p>Les membres élus pour représenter la communauté SIGMA Alumni</p>
</div>
<?php if (!empty($current_bureau)): ?>
<div class="members-grid">
<?php foreach ($current_bureau as $member): ?>
<div class="member-card">
<div class="member-avatar">
<?php if (!empty($member['profile_picture'])): ?>
<img src="<?php echo htmlspecialchars($member['profile_picture']); ?>" alt="<?php echo htmlspecialchars($member['full_name']); ?>">
<?php else: ?>
<img src="img/profile_pic.jpeg" alt="Avatar par défaut">
<?php endif; ?>
</div>
<div class="member-info">
<h3><?php echo htmlspecialchars($member['full_name']); ?></h3>
<div class="member-position"><?php echo htmlspecialchars($member['position']); ?></div>
<div class="member-promo">Promotion <?php echo htmlspecialchars($member['promotion_year']); ?></div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p style="text-align: center; padding: 2rem;">Aucun membre du bureau n'est actuellement enregistré.</p>
<?php endif; ?>
</div>
<!-- Bureau History Section -->
<div class="bureau-history">
<div class="section-title">
<h2>Historique des Bureaux</h2>
<p>Retour sur les précédentes équipes qui ont dirigé l'association</p>
</div>
<?php if (!empty($bureau_history)): ?>
<?php foreach ($bureau_history as $history): ?>
<div class="history-item">
<div class="history-year"><?php echo htmlspecialchars($history['year_range']); ?></div>
<div class="history-members">
<?php
$members = explode(',', $history['members']);
foreach ($members as $member):
$member_info = explode('-', $member);
if (count($member_info) >= 2):
?>
<div class="history-member"><?php echo trim($member_info[0]); ?> (<?php echo trim($member_info[1]); ?>)</div>
<?php
endif;
endforeach;
?>
</div>
</div>
<?php endforeach; ?>
<?php else: ?>
<p style="text-align: center; padding: 2rem;">Aucun historique de bureau n'est disponible.</p>
<?php endif; ?>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>