ajouts stats
This commit is contained in:
parent
683b160804
commit
b95ed600e9
@ -85,6 +85,12 @@ function collectFilters() {
|
||||
filters.annee = parseInt(anneeInput.value, 10);
|
||||
}
|
||||
|
||||
// Statut
|
||||
const statutSelect = document.getElementById('stats_statut');
|
||||
if (statutSelect && statutSelect.value) {
|
||||
filters.statut = statutSelect.value;
|
||||
}
|
||||
|
||||
// Filtre permanence
|
||||
const permanenceCheckbox = document.getElementById('stats_filtre_permanence');
|
||||
if (permanenceCheckbox && permanenceCheckbox.checked) {
|
||||
@ -160,7 +166,8 @@ async function loadEvents() {
|
||||
|
||||
// Afficher les résultats
|
||||
displayEvents(result.events || []);
|
||||
updateCounters(result.total || 0, result.filtered || 0);
|
||||
// Afficher le nombre d'événements filtrés comme total, et le nombre d'événements sur la page courante comme affichés
|
||||
updateCounters(result.filtered || 0, (result.events || []).length);
|
||||
displayPagination(result.page || 1, result.total_pages || 0);
|
||||
|
||||
// IMPORTANT: Masquer le loader EN PREMIER, puis afficher le tableau
|
||||
|
||||
@ -81,11 +81,16 @@
|
||||
<label for="stats_annee" style="display: block; margin-bottom: 5px; font-weight: 500;"><?php esc_html_e('Année', 'esi_crvi_agenda'); ?></label>
|
||||
<input type="number" id="stats_annee" name="annee" min="2000" max="2100" placeholder="<?php echo date('Y'); ?>" class="form-control" style="width: 100%;">
|
||||
</div>
|
||||
<div class="filter" style="display: flex; flex-direction: column; gap: 10px;">
|
||||
<label for="stats_filtre_permanence" style="display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 25px;">
|
||||
<input type="checkbox" id="stats_filtre_permanence" name="filtre_permanence" value="permanence">
|
||||
<span><?php esc_html_e('Afficher uniquement les permanences', 'esi_crvi_agenda'); ?></span>
|
||||
</label>
|
||||
<div class="filter">
|
||||
<label for="stats_statut" style="display: block; margin-bottom: 5px; font-weight: 500;"><?php esc_html_e('Statut', 'esi_crvi_agenda'); ?></label>
|
||||
<select id="stats_statut" name="statut" class="select2 form-control" style="width: 100%;">
|
||||
<option value=""><?php esc_html_e('Tous', 'esi_crvi_agenda'); ?></option>
|
||||
<option value="prevu"><?php esc_html_e('Prévu', 'esi_crvi_agenda'); ?></option>
|
||||
<option value="cloture"><?php esc_html_e('Clôturé', 'esi_crvi_agenda'); ?></option>
|
||||
<option value="absence"><?php esc_html_e('Absence', 'esi_crvi_agenda'); ?></option>
|
||||
<option value="annule"><?php esc_html_e('Annulé', 'esi_crvi_agenda'); ?></option>
|
||||
<option value="non_tenu"><?php esc_html_e('Non tenu', 'esi_crvi_agenda'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter" style="display: flex; gap: 10px; justify-content: flex-end; align-items: end;">
|
||||
<button type="button" id="stats_filterBtn" class="btn btn-primary" style="min-width: 100px;">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user