File: /home/f/r/e/frenchy/refonte2023/wordpress/evenements/inscription_old.php
<?php
require_once("_mysql.php");
setlocale (LC_TIME, 'fr_FR.utf8','fra');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html;charset=UTF-8" http-equiv="content-type"/>
<title>French American - Adhésion en ligne 2018></title>
<script type="text/javascript">
function checkDate(_date) {
reg = new RegExp(/^[0-3]{1}[0-9]{1}[\/][0-1]{1}[0-9]{1}[\/][0-9]{4}$/);
if(!reg.test(_date)){ // VERIFICATION DU FORMAT JJ/MM/AAAA
return false;
}
tabDate = _date.split('/');
dateTest = new Date(tabDate[2], tabDate[1] - 1, tabDate[0]);
if(parseInt(tabDate[0], 10) != parseInt(dateTest.getDate(), 10)
|| parseInt(tabDate[1], 10) != parseInt(dateTest.getMonth(), 10) + parseInt(1, 10)
|| parseInt(tabDate[2], 10) != parseInt(dateTest.getFullYear(), 10) ){ // VERIFICATION DE L'EXSISTANCE
return false;
}
return true;
}
function verification()
{
if (document.getElementById("type_cotisation_i").checked == false && document.getElementById("type_cotisation_e").checked == false) {
alert("Merci d'indiquer votre type de cotisation");
return false;
}
if (document.getElementById("type_cotisation_i").checked == true) {
if(document.frmSubmit.email_contact.value == "")
{
alert("Merci d'indiquer votre adresse e-mail");
document.frmSubmit.email_contact.focus();
return false;
}
if(document.frmSubmit.email_contact.value.indexOf('@') == -1)
{
alert("Adresse e-mail invalide");
document.frmSubmit.email_contact.focus();
return false;
}
if(document.frmSubmit.civilite_contact.value == "")
{
alert("Merci d'indiquer votre Civilité");
document.frmSubmit.civilite_contact.focus();
return false;
}
if(document.frmSubmit.prenom_contact.value == "")
{
alert("Merci d'indiquer votre Prénom");
document.frmSubmit.prenom_contact.focus();
return false;
}
if(document.frmSubmit.nom_contact.value == "")
{
alert("Merci d'indiquer votre Nom");
document.frmSubmit.nom_contact.focus();
return false;
}
if(document.frmSubmit.telephone_contact.value == "")
{
alert("Merci d'indiquer votre Téléphone");
document.frmSubmit.telephone_contact.focus();
return false;
}
if(document.frmSubmit.adresse_contact.value == "")
{
alert("Merci d'indiquer l'adresse de facturation");
document.frmSubmit.adresse_contact.focus();
return false;
}
if(document.frmSubmit.code_postal_contact.value == "")
{
alert("Merci d'indiquer le code postal de facturation");
document.frmSubmit.code_postal_contact.focus();
return false;
}
if(document.frmSubmit.ville_contact.value == "")
{
alert("Merci d'indiquer le ville de facturation");
document.frmSubmit.ville_contact.focus();
return false;
}
}
if (document.getElementById("type_cotisation_e").checked == true) {
if(document.frmSubmit.email_contact_e.value == "")
{
alert("Merci d'indiquer votre adresse e-mail");
document.frmSubmit.email_contact_e.focus();
return false;
}
if(document.frmSubmit.email_contact_e.value.indexOf('@') == -1)
{
alert("Adresse e-mail invalide");
document.frmSubmit.email_contact_e.focus();
return false;
}
if(document.frmSubmit.email_assistant_e.value != "" && document.frmSubmit.email_assistant_e.value.indexOf('@') == -1)
{
alert("Adresse e-mail de votre assistant(e) invalide");
document.frmSubmit.email_assistant_e.focus();
return false;
}
if(document.frmSubmit.civilite_contact_e.value == "")
{
alert("Merci d'indiquer votre Civilité");
document.frmSubmit.civilite_contact_e.focus();
return false;
}
if(document.frmSubmit.prenom_contact_e.value == "")
{
alert("Merci d'indiquer votre Prénom");
document.frmSubmit.prenom_contact_e.focus();
return false;
}
if(document.frmSubmit.nom_contact_e.value == "")
{
alert("Merci d'indiquer votre Nom");
document.frmSubmit.nom_contact_e.focus();
return false;
}
if(document.frmSubmit.fonction_contact_e.value == "")
{
alert("Merci d'indiquer votre fonction dans l'entreprise");
document.frmSubmit.fonction_contact_e.focus();
return false;
}
if(document.frmSubmit.entreprise_contact_e.value == "")
{
alert("Merci d'indiquer le nom de votre entreprise");
document.frmSubmit.entreprise_contact_e.focus();
return false;
}
if(document.frmSubmit.telephone_contact_e.value == "")
{
alert("Merci d'indiquer votre Téléphone");
document.frmSubmit.telephone_contact_e.focus();
return false;
}
if(document.frmSubmit.adresse_contact_e.value == "")
{
alert("Merci d'indiquer l'adresse de votre entreprise");
document.frmSubmit.adresse_contact_e.focus();
return false;
}
if(document.frmSubmit.code_postal_contact_e.value == "")
{
alert("Merci d'indiquer le code postal votre entreprise");
document.frmSubmit.code_postal_contact_e.focus();
return false;
}
if(document.frmSubmit.ville_contact_e.value == "")
{
alert("Merci d'indiquer le ville votre entreprise");
document.frmSubmit.ville_contact_e.focus();
return false;
}
}
<?php
$reqInscription = mysqli_query($link_bdd,"select * from inscriptions where presence_date_naissance = 'oui'");
while($lineInscription = mysqli_fetch_array($reqInscription))
{
?>
if(document.frmSubmit.date_naissance_<?=$lineInscription['id_inscription']?>.value != "" && checkDate(document.frmSubmit.date_naissance_<?=$lineInscription['id_inscription']?>.value) == false)
{
alert("Merci d'indiquer une date de naissance valide");
document.frmSubmit.date_naissance_<?=$lineInscription['id_inscription']?>.focus();
return false;
}
<?php
}
?>
return true
}
</script>
<style type="text/css">
/* General styles */
body { margin: 0; padding: 0; font: 11px Calibri, Arial,Helvetica,sans-serif; color: #111; background-color: #FFF; }
a:hover{
color:#0172b6;
}
a{
color:#0172b6;
}
a:visited{
color:#0172b6;
}
h2 { margin: 0px; padding: 10px; font-family: Georgia, "Times New Roman", Times, serif; font-size: 200%; font-weight: normal; color: #FFF; background-color: #CCC; border-bottom: #BBB 2px solid; }
/* Form styles */
div.form-container {margin: auto; padding: 5px;}
p.legend { margin-bottom: 1em; }
p.legend em { color: #C00; font-style: normal; }
div.form-container form p { margin: 0; }
div.form-container form p.note { margin-left: 170px; font-size: 90%; color: #333; }
div.form-container form fieldset { margin: 10px 0; padding: 10px; border: #DDD 1px solid; }
div.form-container form legend { font-weight: bold; color: #000000; }
div.form-container form fieldset div { padding: 0.25em 0; }
div.form-container label,
div.form-container span.label { margin-right: 10px; padding-right: 10px; width: 150px; display: block; float: left; text-align: right; position: relative; }
div.form-container label em,
div.form-container span.label em { position: absolute; right: 0; font-size: 120%; font-style: normal; color: #C00; }
div.form-container input:focus,
div.form-container textarea:focus { background-color: #FFC; border-color: #FC6; }
div.form-container div.controlset label,
div.form-container div.controlset input { display: inline; float: none; }
div.form-container div.controlset div { margin-left: 170px; }
div.form-container div.buttonrow { margin: 4px;; text-align:center;}
#divAdhesion { margin: auto; text-align:center; border-width:2px; border-style:solid; border-color:#000000;}
#messageNonMembre { text-align:center; font-size: 12px; font-weight: bold;color:#FF0000;}
#libelleMembre { font-size: 12px; font-weight: bold;}
#checkboxMembre { font-size: 14px; font-weight: bold;}
#prix { font-size: 16px; font-weight: bold;}
</style>
</head>
<body>
<div id="header" style="border: 1px solid #8a959b; width: 752px; margin: auto;">
<table width="100%" cellspacing="0" cellpaddin="0">
<tr>
<td width="50%">
<img src="/evenements/images/logo_faf.jpg" alt="logo FAF" style="float: left; margin: 30px;" width="300">
</td>
<td width="50%">
<p style="font-size: 24px;font-weight:bold; color:#0172b6; text-align:right; margin: 30px;">Adhésion individuelle <?=date("Y")?></p>
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#0172b6; width: 100%;">
<div style="text-align: center; color:#ffffff; font-size: 20px;"><b>Devenir membre de la French-American Foundation – France</b></div>
<div style="text-align: center; color:#ffffff; font-size: 18px;"><b></b></div>
</td>
</tr>
<tr>
<td colspan="2" style="width: 100%;">
<div class="form-container">
<form action="/evenements/paiement_inscription.php" method="post" name="frmSubmit" onSubmit="return verification()">
<fieldset>
<legend>Type de cotisation</legend>
<table width="100%">
<tr>
<td width="50%">
<div><input id="type_cotisation_i" name="type_cotisation" onchange="document.getElementById('individuelle').style.display = 'block';document.getElementById('collective').style.display = 'none';" size="25" type="radio" value="individuelle"><label for="type_cotisation" style="width: 190px;line-height: 17px;margin-right: 0px;padding-right: 0px;">Cotisation individuelle à titre personnel</label></div>
</td>
<td width="50%">
<div><input id="type_cotisation_e" name="type_cotisation" onchange="document.getElementById('individuelle').style.display = 'none';document.getElementById('collective').style.display = 'block';" size="25" type="radio" value="entreprise"><label for="type_cotisation" style="width: 190px;line-height: 17px;margin-right: 0px;padding-right: 0px;">Cotisation individuelle à titre d’entreprise</label></div>
</td>
</tr>
</table>
</fieldset>
<fieldset id="individuelle" style="display:none;">
<legend>Cotisation individuelle à titre personnel</legend>
<table width="100%">
<tr>
<td>
<div><label for="civilite_contact">Civilité <em>*</em></label> <select name="civilite_contact" id="civilite_contact"><option value="Madame">Madame</option><option value="Monsieur">Monsieur</option></select></div>
</td>
</tr>
<tr>
<td>
<div><label for="prenom_contact">Prénom <em>*</em></label> <input id="prenom_contact" name="prenom_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="nom_contact">Nom <em>*</em></label> <input id="nom_contact" name="nom_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="entreprise_contact">Entreprise</label> <input id="entreprise_contact" name="entreprise_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="fonction_contact">Fonction</label> <input id="fonction_contact" name="fonction_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="email_contact">Email <em>*</em></label> <input id="email_contact" name="email_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="telephone_contact">Téléphone portable <em>*</em></label> <input id="telephone_contact" size="25" name="telephone_contact" type="text"></div>
</td>
</tr>
<tr style="display:none;visibility:hidden;">
<td>
<div><label for="portable_contact">Téléphone portable</label> <input id="portable_contact" size="25" name="portable_contact" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="adresse_contact">Adresse de facturation <em>*</em></label> <input id="adresse_contact" name="adresse_contact" size="50" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="code_postal_contact">Code Postal <em>*</em></label> <input id="code_postal_contact" name="code_postal_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="ville_contact">Ville <em>*</em></label> <input id="ville_contact" name="ville_contact" size="25" type="text"></div>
</td>
</tr>
</table>
</fieldset>
<fieldset id="collective" style="display:none;">
<legend>Cotisation individuelle à titre d’entreprise</legend>
<table width="100%">
<tr>
<td>
<div><label for="civilite_contact_e">Civilité <em>*</em></label> <select name="civilite_contact_e" id="civilite_contact_e"><option value="Madame">Madame</option><option value="Monsieur">Monsieur</option></select></div>
</td>
</tr>
<tr>
<td>
<div><label for="prenom_contact_e">Prénom <em>*</em></label> <input id="prenom_contact_e" name="prenom_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="nom_contact_e">Nom <em>*</em></label> <input id="nom_contact_e" name="nom_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="entreprise_contact_e">Entreprise <em>*</em></label> <input id="entreprise_contact_e" name="entreprise_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="fonction_contact_e">Fonction <em>*</em></label> <input id="fonction_contact_e" name="fonction_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="email_contact_e">Email <em>*</em></label> <input id="email_contact_e" name="email_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="email_assistant_e">Email Assistant(e)</label> <input id="email_assistant_e" name="email_assistant_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="telephone_contact_e">Téléphone portable <em>*</em></label> <input id="telephone_contact_e" size="25" name="telephone_contact_e" type="text"></div>
</td>
</tr>
<tr style="display:none;visibility:hidden;">
<td>
<div><label for="portable_contact_e">Téléphone portable</label> <input id="portable_contact_e" size="25" name="portable_contact_e" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="portable_assistant_e">Téléphone Assistant(e)</label> <input id="portable_assistant_e" size="25" name="portable_assistant_e" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="adresse_contact_e">Adresse professionnelle <em>*</em></label> <input id="adresse_contact_e" name="adresse_contact_e" size="50" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="code_postal_contact_e">Code Postal <em>*</em></label> <input id="code_postal_contact_e" name="code_postal_contact_e" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="ville_contact_e">Ville <em>*</em></label> <input id="ville_contact_e" name="ville_contact_e" size="25" type="text"></div>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><b>Niveaux d’adhésions : </b></legend>
<table width="100%">
<?php
$reqInscription = mysqli_query($link_bdd,"select * from inscriptions where id_inscription <= 5 order by ordre_affichage");
$checked = "checked";
$montant_initial = 0;
while($lineInscription = mysqli_fetch_array($reqInscription))
{
?>
<tr>
<td>
<div style="float:left; width:30px;";><input type="radio" id="inscription" name="inscription" <?=$checked?> value="<?=$lineInscription['id_inscription']?>" onclick="document.getElementById('montant').value=document.getElementById('inscription_<?=$lineInscription['id_inscription']?>').value; document.getElementById('tarif').innerHTML=document.getElementById('inscription_<?=$lineInscription['id_inscription']?>').value + '€';" /></div><div style="float:left; width:400px;";><?=$lineInscription['libelle_inscription']?><input type="hidden" name="inscription_<?=$lineInscription['id_inscription']?>" id="inscription_<?=$lineInscription['id_inscription']?>" value="<?=$lineInscription['montant_inscription']?>" /></div>
<?php
if ($lineInscription['presence_date_naissance'] == 'oui')
{
?>
<div style="float:left; width:30px;clear:both;";> </div><div style="float:left; width:500px;";>Merci d'indiquer votre date de naissance (jour/mois/année) : <input id="date_naissance_<?=$lineInscription['id_inscription']?>" name="date_naissance_<?=$lineInscription['id_inscription']?>" size="14" type="text" /></div>
<?php
}
?>
</td>
</tr>
<?php
if ($montant_initial == 0)
{
$montant_initial = $lineInscription['montant_inscription'];
}
$checked = "";
}
?>
</table>
</fieldset>
<table width="100%">
<tr>
<td align="left" width="20%">
<div id="prix">
TARIF : <span style="color:#0172b6;" id="tarif"><?=$montant_initial?> €</span><input type="hidden" name="montant" id="montant" value="<?=$montant_initial?>" />
</div>
</td>
<td align="left" width="22%">
</td>
<td align="left" width="58%">
</td>
</tr>
<tr>
<td>
</td>
<td style="vertical-align:top;">
</td>
<td rowspan="2">
<!--<div id="divAdhesion">Vous pouvez dès à présent télécharger le bulletin d’adhésion pour 2017 via le lien suivant : <br /><a href="Adhesion_indiv-2020.pdf" target="_blank">Bulletin d'adhésion 2020</a></div>-->
</td>
</tr>
<tr>
<td align="left" width="20%" colspan="4">
<div id="prix">
<?php
echo '<table width="70%">';
echo '<tr>';
echo '<td colspan="2">';
echo '<u>Mode de règlement (pour facture et recu fiscal)</u>';
echo '</td>';
echo '</tr>';
echo '</table>';
?>
</div>
</td>
</tr>
<tr>
<td align="left" width="20%" colspan="4">
<div id="prix">
<?php
echo '<table width="70%">';
echo '<tr>';
echo '<td>';
echo 'Paiement en ligne';
echo '</td>';
echo '<td>';
echo '<INPUT type=radio name="type_paiement" checked onclick="document.getElementById(\'messageCheque\').style.display=\'none\';" value="PAYPAL" /> Carte personnelle <INPUT type=radio name="type_carte" onclick="document.getElementById(\'adressepersonnelle\').style.display=\'block\';" value="carte personnelle" /> Carte professionnelle <INPUT type=radio onclick="document.getElementById(\'adressepersonnelle\').style.display=\'none\';" name="type_carte" checked value="carte professionnelle" /><br />';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Chèque';
echo '</td>';
echo '<td>';
echo '<INPUT type=radio name="type_paiement" onclick="document.getElementById(\'messageCheque\').style.display=\'block\';" value="CHEQUE" />';
echo '</td>';
echo '</tr>';
echo '</table>';
?>
</div>
</td>
</tr>
<tr>
<td align="left" width="20%" colspan="3">
<div id="messageCheque" style="display:none;">
« Les chèques bancaires sont à libeller à l’ordre de la <strong>French-American Foundation – France</strong>, 18 bis boulevard Arago, 75013 Paris. »
</div>
</td>
</tr>
</table>
<div class="buttonrow">
<input value="Valider Votre Inscription" style="height: 30px; width: 170px;" name="envoiForm" type="submit">
</div>
</form>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>