*'; ?>
maxlength="50" required >
*'; ?>
maxlength="50" required >
*'; ?>
*'; ?>
maxlength="100">
maxlength="100">
*'; ?>
maxlength="50" required>
*'; ?>
*'; ?>
maxlength="7" required>
*'; ?>
*'; ?>
maxlength="12" placeholder="514-555-1212" required>
maxlength="12" placeholder="514-555-1212">
maxlength="100">
maxlength="12" placeholder="514-555-1212">
*'; ?>
maxlength="100" required>
maxlength="100">
*'; } else { $strAsterix = ''; } ?>
maxlength="100" required>
*'; ?>
*'; } else { $strAsterix = ''; } ?>
*'; } else { $strAsterix = ''; } ?>
* Ces cases sont obligatoires.
* These fields are mandatory.
fxGetCaptcha($_POST['g-recaptcha-response']); if ($Retorno->success) { // nouveau id $mem_id = base64_decode(urldecode($tabData['form_id'])); switch ($strAction) { case 'add': // AJOUT $tabData['com_naissance'] = $tabData['com_naissance_year'] . "-" . $tabData['com_naissance_month'] . "-" . $tabData['com_naissance_day']; $tabData['com_password'] = password_hash($tabData['com_password'], PASSWORD_DEFAULT); // faire un hash $tabData['com_actif'] = 1; // activer le compte // former le INSERT $tabFieldsValues = fxListFieldsValues($tabData, 'com_id', 'inscriptions_comptes', $GLOBALS['arrConDatabaseMain']['db']); // verification des champs obligatoire $champsobligatoires = array('b' => "com_prenom", "com_nom", "com_naissance", "com_sexe", "com_adresse", "com_ville", "pro_id", "com_codepostal", "pay_id", "com_telephone1", "com_langue", "com_password", "com_login", "com_courriel"); if (count(array_intersect($tabFieldsValues['pasvide'], $champsobligatoires)) != count($champsobligatoires)) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e101'; else $_SESSION['msg'] = 'e501'; break; } // vérifie si le courrier et login existe $sqlValide = "SELECT COUNT(com_courriel) FROM inscriptions_comptes WHERE (com_login = '" . $tabData['com_login'] . "' OR com_courriel = '" . $tabData['com_courriel'] . "') AND com_actif = 1"; $nbValide = $objDatabase->fxGetVar($sqlValide); if ($nbValide > 0) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e101'; else $_SESSION['msg'] = 'e501'; break; } // insérer les infos du participants $sqlInsert = "INSERT INTO inscriptions_comptes " . $tabFieldsValues['set'] . " ,com_creation = '" . fxGetDateTime() . "', com_ip = '" . $_SERVER['REMOTE_ADDR'] . "'"; $qryInsert = $objDatabase->fxQuery($sqlInsert); // récupérer le id ajouté $intCompte = $objDatabase->fxGetLastId(); // Associer le compte au no panier, si le client à choisit de créer un compe apr ès une commande if (isset($tabData['txt_panier'])) { $sqlUpdate = "UPDATE inscriptions_panier_acheteurs SET com_id = " . intval($intCompte) . " WHERE no_panier = '" . $tabData['txt_panier'] . "'"; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); $sqlUpdate = "UPDATE inscriptions_panier_epreuves_commandees SET com_id = " . intval($intCompte) . " WHERE no_panier = '" . $tabData['txt_panier'] . "'"; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); require_once 'inc_fx_panier.php'; fxMajCopieParticipantAcheteurCompte($tabData['txt_panier'], $intCompte); } // récupérer le code et les infos de l'événement if (isset($_SESSION['eve_label_url'])) { $code = $_SESSION['eve_label_url']; $tabEvenement = fxGetEvenements($code, $strLangue); } if (isset($tabEvenement) && $tabEvenement['general']['eve_checkout_login'] == "1") { // pas toujours $autologin = true; $sqlUpdate = "UPDATE inscriptions_comptes set com_actif = 1 where com_id = " . $intCompte; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); // metre les info login $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_id = " . $intCompte; $infoCompte = $objDatabase->fxGetRow($sqlCourriel); $_SESSION['com_id'] = $infoCompte['com_id']; $_SESSION['com_prenom'] = $infoCompte['com_prenom']; $_SESSION['vadmin_texte'] = false; $_SESSION['com_info'] = $infoCompte; // liste des compte affilie $sqlAffilie = "SELECT * FROM inscriptions_comptes WHERE com_affilie = '" . $_SESSION['com_id'] . "'"; $infoAffilie = $objDatabase->fxGetResults($sqlAffilie); $_SESSION['com_affilie'] = $infoAffilie; // metre dans l'info compte la liste des evenement prive $_SESSION['com_info']['eve_prive'] = explode(',', $infoCompte['com_eve_prive']); header("Location: " . $vDomaine . '/panier/checkout/' . $code); exit; } else { // envoyer un courriel de confirmation if ($strLangue == 'fr') { // FRANCAIS $subject = "Veuillez confirmer votre adresse courriel"; $message = 'Bonjour ' . $tabData['com_prenom'] . ',

Merci d\'avoir créé votre compte sur ' . $vClient . '.
Veuillez cliquer sur le bouton ci-dessous afin de confirmer votre adresse courriel.'; $attachment_url = $vDomaine . '/compte.php?valider&courriel=' . $tabData['com_courriel'] . '&id=' . $intCompte; $attachment_label = "Confirmez ici"; // $datetime = 'Message envoyé automatiquement le: ' . fxShowDate(fxGetDate(), $strLangue) . ' @ ' . fxGetTime(); } else { // ANGLAIS $subject = "Please confirm your email address"; $message = 'Hello ' . $tabData['com_prenom'] . ',

Thank you for creating your account on ' . $vClient . '.
Please click the button below to confirm your email address.'; $attachment_url = $vDomaine . '/compte.php?valider&lang=en&courriel=' . $tabData['com_courriel'] . '&id=' . $intCompte; $attachment_label = "Confirm here"; // $datetime = 'Auto-message sent on: ' . fxRemoveHtml(fxShowDate(fxGetDate(), $strLangue)) . ' @ ' . fxGetTime(); } $body = fxGetMailFormat(false, false, true, false, $strLangue); $body = str_replace('%logo%', $vDomaine . '/images/logoms1inscription.png', $body); $body = str_replace('%to_mail%', $tabData['com_courriel'], $body); $body = str_replace('%subject%', $subject, $body); $body = str_replace('%message%', $message, $body); $body = str_replace('%attachment_url%', $attachment_url, $body); $body = str_replace('%attachment_label%', $attachment_label, $body); $ok = fxSendMail($subject, $body, $tabData['com_courriel'], $tabData['com_prenom'] . ' ' . $tabData['com_nom'], $GLOBALS['vEmail'], $GLOBALS['vClient'], 1, 0); // définir le message à affiche if ($strLangue == 'fr') $_SESSION['msg'] = 'm109'; else $_SESSION['msg'] = 'm509'; // définir la prochaine étape $strStep = 'login'; } // récupérer les infos mises à jour $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_id=" . $intCompte; $infoCompte = $objDatabase->fxGetRow($sqlCourriel); if ($infoCompte != null) { $_SESSION['com_prenom'] = $infoCompte['com_prenom']; $_SESSION['com_info'] = $infoCompte; } break; case 'addaffilie': // ajour dun membre addaffilie $tabData['com_naissance'] = $tabData['com_naissance_year'] . "-" . $tabData['com_naissance_month'] . "-" . $tabData['com_naissance_day']; // $tabData['com_password'] = password_hash($tabData['com_password'], PASSWORD_DEFAULT); // faire un hash $tabData['com_actif'] = 1; // activer le compte $tabData['com_affilie'] = $_SESSION['com_id']; // former le INSERT $tabFieldsValues = fxListFieldsValues($tabData, 'com_id', 'inscriptions_comptes', $GLOBALS['arrConDatabaseMain']['db']); // verification des champs obligatoire $champsobligatoires = array('b' => "com_prenom", "com_nom", "com_naissance", "com_sexe", "com_langue"); //$champsobligatoires = array('b' => "com_prenom", "com_nom", "com_naissance", "com_sexe", "com_adresse", "com_ville", "pro_id", "com_codepostal", "pay_id", "com_telephone1", "com_langue"); if (count(array_intersect($tabFieldsValues['pasvide'], $champsobligatoires)) != count($champsobligatoires)) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e101'; else $_SESSION['msg'] = 'e501'; break; } // insérer les infos du participants $sqlInsert = "INSERT INTO inscriptions_comptes " . $tabFieldsValues['set'] . " ,com_creation = '" . fxGetDateTime() . "', com_ip = '" . $_SERVER['REMOTE_ADDR'] . "'"; $qryInsert = $objDatabase->fxQuery($sqlInsert); // récupérer le id ajouté $intCompte = $objDatabase->fxGetLastId(); // récupérer les infos mises à jour // liste des compte affilie $sqlAffilie = "SELECT * FROM inscriptions_comptes WHERE com_affilie = '" . $_SESSION['com_id'] . "'"; $infoAffilie = $objDatabase->fxGetResults($sqlAffilie); $_SESSION['com_affilie'] = $infoAffilie; break; case 'mod': // MODIFICATION if (!isset($mem_id)) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e101'; else $_SESSION['msg'] = 'e501'; break; } if (isset($tabData['com_password'])) { // si le mot de passea changé, faire un hash $tabData['com_password'] = password_hash($tabData['com_password'], PASSWORD_DEFAULT); } $tabFieldsValues = fxListFieldsValues($tabData, 'com_id', 'inscriptions_comptes', $GLOBALS['arrConDatabaseMain']['db']); // verification des champs obligatoire $champsobligatoires = array('b' => "com_telephone1", "com_langue"); //$champsobligatoires = array('b' => "com_adresse", "com_ville", "pro_id", "com_codepostal", "pay_id", "com_telephone1", "com_langue"); if (count(array_intersect($tabFieldsValues['pasvide'], $champsobligatoires)) != count($champsobligatoires)) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e101'; else $_SESSION['msg'] = 'e501'; break; } // $tabData['com_naissance'] = $tabData['com_naissance_year'] . "-" . $tabData['com_naissance_month'] . "-" . $tabData['com_naissance_day']; $tabFieldsValues = fxListFieldsValues($tabData, 'com_id', 'inscriptions_comptes', $GLOBALS['arrConDatabaseMain']['db']); // update les infos du participants $sqlUpdate = "UPDATE inscriptions_comptes " . $tabFieldsValues['set'] . ", com_maj = now() where com_id=" . $mem_id; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); if ($qryUpdate == false) { // S'il y a eu erreur lors de mise à jour du compte, log du SQL fxcreer_log("ERREUR SQL UPDATE - fxSetCompte('" . $strAction . "')" . $sqlUpdate); } // récupérer les infos mises à jour $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_id=" . $_SESSION['com_id']; $infoCompte = $objDatabase->fxGetRow($sqlCourriel); // voir si on modifi le compte looger if ($mem_id == $_SESSION['com_id']) { if ($infoCompte != null) { $_SESSION['com_prenom'] = $infoCompte['com_prenom']; $_SESSION['com_info'] = $infoCompte; } } // définir le message à affiche if ($strLangue == 'fr') $_SESSION['msg'] = 'm113'; else $_SESSION['msg'] = 'm513'; // définir la prochaine étape $strStep = 'accueil'; break; } } else { } if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; header("Location: " . $vDomaine . '/' . $strPage . '/' . $strStep . "?reloadinf=true&autologin=" . $autologin); exit; } // Valider le nouveau compte client function fxValiderCompte($strLangue = 'fr') { global $objDatabase, $vDomaine; if (isset($_GET['courriel']) && isset($_GET['id'])) { $sqlClient = "SELECT com_id FROM inscriptions_comptes WHERE com_courriel = '" . $objDatabase->fxEscape($_GET['courriel']) . "' AND com_id = " . intval($_GET['id']); $nbClient = $objDatabase->fxGetRow($sqlClient); // vérifier si un autre compte avec ce courriel a déjà été activé $sqlClientActif = "SELECT COUNT(com_id) FROM inscriptions_comptes WHERE com_courriel = '" . $objDatabase->fxEscape($_GET['courriel']) . "' AND com_id <> " . intval($_GET['id']) . " AND com_actif = 1"; $nbClientActif = $objDatabase->fxGetVar($sqlClientActif); // si compte avec ce courriel est déjà activé if ($nbClientActif > 0) { // afficher erreur et lien pour retrouver mot de passe if ($strLangue == 'fr') $_SESSION['msg'] = 'e146'; else $_SESSION['msg'] = 'e546'; } else { // Activer compte if (isset($nbClient['com_id'])) { $sqlUpdate = "UPDATE inscriptions_comptes SET com_confirme = 1, com_actif = 1 WHERE com_courriel = '" . $objDatabase->fxEscape($_GET['courriel']) . "' AND com_id = " . intval($_GET['id']); $qryUpdate = $objDatabase->fxQuery($sqlUpdate); if ($qryUpdate == false) { // S'il y a eu erreur lors de mise à jour du compte, log du SQL fxcreer_log("ERREUR SQL UPDATE - fxValiderCompte()" . $sqlUpdate); } if ($strLangue == 'fr') $_SESSION['msg'] = 'p111'; else $_SESSION['msg'] = 'p511'; } else { if ($strLangue == 'fr') $_SESSION['msg'] = 'e106'; else $_SESSION['msg'] = 'e506'; } } } else { if ($strLangue == 'fr') $_SESSION['msg'] = 'e106'; else $_SESSION['msg'] = 'e506'; } if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; $strStep = 'login'; header("Location: " . $vDomaine . '/' . $strPage . '/' . $strStep); exit; } function fxShowFormPassword($strLangue) { global $vDomaine; ?>
fxGetCaptcha($_POST['g-recaptcha-response']); if ($Retorno->success) { $sqlClient = "SELECT com_id, com_nom, com_prenom, com_password, com_courriel, com_login FROM inscriptions_comptes WHERE com_courriel = '" . $objDatabase->fxEscape($_POST['txt_courriel']) . "' AND com_actif = 1"; $infoCompte = $objDatabase->fxGetRow($sqlClient); if ($infoCompte == null) { if ($strLangue == 'fr') $_SESSION['msg'] = 'e115'; else $_SESSION['msg'] = 'e515'; } else { $strToken = uniqid('', true); $strDate = fxGetDateTime(); $sqlUpdate = "UPDATE inscriptions_comptes SET com_reset_token = '$strToken', com_reset_date = '$strDate' WHERE com_id = " . intval($infoCompte['com_id']); $qryUpdate = $objDatabase->fxQuery($sqlUpdate); if ($strLangue == 'fr') { // FRANÇAIS $subject = "Réinitialiser votre mot de passe"; $message = 'Bonjour ' . fxUnescape($infoCompte['com_prenom']) . ',

suite à votre demande, voici un lien temporaire pour réinitialiser votre mot de passe:

Nom d\'usager:
' . $infoCompte['com_login'] . '

Cliquez le bouton ci-dessous pour réinitialiser votre mot de passe.'; $attachment_url = $vDomaine . '/compte/reset?t=' . $strToken . '&m=' . $infoCompte['com_courriel'] . '&id=' . $infoCompte['com_id']; $attachment_label = "Réinitialsez ici"; $_SESSION['msg'] = 'm114'; } else { // ANGLAIS $subject = "Reset your password"; $message = 'Hello ' . fxUnescape($infoCompte['com_prenom']) . ',

following your request, here is a temporary link to reset your password:

Username:
' . $infoCompte['com_login'] . '

Click the button below to reset your password.'; $attachment_url = $vDomaine . '/account/reset?t=' . $strToken . '&m=' . $infoCompte['com_courriel'] . '&id=' . $infoCompte['com_id']; $attachment_label = "Reset here"; $_SESSION['msg'] = 'm514'; } $body = fxGetMailFormat(false, false, true, false, $strLangue); $body = str_replace('%logo%', $vDomaine . '/images/logoms1inscription.png', $body); $body = str_replace('%to_mail%', $infoCompte['com_courriel'], $body); $body = str_replace('%subject%', $subject, $body); $body = str_replace('%message%', $message, $body); $body = str_replace('%attachment_url%', $attachment_url, $body); $body = str_replace('%attachment_label%', $attachment_label, $body); $blnMail = fxSendMail($subject, $body, $infoCompte['com_courriel'], $infoCompte['com_prenom'] . ' ' . $infoCompte['com_nom'], $GLOBALS['vEmail'], $GLOBALS['vClient'], 1, 0); if (!$blnMail) { fxcreer_log('ERREUR - Demande de password (' . $objDatabase->fxEscape($_POST['txt_courriel']) . ')'); } } } else { } if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; header("Location: " . $vDomaine . '/' . $strPage . '/login'); exit; } function fxLoginCompte($infoLogin, $strLangue) { global $objDatabase, $vDomaine; $arrRetour = array(); $arrRetour['state'] = 'error'; $mem_retour = isset($infoLogin['url_retour']) ? $infoLogin['url_retour'] : ''; if ($mem_retour && isset($infoLogin['com_id'])) { $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_id = " . intval($infoLogin['com_id']); $infoCompte = $objDatabase->fxGetRow($sqlCourriel); $infoLogin['txt_password'] = $infoCompte['com_password']; } else { $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_login = '" . $objDatabase->fxEscape($infoLogin['txt_login']) . "' AND com_actif = 1"; $infoCompte = $objDatabase->fxGetRow($sqlCourriel); } if ($infoCompte != null) { if (strcasecmp($infoLogin['txt_password'], $infoCompte['com_password']) == 0) { $blnSuccess = true; $strHashPassword = ', com_password = ' . password_hash($infoLogin['txt_password'], PASSWORD_DEFAULT) . "'"; // faire un hash } else { $blnSuccess = password_verify($infoLogin['txt_password'], $infoCompte['com_password']); $strHashPassword = ''; } if ($blnSuccess) { // mettre à jour le ip et la date de dernière visite $arrRetour['state'] = $sqlUpdate = "UPDATE inscriptions_comptes SET com_ip = '" . $_SERVER['REMOTE_ADDR'] . "', com_lastvisit = '" . fxGetDateTime() . "'$strHashPassword WHERE com_id = " . intval($infoCompte['com_id']); $qryUpdate = $objDatabase->fxQuery($sqlUpdate); if ($qryUpdate == false) { // S'il y a eu erreur lors de mise à jour du compte, log du SQL fxcreer_log("ERREUR SQL UPDATE - fxLoginCompte()" . $sqlUpdate); } //$_SESSION['logged'] = 1; $_SESSION['com_id'] = $infoCompte['com_id']; $_SESSION['vadmin_texte'] = false; $_SESSION['com_info'] = $infoCompte; // liste des compte affilie $sqlAffilie = "SELECT * FROM inscriptions_comptes WHERE com_affilie = '" . $_SESSION['com_id'] . "'"; $infoAffilie = $objDatabase->fxGetResults($sqlAffilie); $_SESSION['com_affilie'] = $infoAffilie; if ($infoCompte['com_admin'] == 1) { // pour afficher le débug des text $_SESSION['vadmin_texte'] = true; } // Associer le compte au no panier, si le client à choisit de créer un compe apr ès une commande if (isset($_SESSION['no_panier'])) { $tabData['txt_panier'] = $_SESSION['no_panier']; $mem_panierinfo = fxNbItemsPanier($_SESSION['no_panier']); $intNbItems = $mem_panierinfo['nbitem']; $intCompte = $infoCompte['com_id']; if ($intNbItems > 0) { $sqlUpdate = "UPDATE inscriptions_panier_acheteurs SET com_id = " . intval($intCompte) . " WHERE no_panier = '" . $tabData['txt_panier'] . "'"; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); $sqlUpdate = "UPDATE inscriptions_panier_epreuves_commandees SET com_id = " . intval($intCompte) . " WHERE no_panier = '" . $tabData['txt_panier'] . "'"; $qryUpdate = $objDatabase->fxQuery($sqlUpdate); require_once 'inc_fx_panier.php'; fxMajCopieParticipantAcheteurCompte($tabData['txt_panier'], $intCompte); } } // metre dans l'info compte la liste des evenement prive $_SESSION['com_info']['eve_prive'] = explode(',', $infoCompte['com_eve_prive']); $arrRetour['state'] = 'true'; //MSIN-4339 if (!empty($_SESSION['redirect_after_login'])) { $url = $_SESSION['redirect_after_login']; unset($_SESSION['redirect_after_login']); header("Location: " . $url); exit; } } else { if ($strLangue == 'fr') $_SESSION['msg'] = 'e112'; else $_SESSION['msg'] = 'e512'; } } else { if ($strLangue == 'fr') $_SESSION['msg'] = 'e112'; else $_SESSION['msg'] = 'e512'; } if ($infoLogin['url_retour'] != '') { if ($infoLogin['url_retour'] == 'admin') { return $arrRetour; } else { header("Location: " . $infoLogin['url_retour']); } } else { if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; //header("Location: " . $vDomaine . '/' . $strPage); header("Location: " . fxGetReferer()); } exit; } function fxLogout($strLangue = 'fr') { global $vDomaine; unset($_SESSION['com_id']); unset($_SESSION['com_info']); unset($_SESSION['com_prenom']); //unset($_SESSION['logged']); unset($_SESSION['vadmin_texte']); unset($_SESSION['url_retour']); unset($_SESSION['msg_erreur']); unset($_SESSION['promoteur_eve_id']); unset($_SESSION['epr_id_bib']); unset($_SESSION['com_affilie']); // $_SESSION = []; // Vide toutes les variables de session // Optionnel : détruit la session complètement (ID, fichier, etc.) session_destroy(); $_SESSION['date_maj'] = time(); // session_unset(); // session_destroy(); if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; fxViderPanier($_SESSION['no_panier'], 1); header('Location: ' . $vDomaine . '/' . $strPage); exit; } function fxShowFormReset($arrData, $strLangue) { global $vDomaine, $objDatabase; $blnErreur = false; $sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_reset_token = '" . $objDatabase->fxEscape($arrData['t']) . "' AND com_courriel = '" . $objDatabase->fxEscape($arrData['m']) . "' AND com_actif = 1 AND com_id = " . intval($arrData['id']); $infoCompte = $objDatabase->fxGetRow($sqlCourriel); if ($infoCompte != null) { if (true) { ?>
fxEscape($arrData['com_password_a']), PASSWORD_DEFAULT); $sqlUpdate = "UPDATE inscriptions_comptes SET com_password = '" . $strPassword . "' WHERE com_reset_token = '" . $objDatabase->fxEscape($arrData['t']) . "' AND com_courriel = '" . $objDatabase->fxEscape($arrData['m']) . "' AND com_actif = 1 AND com_id = " . intval($arrData['id']); $qryUpdate = $objDatabase->fxQuery($sqlUpdate); if ($qryUpdate !== false) { // succès $_SESSION['msg'] = 'p211'; } else { // erreur $_SESSION['msg'] = 'e212'; } // redirection if ($strLangue == 'fr') $strPage = 'compte'; else $strPage = 'account'; ?> '; // liste mes abonnements $arrAbonnement = 0; $arrAbonnement = fxGetAbonnementsaffilie($arrCompteClient['com_id'], 1, $strLangue); $strNbAbonnement = fxcount($arrAbonnement); $arrAbonnement = fxGetAbonnements($arrCompteClient['com_id'], 1, $strLangue); $strNbAbonnementnb = $strNbAbonnement + fxcount($arrAbonnement); if ($strNbAbonnementnb != 0) { $strNbAbonnement = '(' . $strNbAbonnementnb . ' '; $strNbAbonnement .= ($strNbAbonnementnb > 1) ? afficheTexte('compte_abonnement_pluriel', 0) : afficheTexte('compte_abonnement_singulier', 0); $strNbAbonnement .= ')'; $strRetour .= ' '; } // menu promoteur if (trim($arrCompteClient['com_eve_promoteur']) != '' || trim($arrCompteClient['com_rapports']) != '') { // si le compte client a des événements dont il est le promoteur $arrEvePromoteur = explode(',', $arrCompteClient['com_eve_promoteur']); $intNbEvePromoteur = fxcount($arrEvePromoteur); $strNbEvenements = '(' . $intNbEvePromoteur . ' '; $strNbEvenements .= ($intNbEvePromoteur > 1) ? afficheTexte('compte_evenement_pluriel', 0) : afficheTexte('compte_evenement_singulier', 0); $strNbEvenements .= ')'; $strRetour .= ' '; // MSIN-3880 $strRetour .= fxShowInfoPromoteurtitre($_SESSION['com_info'], $strLangue); } // $arrDefis = fxGetCommandes($arrCompteClient, 3, $strLangue); if ($arrDefis != null) { $intNbDefis = fxcount($arrDefis['actives']); $strNbDefis = '(' . $intNbDefis . ' '; $strNbDefis .= ($intNbDefis > 1) ? afficheTexte('compte_defi_pluriel', 0) : afficheTexte('compte_defi_singulier', 0); $strNbDefis .= ')'; $strRetour .= ' '; } // $strRetour .= $arrCompteClient['com_id']; $arrBenevolats = fxGetCommandes($arrCompteClient, 2, $strLangue); if ($arrBenevolats != null) { $intNbBenevolats = fxcount($arrBenevolats['actives']); $strNbBenevolats = '(' . $intNbBenevolats . ' '; $strNbBenevolats .= ($intNbBenevolats > 1) ? afficheTexte('compte_benevolat_pluriel', 0) : afficheTexte('compte_benevolat_singulier', 0); $strNbBenevolats .= ')'; $strRetour .= ' '; } $arrLeveesFonds = fxGetCommandes($arrCompteClient, 0, $strLangue); if ($arrLeveesFonds != null) { $intNbLeveesFonds = fxcount($arrLeveesFonds['actives']); $strNbLeveesFonds = '(' . $intNbLeveesFonds . ' '; $strNbLeveesFonds .= ($intNbLeveesFonds > 1) ? afficheTexte('compte_levee_fonds_pluriel', 0) : afficheTexte('compte_levee_fonds_singulier', 0); $strNbLeveesFonds .= ')'; $strRetour .= ' '; } $arrCommandes = fxGetCommandes($arrCompteClient, 1, $strLangue); $arrListeattente = fx_liste_attente_compte($arrCompteClient["com_id"]); $strNbCommandes = 0; if ($arrCommandes != null || $arrListeattente != null) { $intNbCommandes = fxcount($arrCommandes['actives']) + fxcount($arrCommandes['terminées']); $strNbCommandes = '(' . $intNbCommandes . ' '; $strNbCommandes .= ($intNbCommandes > 1) ? afficheTexte('compte_commande_pluriel', 0) : afficheTexte('compte_commande_singulier', 0); $strNbCommandes .= ')'; } if ($arrCommandes != null || $arrListeattente != null) { $strRetour .= ' '; } $strRetour .= ' '; //MSIN-4245 // bug si pas promoteur vois pas les rapport if (trim($arrCompteClient['com_eve_promoteur']) == '' && trim($arrCompteClient['com_rapports']) != '') { $tabPromoRapport[] = $arrCompteClient['com_rapports']; if ($tabPromoRapport[0] != "") { $strRetour .="

" . afficheTexte('titre_rapport', 0, 0) . "

" ; for ($intCtr = 0; $intCtr <= count($tabPromoRapport) - 1; $intCtr++) { $memlienrap = fxGetMenussuperadm($tabPromoRapport[$intCtr], 0, 1); if ($memlienrap != null) { $strRetour .='
'.fxUnescape($memlienrap['men_nom']).'

'; } } } } return $strRetour; } function fxShowInfoPromoteur($arrCompteClient, $strLangue) { // affiche la section Info promoteur global $objDatabase, $vDomaine, $vRepertoireFichiers; $strRetour = ''; $qry = 'select com_eve_promoteur,com_rapports, com_eve_modifiable from inscriptions_comptes where com_id = ' . intval($arrCompteClient['com_id']); $arrPromoteur = $objDatabase->fxGetRow($qry); // verifier si evenement est modifiable pour l'usager courant $strEveModifiable = $arrPromoteur['com_eve_modifiable']; if ($arrPromoteur['com_eve_promoteur'] != '') { if (stripos($arrPromoteur['com_eve_promoteur'], ',') > 0) { $tabPromoEveId = explode(',', $arrPromoteur['com_eve_promoteur']); } else { $tabPromoEveId[] = $arrPromoteur['com_eve_promoteur']; } ?>
fxGetResults($qry); ?>
" width="100">




" . afficheTexte('titre_rapport', 0, 0) . ""); for ($intCtr = 0; $intCtr <= count($tabPromoRapport) - 1; $intCtr++) { $memlienrap = fxGetMenussuperadm($tabPromoRapport[$intCtr], 0, 1); if ($memlienrap != null) { ?>

fxGetRow($qry); // verifier si evenement est modifiable pour l'usager courant $strEveModifiable = $arrPromoteur['com_eve_modifiable']; if ($arrPromoteur['com_eve_promoteur'] != '') { if (stripos($arrPromoteur['com_eve_promoteur'], ',') > 0) { $tabPromoEveId = explode(',', $arrPromoteur['com_eve_promoteur']); } else { $tabPromoEveId[] = $arrPromoteur['com_eve_promoteur']; } ?>
fxGetResults($qry); ?>
" width="100">




" . afficheTexte('titre_rapport', 0, 0) . ""); for ($intCtr = 0; $intCtr <= count($tabPromoRapport) - 1; $intCtr++) { $memlienrap = fxGetMenussuperadm($tabPromoRapport[$intCtr], 0, 1); if ($memlienrap != null) { ?>

'; $qry = 'select com_eve_promoteur,com_rapports, com_eve_modifiable from inscriptions_comptes where com_id = ' . intval($arrCompteClient['com_id']); $arrPromoteur = $objDatabase->fxGetRow($qry); // verifier si evenement est modifiable pour l'usager courant $strEveModifiable = $arrPromoteur['com_eve_modifiable']; if ($arrPromoteur['com_eve_promoteur'] != '') { if (stripos($arrPromoteur['com_eve_promoteur'], ',') > 0) { $tabPromoEveId = explode(',', $arrPromoteur['com_eve_promoteur']); // --- Réordonner la liste par date de fin d'événement (plus récent -> plus vieux) --- $ids = array_filter(array_map('intval', $tabPromoEveId), function($v){ return $v > 0; }); if (!empty($ids)) { $in = implode(',', $ids); // On ne garde que les actifs (comme ta requête dans la boucle) et on trie par eve_date_fin desc $qrySort = " SELECT e.eve_id,e.eve_date_fin FROM inscriptions_evenements e WHERE e.eve_actif = 1 AND e.eve_id IN ($in) ORDER BY e.eve_date_fin DESC "; // Si tu as fxGetResults : $rowsSort = $objDatabase->fxGetResults($qrySort); // Reconstituer la liste d'IDs dans le bon ordre $sortedIds = []; if (!empty($rowsSort)) { foreach ($rowsSort as $r) { if (isset($r['eve_id'])) $sortedIds[] = (int)$r['eve_id']; } } // Si la requête a renvoyé au moins 1 ID, on remplace la liste d'origine if (!empty($sortedIds)) { $tabPromoEveId = $sortedIds; } } // --- Fin du patch de tri --- } else { $tabPromoEveId[] = $arrPromoteur['com_eve_promoteur']; } ?> fxGetResults($qry); $strRetour .= ' '; } } $strRetour .= ' '; return $strRetour; } function fxGetCommandes($arrCompteClient, $tep_id, $strLangue) { // trouver les commandes global $objDatabase; $arrEpreuvesCommandeesActives = $arrEpreuvesCommandeesTerminees = array(); $intCtrEpreuvesCommandeesActives = $intCtrEpreuvesCommandeesTerminees = 1; $arrRetour = null; if (intval($tep_id) > 0) { // trouver les épreuves selon le type if ($tep_id == 1) { $sqlEpreuvesCommandeesold = " SELECT * FROM resultats_epreuves_commandees ec JOIN inscriptions_evenements e ON ec.eve_id = e.eve_id JOIN inscriptions_epreuves c ON ec.epr_id = c.epr_id JOIN inscriptions_panier_acheteurs a ON ec.no_panier = a.no_panier WHERE ec.pec_actif = 1 AND ec.com_id = " . intval($arrCompteClient['com_id']) . " AND ec.tep_id IN(1, 3) GROUP BY ec.pec_id ORDER BY a.ach_maj DESC, e.eve_date_debut, ec.no_commande DESC limit 100 "; $sqlEpreuvesCommandees= " SELECT * FROM resultats_epreuves_commandees ec JOIN inscriptions_evenements e ON ec.eve_id = e.eve_id JOIN inscriptions_epreuves c ON ec.epr_id = c.epr_id JOIN inscriptions_panier_acheteurs a ON ec.no_panier = a.no_panier JOIN inscriptions_panier_participants p ON p.pec_id = ec.pec_id_original WHERE ec.pec_actif = 1 AND ec.com_id = " . intval($arrCompteClient['com_id']) . " AND ec.tep_id IN(1, 3) GROUP BY ec.pec_id ORDER BY a.ach_maj DESC, e.eve_date_debut, ec.no_commande DESC LIMIT 100"; //echo($sqlEpreuvesCommandees); } else { $sqlEpreuvesCommandees = " SELECT * FROM resultats_epreuves_commandees ec JOIN inscriptions_evenements e ON ec.eve_id = e.eve_id JOIN inscriptions_epreuves c ON ec.epr_id = c.epr_id JOIN inscriptions_panier_acheteurs a ON ec.no_panier = a.no_panier WHERE ec.pec_actif = 1 AND ec.com_id = " . intval($arrCompteClient['com_id']) . " AND ec.tep_id = " . intval($tep_id) . " GROUP BY ec.pec_id ORDER BY a.ach_maj DESC, e.eve_date_debut, ec.no_commande DESC "; } //$sqlEpreuvesCommandees = "SELECT * FROM resultats_epreuves_commandees ec, inscriptions_evenements e, inscriptions_epreuves c WHERE ec.eve_id = e.eve_id AND ec.epr_id = c.epr_id AND ec.pec_actif = 1 AND ec.com_id = " . intval($arrCompteClient['com_id']) . " AND ec.tep_id = " . intval($tep_id) . " GROUP BY ec.pec_id ORDER BY e.eve_date_debut, ec.no_commande DESC"; $arrEpreuvesCommandees = $objDatabase->fxGetResults($sqlEpreuvesCommandees); } else { // trouver les épreuves de dons $sqlEpreuvesCommandees = " SELECT * FROM resultats_epreuves_commandees ec JOIN inscriptions_evenements e ON ec.eve_id = e.eve_id JOIN inscriptions_epreuves c ON ec.epr_id = c.epr_id JOIN inscriptions_panier_acheteurs a ON ec.no_panier = a.no_panier WHERE ec.pec_actif = 1 AND c.epr_id_don <> 0 AND ec.com_id = " . intval($arrCompteClient['com_id']) . " AND ec.tep_id IN(1,3) AND (e.eve_id_don <> 0 OR c.epr_genere_don = 1) GROUP BY ec.pec_id ORDER BY a.ach_maj DESC, e.eve_date_debut, ec.no_commande DESC "; $arrEpreuvesCommandees = $objDatabase->fxGetResults($sqlEpreuvesCommandees); } if ($arrEpreuvesCommandees != null) { for ($intCtrEpreuvesCommandees = 1; $intCtrEpreuvesCommandees <= fxcount($arrEpreuvesCommandees); $intCtrEpreuvesCommandees++) { if ($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_date_fin'] <= fxGetDate()) { // si l'événement terminé $arrEpreuvesCommandeesTerminees[$intCtrEpreuvesCommandeesTerminees] = $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]; $intCtrEpreuvesCommandeesTerminees++; } else { // sinon, l'événement est actif $arrEpreuvesCommandeesActives[$intCtrEpreuvesCommandeesActives] = $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]; $intCtrEpreuvesCommandeesActives++; } } $arrRetour['actives'] = $arrEpreuvesCommandeesActives; $arrRetour['terminées'] = $arrEpreuvesCommandeesTerminees; } return $arrRetour; } function fxShowCommandes($arrEpreuvesCommandees, $arrCompteClient, $tep_id, $strLangue) { // afficher les commandes global $objDatabase, $strEveModifiable, $vDomaine, $arrFormsTransfert, $arrFormsObjectifsDons, $arrFormsLogSettings, $arrFormsAddLogs; $strRetour = ''; if ($arrEpreuvesCommandees != null) { ?>
'; ?> '; } } } else { echo "" . afficheTexte('evenement_termine', 0) . ""; } } else { echo "" . afficheTexte('inscription_cancelled', 0) . ""; } ?> '; } else { $strLigneLogs = ''; } ?>
*/ ?>
$arrEpreuvesCommandees[$intCtrEpreuvesCommandees]["par_id"], 'pec_id_original' => $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]["pec_id"], 'ach_id' => $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]["ach_id"], 'eve_id' => $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]["eve_id"], 'com_id' =>$arrEpreuvesCommandees[$intCtrEpreuvesCommandees]["com_id"], 'status' => 'actif' ]); $token = fxdecrypt_token($result['token_enc']); // $strRetour .= '
'.''.' ' . fxGetTabInscription('epr_nom_' . $strLangue, $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_id'], 'epreuves', 'epr'); } ?>
= fxGetDateTime() && !$blnCancelled) { $strCode = fxGetEvenementsUrl($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_id']); echo $strAffichage = ' '; } else { echo "" . afficheTexte('inscription_non_modifiable', 0) . ""; } } else { echo "" . afficheTexte('inscription_non_modifiable', 0) . ""; } if (intval($tabEvenement['general']['eve_epreuve_transfert_client']) == 1) { if ($tabEvenement['general']['eve_epreuve_transfert_date_limite'] . ' ' . $tabEvenement['general']['eve_epreuve_transfert_heure_limite'] >= fxGetDateTime() && !$blnCancelled) { // options de transfert // récupérer le coût du frais pour le switch d'épreuv if ($tabEvenement['general']['eve_epreuve_transfert_client_sansfrais']) { $tabFraisAutres['fa_montant'] = 0; } else { // options de transfert // récupérer le coût du frais pour le switch d'épreuve $tabFraisAutres = fxGetFraisAutres('transfert', $tabEvenement['general']['eve_frais'], $tabEvenement['general']['eve_id'], $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['tep_id']); } if (isset($tabFraisAutres['fa_montant']) && is_numeric($tabFraisAutres['fa_montant']) && $tabFraisAutres['fa_montant'] > 0) { $strPrixTransfert = fxShowPrix($tabFraisAutres['fa_montant'], $strLangue, 1); if ($tabEvenement['general']['tt_id'] > 1) { $strPrixTransfert .= " +tx"; } $strFrais = ' '; } else { $strFrais = ''; } //MSIN-4295 $arrFormsTransfert[] = $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_id_original']; $pec_id = $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_id_original']; $arrTransferts = fxGetTransferts($pec_id); $strInputPrenom = 'tra_prenom_' . $pec_id; $strInputNom = 'tra_nom_' . $pec_id; $strInputCourriel = 'tra_courriel_' . $pec_id; $strLigneTransfert = '

' . afficheTexte('btn_transfert_dossard', 0) . '

1) { echo '
'; } ?>

' . afficheTexte('vr_link_title', 0) . '

'; if ($arrEpreuvesCommandees != null) { $strRetour .= ' '; for ($intCtrEpreuvesCommandees = 1; $intCtrEpreuvesCommandees <= count($arrEpreuvesCommandees); $intCtrEpreuvesCommandees++) { $arrEpreuve = array(); if (trim($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_categorie_' . $strLangue]) != '') { $arrEpreuve[] = fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_categorie_' . $strLangue]); } if (trim($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_type_' . $strLangue]) != '') { $arrEpreuve[] = fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_type_' . $strLangue]); } if (trim($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_nom_' . $strLangue]) != '') { $arrEpreuve[] = fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_nom_' . $strLangue]); } $strEpreuve = implode(' - ', $arrEpreuve); $strRetour .= ' '; if (intval($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['is_cancelled']) == 0) { $arrObjectifsDons = fxShowFormObjectifsDons($arrEpreuvesCommandees[$intCtrEpreuvesCommandees], $strLangue); $arrFormsObjectifsDons[] = $arrObjectifsDons['forms']; $strRetour .= ' '; } } $strRetour .= ' '; } $strRetour .= '
' . afficheTexte('modifinscriptions_nom_eve', 0) . ' ' . afficheTexte('modifinscriptions_nom_epr', 0) . ' ' . afficheTexte('modifinscriptions_date_epr', 0) . ' ' . afficheTexte('modifinscriptions_detail_epr', 0) . '
' . fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_nom_' . $strLangue]) . ' ' . trim($strEpreuve) . ' ' . fxShowDate($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_date'], $strLangue) . '
    '; if (intval($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['is_cancelled']) == 1) { $strRetour .= '
  • ' . afficheTexte('levee_fonds_annulée', 0) . '
  • '; } else { // trouver les participants de l'éreuve $sqlParticipants = "SELECT par_nom, par_prenom, par_id_original FROM resultats_participants WHERE is_cancelled = 0 AND pec_id = " . $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_id_original'] . " GROUP BY par_id_original ORDER BY par_nom, par_prenom, par_id"; $arrParticipants = $objDatabase->fxGetResults($sqlParticipants); $strLink = $vDomaine . '/' . $strPage . '/' . fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_label_url']) . '/'; if (intval($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_equipe']) == 1) { // afficher le lien vers la page de don de l'équipe $strRetour .= '
  • ' . fxUnescape($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_nom_equipe']) . '
    ' . afficheTexte('voir_levee_fonds_equipe', 0) . '
  • '; } if ($arrParticipants != null) { foreach ($arrParticipants as $intCtr => $arrPart) { $strRetour .= '
  • ' . fxUnescape($arrPart['par_prenom']) . ', ' . fxUnescape($arrPart['par_nom']) . '
    ' . afficheTexte('voir_levee_fonds_participant', 0) . '
  • '; } } } $strRetour .= '

Objectifs dons

' . count($arrEpreuvesCommandees) . '  '; if (count($arrEpreuvesCommandees) > 1) $strRetour .= strtolower(afficheTexte('compte_levee_fonds_pluriel', 0, 0)); else $strRetour .= strtolower(afficheTexte('compte_levee_fonds_singulier', 0, 0)); $strRetour .= '
'; return $strRetour; }