Files
Cleo/models/musers.php
Pierre 99021b4f42 Initial commit: CLEO ERP avec améliorations debug
- Configuration du debug conditionnel pour dev/recette
- Fonction debug() globale avec niveaux
- Logging des requêtes SQL
- Handlers d'exceptions et d'erreurs globaux

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 10:24:52 +02:00

13 lines
806 B
PHP

<?php
$sql = 'SELECT u.*, xrol.libelle AS lib_role, xreg.libelle AS lib_region FROM users u LEFT JOIN x_roles xrol on u.fk_role = xrol.rowid LEFT JOIN x_regions xreg on u.fk_region = xreg.rowid ORDER BY u.libelle, u.prenom;';
$aModel["users"] = getinfos($sql, "gen");
$sql = 'SELECT rowid, libelle, abreviation FROM x_roles WHERE active=1 ORDER BY libelle;';
$aModel["roles"] = getinfos($sql, "gen");
$sql = 'SELECT rowid, libelle FROM x_regions WHERE active=1 ORDER BY libelle;';
$aModel["regions"] = getinfos($sql, "gen");
$sql = 'SELECT u.rowid, CONCAT(u.prenom, " ", u.libelle, " (", xrol.abreviation, ")") AS lib_parent FROM users u LEFT JOIN x_roles xrol on u.fk_role = xrol.rowid WHERE u.fk_role IN (1,2) ORDER BY lib_parent;';
$aModel["parents"] = getinfos($sql, "gen");