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>
This commit is contained in:
2025-07-04 10:24:52 +02:00
commit 99021b4f42
7348 changed files with 11423897 additions and 0 deletions

12
models/musers.php Normal file
View File

@@ -0,0 +1,12 @@
<?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");