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