Spaces:
Running

File size: 35,975 Bytes
f6ac7c4
 
 
 
 
ddd23d0
f6ac7c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ddd23d0
 
f6ac7c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ddd23d0
f6ac7c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ddd23d0
f6ac7c4
 
ddd23d0
f6ac7c4
 
ddd23d0
f6ac7c4
 
ddd23d0
f6ac7c4
 
 
 
 
 
 
 
 
ddd23d0
f6ac7c4
ddd23d0
 
 
 
 
f6ac7c4
 
ddd23d0
f6ac7c4
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
ddd23d0
 
f6ac7c4
 
ddd23d0
 
f6ac7c4
 
 
 
 
 
 
 
 
ddd23d0
f6ac7c4
ddd23d0
 
 
 
f6ac7c4
 
 
 
 
 
 
 
 
 
 
 
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
f6ac7c4
ddd23d0
 
 
 
 
 
 
 
f6ac7c4
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
ddd23d0
 
 
 
f6ac7c4
ddd23d0
f6ac7c4
ddd23d0
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
 
 
 
 
f6ac7c4
 
 
ddd23d0
 
 
 
 
 
 
 
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
 
f6ac7c4
 
ddd23d0
 
 
 
f6ac7c4
ddd23d0
 
 
 
 
 
 
f6ac7c4
ddd23d0
f6ac7c4
 
ddd23d0
 
 
 
f6ac7c4
ddd23d0
 
 
 
 
 
 
 
