fxGetResults($sqlInfos);
return $tabInfos;
}
// récupère les questions à demander aux participants ou pour une épreuve (JSP)
// param: type (par ou epr), id de l'événement, id de l'épreuve
// créé: 2014-08-15
function fxGetQuestions($strType, $intEvenement, $intEpreuve, $strAction, $intPromoteur = 0) {
global $objDatabase;
$strWhere = '';
if (isset($_SESSION['no_panier']) && $strAction == 'mod') {
$strAction = 'add';
}
if ($strType == 'epr')
$strWhere .= "AND que_epreuve = 1";
else
$strWhere .= "AND que_epreuve <> 1";
if ($strAction == 'add') {
$sqlQuestions = "SELECT * FROM inscriptions_questions WHERE que_actif = 1 AND (que_date_limite = '0000-00-00' OR que_date_limite = '' OR que_date_limite IS NULL OR que_date_limite >= '" . fxGetDate() . "') AND eve_id = " . intval($intEvenement) . " AND (FIND_IN_SET(" . intval($intEpreuve) . ", que_epreuves_incluses) OR que_epreuves_incluses = '') " . $strWhere . " ORDER BY que_tri, que_id";
} else {
if ($intPromoteur == 1) {
$sqlQuestions = "SELECT * FROM inscriptions_questions WHERE que_actif = 1 AND eve_id = " . intval($intEvenement) . " AND (FIND_IN_SET(" . intval($intEpreuve) . ", que_epreuves_incluses) OR que_epreuves_incluses = '') " . $strWhere . " ORDER BY que_tri, que_id";
} else {
$sqlQuestions = "SELECT * FROM inscriptions_questions WHERE que_actif = 1 AND (que_date_limite = '0000-00-00' OR que_date_limite = '' OR que_date_limite IS NULL OR que_date_limite >= '" . fxGetDate() . "') AND eve_id = " . intval($intEvenement) . " AND (FIND_IN_SET(" . intval($intEpreuve) . ", que_epreuves_incluses) OR que_epreuves_incluses = '') " . $strWhere . " ORDER BY que_tri, que_id";
}
}
$tabQuestions = $objDatabase->fxGetResults($sqlQuestions);
return $tabQuestions;
}
function fxShowInfosParticipants(&$tabRules, &$tabMessages, &$tabCalendriers, $tabInfos, $tabDates, $tabProvinces, $tabPays, $tabEpreuve, $tabParticipant, $intCtr, $intNbParticipantsMin, $strAction, $strDisabled, $strReadonly, $strStyle, $strLangue, $intPromoteur, $blnDon = false, &$tabCodepostal, &$tabTelephones) {
if ($strAction == 'auto')
$strAction = 'mod';
if ($tabInfos != null) {
for ($intCtrInfos = 1; $intCtrInfos <= count($tabInfos); $intCtrInfos++) {
$strDisabled0 = $strFieldDisabled = $mem_hint = $strAsterix = '';
if ($tabInfos[$intCtrInfos]['inf_required'] == 1) {
if ($intCtr <= $intNbParticipantsMin) {
$strRequired = 'true';
} else {
$strRequired = '
function(element){
return $("#' . $tabInfos[1]['cha_nom'] . '_' . $intCtr . '").val().length + $("#' . $tabInfos[2]['cha_nom'] . '_' . $intCtr . '").val().length > 0;
}
';
}
} else {
$strRequired = 'false';
}
$strField = $tabInfos[$intCtrInfos]['cha_nom'] . '_' . $intCtr;
if ($strRequired == 'true') {
$strAsterix = '
*
';
}
if ($tabInfos[$intCtrInfos]['inf_participant1'] == 0 || ($tabInfos[$intCtrInfos]['inf_participant1'] == 1 && $intCtr == 1)) {
switch ($tabInfos[$intCtrInfos]['cha_nom']) {
case 'par_naissance':
if ($strAction == 'mod' && !isset($_SESSION ['no_panier']) && $intPromoteur == 0 && $intCtr == 1) {
$strDisabled = "disabled='disabled'";
} else {
$tabCalendriers[] = $strField;
}
$tabRules[] = $strField . ': { required: ' . $strRequired . ', dateCA: true, daterange: ["' . $tabDates['min_date'] . '", "' . $tabDates['max_date'] . '"] }';
if ($strLangue == 'fr')
$tabMessages[] = $strField . ': { required: "Veuillez entrer la date de naissance", dateCA: "La date de naissance doit être sous le format AAAA-MM-JJ", daterange: "La date de naissance doit être entre {0} et {1}" }';
else
$tabMessages[] = $strField . ': { required: "Please enter the birthdate", dateCA: "The birthdate must be in the format YYYY-MM-DD", daterange: "The birthdate must be between {0} and {1}" }';
break;
// enlever (sl)
case 'par_codepostalbad':
$tabRules[] = $strField . ': { required: ' . $strRequired . ' }';
if ($strLangue == 'fr')
$tabMessages[] = $strField . ': { required: "Veuillez entrer le code postal/zip", postalCodeCA: "Veuillez entrer un code postal canadien valide", zipcodeUS: "Veuillez entrer un code zip américain valide" }';
else
$tabMessages[] = $strField . ': { required: "Please enter the postal/zip code", postalCodeCA: "Please enter a valid Canadian postal code", zipcodeUS: "Please enter a valid US zip code" }';
break;
case 'par_telephone1':
case 'par_telephone2':
$tabTelephones[] = $strField;
$tabRules[] = $strField . ': { required: ' . $strRequired . ' }';
if ($strLangue == 'fr')
$tabMessages[] = $strField . ': { required: "Veuillez entrer le numéro de téléphone", phoneUS: "Le numéro de téléphone doit être sous le format 555-555-5555" }';
else
$tabMessages[] = $strField . ': { required: "Please enter the phone number", phoneUS: "The phone number must be under the format 555-555-5555" }';
break;
case 'par_courriel':
$tabRules[] = $strField . ': { required: ' . $strRequired . ', email: true }';
if ($strLangue == 'fr')
$tabMessages[] = $strField . ': { required: "Veuillez entrer le courriel", email: "Le courriel doit être une adresse valide" }';
else
$tabMessages[] = $strField . ': { required: "Please enter the email", email: "The email must be a valid address" }';
break;
default:
$tabRules[] = $strField . ': { required: ' . $strRequired . ' }';
if ($strLangue == 'fr')
$tabMessages[] = $strField . ': { required: "Veuillez entrer une valeur" }';
else
$tabMessages[] = $strField . ': { required: "Please enter a value" }';
if ($tabInfos[$intCtrInfos]['cha_nom'] == 'par_prenom' && $blnDon) {
if ($strLangue == 'fr') { // FRANÇAIS
$strMessage = "Si vous voulez un reçu au nom d'une entreprise, utilisez les deux champs prénom et nom pour entrer le nom de la compagnie.
Exemple, pour MS1 Timing Inc. Entrez :
Prénom : MS1
Nom : Timing Inc.";
} else { // ANGLAIS
$strMessage = " If you wish to issued the receipt to a company name, use both first and last name field for your company name.
Example: for MS1 Timing Inc. Enter :
firstname : MS1
Lastname : Timing Inc.";
}
$mem_hint = '
';
}
}
// afficher que les champ pour identifier un abonnement
if ($tabInfos[$intCtrInfos]['cha_abonnement']==0 && $tabEpreuve['tep_id'] == 4){
$mem_hidden='style="display: none;';
}else{
$mem_hidden=' ';
}
?>
';
}
if ($strRequired == 'true') {
$strAsterix = '
*
';
}
switch ($tabQuestions[$intCtr3]['que_validation']) {
case 'date':
?>