mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
admin/index.php showed "TFE total / Publiés / En attente" by running array_filter() over the already-filtered $theses array returned by getThesesList(). When any search or year filter was active the three numbers reflected only the matching subset, making the stats misleading (e.g. searching for a single student would show "1 total, 0 publiés"). Add Database::getThesesStats(): array — a single SQL aggregation query: SELECT COUNT(*), SUM(is_published), SUM(NOT is_published) FROM theses This runs against the raw theses table with no filters, so the counters always display the true whole-database figures regardless of what filter the admin has active. admin/index.php now calls getThesesStats() and reads $stats['total'], $stats['published'], $stats['pending'] instead of the array_filter expressions.
11 KiB
11 KiB