f6ac7c4
 
 
 
 
 
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Membres - Église Semence AMour</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4F6F52;
            --secondary: #739072;
            --accent: #ECE3CE;
        }
        
        .sidebar {
            min-height: 100vh;
            background-color: var(--primary);
        }
        
        .sidebar-link:hover {
            background-color: var(--secondary);
        }
        
        .btn-primary {
            background-color: var(--primary);
        }
        
        .btn-primary:hover {
            background-color: var(--secondary);
        }
        
        .member-photo-preview {
            max-height: 150px;
            object-fit: cover;
        }

        .submenu {
            display: none;
            background-color: rgba(0,0,0,0.1);
        }

        .submenu.show {
            display: block;
        }

        .submenu-link {
            padding-left: 2.5rem;
            font-size: 0.9rem;
        }

        .menu-toggle {
            transition: transform 0.3s ease;
        }

        .menu-toggle.rotated {
            transform: rotate(90deg);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .tab-button.active {
            background-color: var(--accent);
            color: var(--primary);
            font-weight: 600;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="flex">
        <!-- Sidebar -->
        <div class="sidebar w-64 text-white fixed h-full">
            <div class="p-4 border-b border-green-700">
                <div class="flex items-center">
                    <i class="fas fa-church text-2xl mr-2"></i>
                    <span class="text-xl font-semibold">Semence AMour</span>
                </div>
                <p class="text-sm text-green-200 mt-1">Administration</p>
            </div>
            
            <nav class="mt-4">
                <a href="#" class="sidebar-link block py-2 px-4">
                    <i class="fas fa-tachometer-alt mr-2"></i> Tableau de bord
                </a>
                
                <!-- Menu Église avec sous-menus -->
                <div class="church-menu">
                    <div class="sidebar-link flex justify-between items-center py-2 px-4 hover:bg-green-700 cursor-pointer" id="church-menu-toggle">
                        <div>
                            <i class="fas fa-church mr-2"></i> Église
                        </div>
                        <i class="fas fa-chevron-right menu-toggle text-xs"></i>
                    </div>
                    <div class="submenu" id="church-submenu">
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-quote-left mr-2"></i> Mot du pasteur
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-history mr-2"></i> Notre histoire
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-user mr-2"></i> William Branham
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-praying-hands mr-2"></i> Pratiques
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-bible mr-2"></i> Doctrine
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-hands-helping mr-2"></i> Ministères
                        </a>
                        <a href="#" class="sidebar-link submenu-link block py-2 hover:bg-green-700">
                            <i class="fas fa-users-cog mr-2"></i> Offices
                        </a>
                    </div>
                </div>
                
                <a href="#" class="sidebar-link block py-2 px-4">
                    <i class="fas fa-calendar-alt mr-2"></i> Événements
                </a>
                <a href="#" class="sidebar-link block py-2 px-4 bg-green-700">
                    <i class="fas fa-users mr-2"></i> Membres
                </a>
                <a href="#" class="sidebar-link block py-2 px-4">
                    <i class="fas fa-file-alt mr-2"></i> Sermons
                </a>
                <a href="#" class="sidebar-link block py-2 px-4">
                    <i class="fas fa-cog mr-2"></i> Paramètres
                </a>
            </nav>
        </div>
        
        <!-- Main Content -->
        <div class="ml-64 flex-1 p-8">
            <div class="flex justify-between items-center mb-8">
                <h1 class="text-2xl font-bold text-gray-800">
                    <i class="fas fa-user-plus mr-2 text-green-700"></i> Ajouter un Membre
                </h1>
                <div>
                    <a href="liste-membres.html" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
                        <i class="fas fa-list mr-1"></i> Voir la liste
                    </a>
                </div>
            </div>
            
            <!-- Member Form -->
            <div class="bg-white rounded-lg shadow overflow-hidden">
                <div class="border-b border-gray-200">
                    <div class="flex">
                        <button class="tab-button active px-6 py-4 text-sm font-medium" data-tab="info-personnelles">
                            Informations Personnelles
                        </button>
                        <button class="tab-button px-6 py-4 text-sm font-medium" data-tab="info-spirituelles">
                            Informations Spirituelles
                        </button>
                        <button class="tab-button px-6 py-4 text-sm font-medium" data-tab="info-familiales">
                            Informations Familiales
                        </button>
                    </div>
                </div>
                
                <form id="member-form" class="p-6 space-y-6">
                    <!-- Informations Personnelles Tab -->
                    <div id="info-personnelles" class="tab-content active">
                        <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                            <!-- Photo -->
                            <div class="col-span-1">
                                <label class="block text-sm font-medium text-gray-700 mb-2">Photo</label>
                                <div class="mt-1 flex items-center">
                                    <div class="relative">
                                        <img id="photo-preview" class="member-photo-preview w-32 h-32 rounded-full bg-gray-200 object-cover" src="https://via.placeholder.com/150" alt="Photo du membre">
                                        <label for="member-photo" class="absolute bottom-0 right-0 bg-white rounded-full p-2 shadow-md cursor-pointer">
                                            <i class="fas fa-camera text-green-700"></i>
                                            <input type="file" id="member-photo" accept="image/*" class="sr-only">
                                        </label>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- Détails Personnels -->
                            <div class="col-span-2 space-y-4">
                                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                    <div>
                                        <label for="first-name" class="block text-sm font-medium text-gray-700">Prénom *</label>
                                        <input type="text" id="first-name" required class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    </div>
                                    <div>
                                        <label for="last-name" class="block text-sm font-medium text-gray-700">Nom *</label>
                                        <input type="text" id="last-name" required class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    </div>
                                </div>
                                
                                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                    <div>
                                        <label for="gender" class="block text-sm font-medium text-gray-700">Genre *</label>
                                        <select id="gender" required class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                            <option value="">Sélectionner</option>
                                            <option value="male">Homme</option>
                                            <option value="female">Femme</option>
                                        </select>
                                    </div>
                                    <div>
                                        <label for="birth-date" class="block text-sm font-medium text-gray-700">Date de naissance</label>
                                        <input type="date" id="birth-date" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    </div>
                                </div>
                                
                                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                    <div>
                                        <label for="phone" class="block text-sm font-medium text-gray-700">Téléphone</label>
                                        <input type="tel" id="phone" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    </div>
                                    <div>
                                        <label for="email" class="block text-sm font-medium text-gray-700">Email</label>
                                        <input type="email" id="email" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-6 grid grid-cols-1 md:grid-cols-3 gap-4">
                            <div>
                                <label for="address" class="block text-sm font-medium text-gray-700">Adresse</label>
                                <input type="text" id="address" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            <div>
                                <label for="city" class="block text-sm font-medium text-gray-700">Ville</label>
                                <input type="text" id="city" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            <div>
                                <label for="postal-code" class="block text-sm font-medium text-gray-700">Code Postal</label>
                                <input type="text" id="postal-code" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                        </div>
                        
                        <div class="mt-6">
                            <label for="profession" class="block text-sm font-medium text-gray-700">Profession</label>
                            <input type="text" id="profession" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                        </div>
                    </div>
                    
                    <!-- Informations Spirituelles Tab -->
                    <div id="info-spirituelles" class="tab-content">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="baptism-date" class="block text-sm font-medium text-gray-700">Date de baptême</label>
                                <input type="date" id="baptism-date" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            <div>
                                <label for="baptism-place" class="block text-sm font-medium text-gray-700">Lieu de baptême</label>
                                <input type="text" id="baptism-place" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                        </div>
                        
                        <div class="mt-6 grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="membership-date" class="block text-sm font-medium text-gray-700">Date d'adhésion</label>
                                <input type="date" id="membership-date" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                            <div>
                                <label for="membership-status" class="block text-sm font-medium text-gray-700">Statut d'adhésion</label>
                                <select id="membership-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    <option value="visitor">Visiteur</option>
                                    <option value="member">Membre</option>
                                    <option value="active-member">Membre actif</option>
                                    <option value="inactive-member">Membre inactif</option>
                                </select>
                            </div>
                        </div>
                        
                        <div class="mt-6">
                            <label for="spiritual-gifts" class="block text-sm font-medium text-gray-700">Dons spirituels</label>
                            <div class="mt-2 grid grid-cols-2 md:grid-cols-4 gap-2">
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-teaching" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-teaching" class="ml-2 block text-sm text-gray-700">Enseignement</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-prophecy" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-prophecy" class="ml-2 block text-sm text-gray-700">Prophétie</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-healing" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-healing" class="ml-2 block text-sm text-gray-700">Guérison</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-miracles" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-miracles" class="ml-2 block text-sm text-gray-700">Miracles</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-helping" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-helping" class="ml-2 block text-sm text-gray-700">Service</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-leadership" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-leadership" class="ml-2 block text-sm text-gray-700">Leadership</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-mercy" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-mercy" class="ml-2 block text-sm text-gray-700">Miséricorde</label>
                                </div>
                                <div class="flex items-center">
                                    <input type="checkbox" id="gift-giving" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
                                    <label for="gift-giving" class="ml-2 block text-sm text-gray-700">Générosité</label>
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-6">
                            <label for="ministries" class="block text-sm font-medium text-gray-700">Ministères impliqués</label>
                            <select id="ministries" multiple class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                <option value="worship">Louange</option>
                                <option value="prayer">Intercession</option>
                                <option value="evangelism">Évangélisation</option>
                                <option value="teaching">Enseignement</option>
                                <option value="youth">Jeunesse</option>
                                <option value="children">Enfants</option>
                                <option value="social">Action sociale</option>
                                <option value="media">Médias</option>
                            </select>
                        </div>
                        
                        <div class="mt-6">
                            <label for="spiritual-notes" class="block text-sm font-medium text-gray-700">Notes spirituelles</label>
                            <textarea id="spiritual-notes" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500"></textarea>
                        </div>
                    </div>
                    
                    <!-- Informations Familiales Tab -->
                    <div id="info-familiales" class="tab-content">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="marital-status" class="block text-sm font-medium text-gray-700">Situation familiale</label>
                                <select id="marital-status" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                                    <option value="single">Célibataire</option>
                                    <option value="married">Marié(e)</option>
                                    <option value="divorced">Divorcé(e)</option>
                                    <option value="widowed">Veuf/Veuve</option>
                                    <option value="separated">Séparé(e)</option>
                                </select>
                            </div>
                            <div id="spouse-container" class="hidden">
                                <label for="spouse-name" class="block text-sm font-medium text-gray-700">Nom du conjoint</label>
                                <input type="text" id="spouse-name" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            </div>
                        </div>
                        
                        <div class="mt-6">
                            <label class="block text-sm font-medium text-gray-700">Enfants</label>
                            <div id="children-container" class="mt-2 space-y-4">
                                <!-- Children will be added here dynamically -->
                            </div>
                            <button type="button" id="add-child-btn" class="mt-2 inline-flex items-center px-3 py-1 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
                                <i class="fas fa-plus mr-1"></i> Ajouter un enfant
                            </button>
                        </div>
                        
                        <div class="mt-6">
                            <label for="family-notes" class="block text-sm font-medium text-gray-700">Notes familiales</label>
                            <textarea id="family-notes" rows="3" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500"></textarea>
                        </div>
                    </div>
                    
                    <div class="pt-6 border-t border-gray-200 flex justify-end space-x-3">
                        <button type="button" id="cancel-member" class="px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
                            Annuler
                        </button>
                        <button type="submit" id="save-member" class="btn-primary px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-700 hover:bg-green-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">
                            Enregistrer le membre
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script>
        // Initialize the app
        document.addEventListener('DOMContentLoaded', function() {
            setupMenuToggle();
            setupTabs();
            setupForm();
            setupPhotoUpload();
        });
        
        // Setup menu toggle functionality
        function setupMenuToggle() {
            const menuToggle = document.getElementById('church-menu-toggle');
            const submenu = document.getElementById('church-submenu');
            const chevron = menuToggle.querySelector('.menu-toggle');
            
            menuToggle.addEventListener('click', () => {
                submenu.classList.toggle('show');
                chevron.classList.toggle('rotated');
            });
        }
        
        // Setup tab functionality
        function setupTabs() {
            const tabButtons = document.querySelectorAll('.tab-button');
            const tabContents = document.querySelectorAll('.tab-content');
            
            tabButtons.forEach(button => {
                button.addEventListener('click', () => {
                    // Remove active class from all buttons and contents
                    tabButtons.forEach(btn => btn.classList.remove('active'));
                    tabContents.forEach(content => content.classList.remove('active'));
                    
                    // Add active class to clicked button and corresponding content
                    button.classList.add('active');
                    const tabId = button.getAttribute('data-tab');
                    document.getElementById(tabId).classList.add('active');
                });
            });
        }
        
        // Setup form functionality
        function setupForm() {
            const maritalStatus = document.getElementById('marital-status');
            const spouseContainer = document.getElementById('spouse-container');
            
            // Show/hide spouse field based on marital status
            maritalStatus.addEventListener('change', function() {
                if (this.value === 'married') {
                    spouseContainer.classList.remove('hidden');
                } else {
                    spouseContainer.classList.add('hidden');
                }
            });
            
            // Add child functionality
            const addChildBtn = document.getElementById('add-child-btn');
            const childrenContainer = document.getElementById('children-container');
            let childCount = 0;
            
            addChildBtn.addEventListener('click', function() {
                childCount++;
                const childDiv = document.createElement('div');
                childDiv.className = 'grid grid-cols-1 md:grid-cols-3 gap-4 items-end';
                childDiv.innerHTML = `
                    <div>
                        <label for="child-name-${childCount}" class="block text-sm font-medium text-gray-700">Nom complet</label>
                        <input type="text" id="child-name-${childCount}" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                    </div>
                    <div>
                        <label for="child-gender-${childCount}" class="block text-sm font-medium text-gray-700">Genre</label>
                        <select id="child-gender-${childCount}" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                            <option value="male">Garçon</option>
                            <option value="female">Fille</option>
                        </select>
                    </div>
                    <div class="flex items-end space-x-2">
                        <div class="flex-1">
                            <label for="child-birthdate-${childCount}" class="block text-sm font-medium text-gray-700">Date de naissance</label>
                            <input type="date" id="child-birthdate-${childCount}" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-green-500 focus:border-green-500">
                        </div>
                        <button type="button" class="delete-child mb-1 px-2 py-1 text-red-600 hover:text-red-800">
                            <i class="fas fa-times"></i>
                        </button>
                    </div>
                `;
                childrenContainer.appendChild(childDiv);
                
                // Add event listener to delete button
                const deleteBtn = childDiv.querySelector('.delete-child');
                deleteBtn.addEventListener('click', function() {
                    childrenContainer.removeChild(childDiv);
                });
            });
            
            // Form submission
            const memberForm = document.getElementById('member-form');
            memberForm.addEventListener('submit', function(e) {
                e.preventDefault();
                
                // Gather form data
                const memberData = {
                    personalInfo: {
                        firstName: document.getElementById('first-name').value,
                        lastName: document.getElementById('last-name').value,
                        gender: document.getElementById('gender').value,
                        birthDate: document.getElementById('birth-date').value,
                        phone: document.getElementById('phone').value,
                        email: document.getElementById('email').value,
                        address: document.getElementById('address').value,
                        city: document.getElementById('city').value,
                        postalCode: document.getElementById('postal-code').value,
                        profession: document.getElementById('profession').value,
                        photo: document.getElementById('photo-preview').src
                    },
                    spiritualInfo: {
                        baptismDate: document.getElementById('baptism-date').value,
                        baptismPlace: document.getElementById('baptism-place').value,
                        membershipDate: document.getElementById('membership-date').value,
                        membershipStatus: document.getElementById('membership-status').value,
                        spiritualGifts: getSelectedGifts(),
                        ministries: getSelectedMinistries(),
                        spiritualNotes: document.getElementById('spiritual-notes').value
                    },
                    familyInfo: {
                        maritalStatus: document.getElementById('marital-status').value,
                        spouseName: document.getElementById('marital-status').value === 'married' ? document.getElementById('spouse-name').value : '',
                        children: getChildrenData(),
                        familyNotes: document.getElementById('family-notes').value
                    }
                };
                
                // In a real app, you would save to a database here
                console.log('Member data to be saved:', memberData);
                
                // Show success message
                alert('Membre enregistré avec succès!');
                
                // Reset form
                memberForm.reset();
                document.getElementById('photo-preview').src = 'https://via.placeholder.com/150';
                childrenContainer.innerHTML = '';
                childCount = 0;
            });
            
            // Cancel button
            document.getElementById('cancel-member').addEventListener('click', function() {
                if (confirm('Voulez-vous vraiment annuler ? Toutes les modifications seront perdues.')) {
                    memberForm.reset();
                    document.getElementById('photo-preview').src = 'https://via.placeholder.com/150';
                    childrenContainer.innerHTML = '';
                    childCount = 0;
                }
            });
        }
        
        // Get selected spiritual gifts
        function getSelectedGifts() {
            const gifts = [];
            if (document.getElementById('gift-teaching').checked) gifts.push('teaching');
            if (document.getElementById('gift-prophecy').checked) gifts.push('prophecy');
            if (document.getElementById('gift-healing').checked) gifts.push('healing');
            if (document.getElementById('gift-miracles').checked) gifts.push('miracles');
            if (document.getElementById('gift-helping').checked) gifts.push('helping');
            if (document.getElementById('gift-leadership').checked) gifts.push('leadership');
            if (document.getElementById('gift-mercy').checked) gifts.push('mercy');
            if (document.getElementById('gift-giving').checked) gifts.push('giving');
            return gifts;
        }
        
        // Get selected ministries
        function getSelectedMinistries() {
            const select = document.getElementById('ministries');
            const selectedOptions = Array.from(select.selectedOptions).map(option => option.value);
            return selectedOptions;
        }
        
        // Get children data
        function getChildrenData() {
            const children = [];
            const childDivs = document.querySelectorAll('#children-container > div');
            
            childDivs.forEach((div, index) => {
                children.push({
                    name: document.getElementById(`child-name-${index+1}`).value,
                    gender: document.getElementById(`child-gender-${index+1}`).value,
                    birthDate: document.getElementById(`child-birthdate-${index+1}`).value
                });
            });
            
            return children;
        }
        
        // Setup photo upload functionality
        function setupPhotoUpload() {
            const photoInput = document.getElementById('member-photo');
            const photoPreview = document.getElementById('photo-preview');
            
            photoInput.addEventListener('change', function(e) {
                const file = e.target.files[0];
                if (file) {
                    const reader = new FileReader();
                    reader.onload = function(event) {
                        photoPreview.src = event.target.result;
                    };
                    reader.readAsDataURL(file);
                }
            });
        }
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=nestasoft/admin-v3" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>