Merge branch 'main' of git.ebene.ovh:ebene/radiantrh

This commit is contained in:
KANE LAZENI 2026-01-03 13:10:46 +00:00
commit d82223219e
2 changed files with 123 additions and 142 deletions

View File

@ -1,145 +1,131 @@
<?php
$codeTypeAvenant = $_SESSION['codeTypeAvenant_C'];
$numeroPolice = $this->nettoyer($_SESSION['numeroPolice_C']);
<?php
$codeTypeAvenant = $_SESSION['codeTypeAvenant_C'];
$numeroPolice = $this->nettoyer($_SESSION['numeroPolice_C']);
// On extrait la liste unique des collèges pour le filtre
$colleges = array_unique(array_column($adherents, 'libelleCollege'));
sort($colleges);
?>
// On extrait la liste unique des collèges pour le filtre
$colleges = array_unique(array_column($adherents, 'libelleCollege'));
sort($colleges);
?>
<style>
/* Pagination style */
.dataTables_paginate { margin-top: 15px; }
.paginate_button { padding: 5px 10px; margin: 0 2px; border: 1px solid #dee2e6; border-radius: 4px; cursor: pointer; }
.paginate_button.current { background: #0d6efd !important; color: white !important; border-color: #0d6efd; }
<style>
/* Pagination style */
.dataTables_paginate { margin-top: 15px; }
.paginate_button { padding: 5px 10px; margin: 0 2px; border: 1px solid #dee2e6; border-radius: 4px; cursor: pointer; }
.paginate_button.current { background: #0d6efd !important; color: white !important; border-color: #0d6efd; }
/* Vos styles existants */
.cursor-pointer { cursor: pointer; transition: all 0.2s; }
.cursor-pointer:hover { background-color: #f8f9fa !important; }
.status-actif { border-left: 4px solid #0dcaf0 !important; }
.status-archive { border-left: 4px solid #ffc107 !important; background-color: #fffdf5; }
.x-small { font-size: 0.72rem; }
.btn-white { background: #fff; }
</style>
/* Vos styles existants */
.cursor-pointer { cursor: pointer; transition: all 0.2s; }
.cursor-pointer:hover { background-color: #f8f9fa !important; }
.status-actif { border-left: 4px solid #0dcaf0 !important; }
.status-archive { border-left: 4px solid #ffc107 !important; background-color: #fffdf5; }
.x-small { font-size: 0.72rem; }
.btn-white { background: #fff; }
</style>
<div id="div_liste_adherent" class="container-fluid py-0 animate__animated animate__fadeIn">
<div id="div_liste_adherent" class="container-fluid py-0 animate__animated animate__fadeIn">
<h1 class="text-primary mb-4"><i class="fas fa-users me-2"></i> <?= _('Gestion des Adhérents') ?></h1>
<h1 class="text-primary mb-4"><i class="fas fa-users me-2"></i> <?= _('Gestion des Adhérents') ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-3">
<h4 class="fw-bold text-secondary mb-0">
<?= _("POLICE") ?> : <span class="badge bg-white text-primary ms-2"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
</h4>
</div>
<div class="card-header d-flex justify-content-between align-items-center py-3">
<h4 class="fw-bold text-secondary mb-0">
<?= _("POLICE") ?> : <span class="badge bg-white text-primary ms-2"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
</h4>
</div>
<div class="row mb-3 g-3 mt-1">
<div class="col-md-4">
<div class="input-group shadow-sm">
<span class="input-group-text bg-white border-end-0 text-muted"><i class="fas fa-search"></i></span>
<input type="text" id="customSearch" class="form-control border-start-0 ps-0" placeholder="<?= _('Recherche globale...') ?>">
</div>
</div>
<div class="col-md-3">
<select class="form-select shadow-sm" id="collegeFilter">
<option value=""><?= _("Tous les collèges") ?></option>
<?php foreach($colleges as $coll): ?>
<option value="<?= $this->nettoyer($coll) ?>"><?= $this->nettoyer($coll) ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-3">
<select class="form-select shadow-sm" id="statusFilter">
<option value=""><?= _("Tous les statuts") ?></option>
<option value="status-actif">🟢 <?= _("Actifs") ?></option>
<option value="status-archive">🟠 <?= _("Archivés") ?></option>
</select>
</div>
<div class="col-md-2 text-end">
<button class="btn btn-outline-primary shadow-sm w-100" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
<div class="row mb-3 g-3 mt-1">
<div class="col-md-7">
<div class="input-group shadow-sm">
<span class="input-group-text bg-white border-end-0 text-muted"><i class="fas fa-search"></i></span>
<input type="text" id="customSearch" class="form-control border-start-0 ps-0" placeholder="<?= _('Recherche globale...') ?>">
</div>
</div>
<div class="col-md-3">
<select class="form-select shadow-sm" id="collegeFilter">
<option value=""><?= _("Tous les collèges") ?></option>
<?php foreach($colleges as $coll): ?>
<option value="<?= $this->nettoyer($coll) ?>"><?= $this->nettoyer($coll) ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-2 text-end">
<button class="btn btn-outline-primary shadow-sm w-100" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
<div class="table-responsive shadow-sm rounded-3 border bg-white p-3">
<table class="table table-hover align-middle mb-0" id="tableAdherents" style="width:100%; font-size: 0.9rem;">
<thead class="table-light">
<tr>
<th class="text-center"><?= _("N° Adhérent") ?></th>
<th><?= _("Identité") ?></th>
<th class="text-center"><?= _("Collège") ?></th>
<th class="text-center"><?= _("Période") ?></th>
<th class="text-center no-export"><?= _("Actions") ?></th>
<th class="d-none">StatusClass</th> </tr>
</thead>
<tbody>
<?php foreach ($adherents as $adherent):
$idAdh = $adherent['id'];
$noAdh = $this->nettoyer($adherent['numeroAdherent']);
$libelleColl = $this->nettoyer($adherent['libelleCollege']);
$estsupprimable = ($this->nettoyer($adherent['primeArchive']) == "0");
$statusClass = $estsupprimable ? 'status-actif' : 'status-archive';
?>
<tr class="<?= $statusClass ?> cursor-pointer" onclick="selectionner_adherent(<?= $idAdh ?>,'<?= $noAdh ?>');">
<td class="text-center">
<span class="badge bg-light text-dark border fw-bold"><?= $noAdh ?></span>
</td>
<td>
<div class="fw-bold text-dark text-uppercase"><?= $this->nettoyer($adherent['nom']) ?></div>
<div class="small text-muted"><?= $this->nettoyer($adherent['prenoms']) ?></div>
</td>
<td class="text-center">
<span class="badge bg-primary-subtle text-primary mb-1"><?= $this->nettoyer($adherent['codeProduit']) ?></span>
<div class="x-small text-muted"><?= $libelleColl ?></div>
</td>
<td class="text-center">
<div class="small">
<span class="text-success fw-bold"><?= dateLang($this->nettoyer($adherent['dateEntree'])) ?></span>
<i class="fas fa-arrow-right mx-1 text-muted"></i>
<span class="text-danger fw-bold"><?= $adherent['dateSortie'] ? dateLang($this->nettoyer($adherent['dateSortie'])) : '--' ?></span>
</div>
</td>
<td class="text-center">
<button class="btn btn-sm btn-white border shadow-sm" onclick="afficher_adherent_id();">
<i class="fas fa-user-edit text-primary"></i>
</button>
</td>
<td class="d-none"><?= $statusClass ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<div class="table-responsive shadow-sm rounded-3 border bg-white p-3">
<table class="table table-hover align-middle mb-0" id="tableAdherents" style="width:100%; font-size: 0.9rem;">
<thead class="table-light">
<tr>
<th class="text-center"><?= _("N° Adhérent") ?></th>
<th><?= _("Identité") ?></th>
<th class="text-center"><?= _("Collège") ?></th>
<th class="text-center"><?= _("Période") ?></th>
<th class="text-center no-export"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($adherents as $adherent):
$idAdh = $adherent['id'];
$noAdh = $this->nettoyer($adherent['numeroAdherent']);
$libelleColl = $this->nettoyer($adherent['libelleCollege']);
$estsupprimable = ($this->nettoyer($adherent['primeArchive']) == "0");
$statusClass = $estsupprimable ? 'status-actif' : 'status-archive';
?>
<tr class="<?= $statusClass ?> cursor-pointer" onclick="selectionner_adherent(<?= $idAdh ?>,'<?= $noAdh ?>');">
<td class="text-center">
<span class="badge bg-light text-dark border fw-bold"><?= $noAdh ?></span>
</td>
<td>
<div class="fw-bold text-dark text-uppercase"><?= $this->nettoyer($adherent['nom']) ?></div>
<div class="small text-muted"><?= $this->nettoyer($adherent['prenoms']) ?></div>
</td>
<td class="text-center">
<span class="badge bg-primary-subtle text-primary mb-1"><?= $this->nettoyer($adherent['codeProduit']) ?></span>
<div class="x-small text-muted"><?= $libelleColl ?></div>
</td>
<td class="text-center">
<div class="small">
<span class="text-success fw-bold"><?= dateLang($this->nettoyer($adherent['dateEntree'])) ?></span>
<i class="fas fa-arrow-right mx-1 text-muted"></i>
<span class="text-danger fw-bold"><?= $adherent['dateSortie'] ? dateLang($this->nettoyer($adherent['dateSortie'])) : '--' ?></span>
</div>
</td>
<td class="text-center">
<button class="btn btn-sm btn-white border shadow-sm" onclick="afficher_adherent_id();">
<i class="fas fa-user-edit text-primary"></i>
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<script>
$(document).ready(function() {
// Initialisation de DataTable
var table = $('#tableAdherents').DataTable({
"pageLength": 10,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json"
},
"dom": 'rtp', // 'rtp' cache la barre de recherche par défaut pour utiliser la nôtre
"columnDefs": [
{ "orderable": false, "targets": [4] } // Désactive le tri sur la colonne Actions
]
});
<script>
$(document).ready(function() {
// Initialisation de DataTable
var table = $('#tableAdherents').DataTable({
"pageLength": 10,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json"
},
"dom": 'rtp', // 'rtp' cache la barre de recherche par défaut pour utiliser la nôtre
"columnDefs": [
{ "orderable": false, "targets": [4] } // Désactive le tri sur la colonne Actions
]
});
// Recherche personnalisée
$('#customSearch').on('keyup', function() {
table.search(this.value).draw();
});
// Filtre par Collège (Colonne 2 - index base 0)
$('#collegeFilter').on('change', function() {
table.column(2).search(this.value).draw();
});
// Filtre par Statut (Colonne 5 - cachée)
$('#statusFilter').on('change', function() {
table.column(5).search(this.value).draw();
});
});
</script>
// Recherche personnalisée
$('#customSearch').on('keyup', function() {
table.search(this.value).draw();
});
// Filtre par Collège (Colonne 2 - index base 0)
$('#collegeFilter').on('change', function() {
table.column(2).search(this.value).draw();
});
});
</script>

View File

@ -12,14 +12,9 @@
<h4 class="fw-bold text-secondary mb-0">
<?= _("POLICE") ?> : <span class="badge bg-white text-primary ms-2"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
</h4>
</div>
<div class="card shadow-sm border-0 mb-4 bg-office-primary-lighter text-white">
<div class="card-body d-flex align-items-center justify-content-between p-3">
<button type="button" class="btn btn-light btn-sm fw-bold shadow-sm w-100" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt me-2 text-primary"></i> <?= _("Actualiser la liste") ?>
</button>
</div>
<button type="button" class="btn btn-light btn-sm fw-bold shadow-sm" onclick="javascript:afficher_adherents_police();">
<i class="fas fa-sync-alt me-2 text-primary"></i> <?= _("Actualiser la liste") ?>
</button>
</div>
<input type="hidden" id="prestationPossible" name="prestationPossible" value="<?= $prestationPossible ?>">