diff --git a/php/inc_fx_import_resultats.php b/php/inc_fx_import_resultats.php
index b60178d..373d8b2 100644
--- a/php/inc_fx_import_resultats.php
+++ b/php/inc_fx_import_resultats.php
@@ -1335,9 +1335,11 @@ function fxImportResultatsResetPreview($intEveId) {
return array('state' => 'error', 'message' => 'eve_id manquant');
}
+ $strOrig = fxImportResultatsDbEsc(MSIN_IMPORT_RESULTATS_ORIGIN);
+
$sqlPar = "SELECT COUNT(*) AS n FROM resultats_participants"
. " WHERE eve_id = " . $intEveId
- . " AND par_origine = '" . fxImportResultatsDbEsc(MSIN_IMPORT_RESULTATS_ORIGIN) . "'";
+ . " AND par_origine = '" . $strOrig . "'";
$tabPar = $objDatabase->fxGetResults($sqlPar);
$intPar = is_array($tabPar) ? intval($tabPar[1]['n'] ?? 0) : 0;
@@ -1346,24 +1348,38 @@ function fxImportResultatsResetPreview($intEveId) {
. " INNER JOIN resultats_participants p ON p.eve_id = e.eve_id"
. " AND (p.pec_id = e.pec_id OR p.pec_id = e.pec_id_original)"
. " WHERE e.eve_id = " . $intEveId
- . " AND p.par_origine = '" . fxImportResultatsDbEsc(MSIN_IMPORT_RESULTATS_ORIGIN) . "'";
+ . " AND p.par_origine = '" . $strOrig . "'";
$tabPec = $objDatabase->fxGetResults($sqlPec);
$intPec = is_array($tabPec) ? intval($tabPec[1]['n'] ?? 0) : 0;
$sqlQue = "SELECT COUNT(*) AS n FROM resultats_questions rq"
. " INNER JOIN resultats_participants p ON (rq.par_id = p.par_id_original OR rq.par_id = p.par_id)"
. " WHERE p.eve_id = " . $intEveId
- . " AND p.par_origine = '" . fxImportResultatsDbEsc(MSIN_IMPORT_RESULTATS_ORIGIN) . "'";
+ . " AND p.par_origine = '" . $strOrig . "'";
$tabQue = $objDatabase->fxGetResults($sqlQue);
$intQue = is_array($tabQue) ? intval($tabQue[1]['n'] ?? 0) : 0;
+ // Diagnostic : ce que la liste inscriptions verrait (même join + pec_actif)
+ $sqlList = "SELECT COUNT(*) AS n"
+ . " FROM resultats_epreuves_commandees e, resultats_participants p"
+ . " WHERE e.eve_id = " . $intEveId
+ . " AND p.pec_id = e.pec_id_original"
+ . " AND p.par_origine = '" . $strOrig . "'"
+ . " AND p.rol_id NOT IN (3, 4)"
+ . " AND e.is_cancelled = 0 AND e.pec_actif = 1";
+ $tabList = $objDatabase->fxGetResults($sqlList);
+ $intList = is_array($tabList) ? intval($tabList[1]['n'] ?? 0) : 0;
+
return array(
'state' => 'ok',
'eve_id' => $intEveId,
'participants' => $intPar,
'pec' => $intPec,
'questions' => $intQue,
- 'message' => $intPar . ' participant(s) import, ' . $intPec . ' pec, ' . $intQue . ' réponse(s) questions.',
+ 'list_visible' => $intList,
+ 'message' => 'En BD : ' . $intPar . ' participant(s) import, '
+ . $intPec . ' pec, ' . $intQue . ' réponse(s) questions'
+ . ' — dont ' . $intList . ' visible(s) dans la liste (pec_actif=1).',
);
}
@@ -1537,10 +1553,31 @@ function fxImportResultatsRenderEventPanel($intEveId) {
Reset = efface seulement par_origine=import_fichier sur cet événement (pas les inscriptions payantes).
+ * Visibles liste ≈ join liste inscriptions avec pec_actif=1 (diagnostic).
+