fxEscape($strToken) . "'
LIMIT 1
";
$tabToken = $objDatabase->fxGetRow($sql);
if (!$tabToken) {
return '
TOKEN INVALIDE
';
}
/*
============================================
PANIER
============================================
*/
$sqlPanier = "
SELECT no_panier
FROM inscriptions_panier_acheteurs
WHERE ach_id = " . intval($tabToken['ach_id']) . "
LIMIT 1
";
$tabAcheteurQr = $objDatabase->fxGetRow($sqlPanier);
if (!$tabAcheteurQr) {
return 'PANIER INTROUVABLE
';
}
$tabPanier = fxListPanier($tabAcheteurQr['no_panier']);
if (!$tabPanier) {
return 'PANIER INTROUVABLE
';
}
$tabParticipants = $tabPanier[4];
$tabQuestions = $tabPanier[5];
/*
============================================
RECHERCHE PARTICIPANT
============================================
*/
$tabParticipantTrouve = null;
foreach ($tabParticipants as $intEpreuve => $tabListeParticipants) {
if (!is_array($tabListeParticipants)) {
continue;
}
foreach ($tabListeParticipants as $tabParticipant) {
if (
intval($tabParticipant['pec_id']) === intval($tabToken['pec_id_original'])
) {
$tabParticipantTrouve = $tabParticipant;
break 2;
}
}
}
if (!$tabParticipantTrouve) {
return 'PARTICIPANT INTROUVABLE
';
}
/*
============================================
HTML
============================================
*/
$strRetour = '';
if ($tabParticipantTrouve['rol_nom_' . $strLangue] != '') {
$strRetour .= '
' .
fxUnescape($tabParticipantTrouve['rol_nom_' . $strLangue]) .
':
';
}
$strRetour .=
fxUnescape($tabParticipantTrouve['par_nom']) .
', ' .
fxUnescape($tabParticipantTrouve['par_prenom']);
if ($tabParticipantTrouve['par_courriel'] != '') {
$strRetour .= '
(' .
fxUnescape($tabParticipantTrouve['par_courriel']) .
')
';
}
$strSexe = fxGetGender(
$tabParticipantTrouve['par_sexe'],
$strLangue
);
if (
$tabParticipantTrouve['par_naissance'] != '' &&
$tabParticipantTrouve['par_naissance'] != '0000-00-00'
) {
$strRetour .= '
Date de naissance:
' .
fxShowDate(
$tabParticipantTrouve['par_naissance'],
$strLangue
) .
' - ' .
$strSexe;
}
/*
============================================
QUESTIONS
============================================
*/
$intParId = $tabParticipantTrouve['par_id'];
if (isset($tabQuestions[$intParId])) {
foreach ($tabQuestions[$intParId] as $tabQuestion) {
if (
$tabQuestion['que_cart_show'] == 1 &&
trim($tabQuestion['que_choix_' . $strLangue]) != ''
) {
$strRetour .= '
' .
fxUnescape(
$tabQuestion['que_cart_label_' . $strLangue]
) .
': ' .
fxUnescape(
$tabQuestion['que_choix_' . $strLangue]
);
}
}
}
/*
============================================
DEBUG PARTICIPANT
============================================
*/
$strRetour .= '
';
$strRetour .= htmlspecialchars(
print_r($tabParticipantTrouve, true)
);
$strRetour .= '';
return $strRetour;
}
/*
=====================================================
AJAX DEBUG QR
=====================================================
*/
if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
header('Content-Type: application/json');
if (empty($_GET['t'])) {
echo json_encode([
'status' => 'error',
'message' => 'TOKEN MANQUANT'
]);
exit;
}
$strToken = $_GET['t'];
$sql = "
SELECT
id,
com_id,
pec_id,
pec_id_original,
ach_id,
status
FROM qr_tokens
WHERE qr_public_id = '" . $objDatabase->fxEscape($strToken) . "'
LIMIT 1
";
$tabQr = $objDatabase->fxGetRow($sql);
if (!$tabQr) {
echo json_encode([
'status' => 'error',
'message' => 'TOKEN INVALIDE'
]);
exit;
}
echo json_encode([
'status' => 'ok',
'data' => $tabQr,
'html' => fxShowQrParticipantDebug($strToken, 'fr')
]);
exit;
}
?>
QR TEST
QR TEST
Aucun QR détecté