File: /home/f/r/e/frenchy/refonte2023/wordpress/evenements/index2-us.php
<?php
require_once("_mysql.php");
setlocale (LC_TIME, 'en_US.utf8');
$id_evenement = '';
if (isset($_GET['id_evenement']) || isset($_GET['id']))
{
if (isset($_GET['id_evenement']))
{
$id_evenement = $_GET['id_evenement'];
}
else
{
$id_evenement = $_GET['id'];
}
$req = mysqli_query($link_bdd,"select * from evenements where id_evenement = ".$id_evenement." and date_debut_evenement <= '".date("Y-m-d")."' and date_fin_evenement >= '".date("Y-m-d")."'");
if (mysqli_num_rows($req) != 0)
{
$line = mysqli_fetch_array($req);
}
else
{
die ("This event doesn't exist");
}
}
else
{
die ("This event doesn't exist");
}
?>
<!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>Event <?=$line['libelle_evenement']?></title>
<script type="text/javascript">
function verification()
{
if(document.frmSubmit.email_contact.value == "")
{
alert("Please enter a valid email address");
document.frmSubmit.email_contact.focus();
return false;
}
if(document.frmSubmit.email_contact.value.indexOf('@') == -1)
{
alert("Please enter a valid email address");
document.frmSubmit.email_contact.focus();
return false;
}
if(document.frmSubmit.civilite_contact.value == "")
{
alert("Please enter your civility");
document.frmSubmit.civilite_contact.focus();
return false;
}
if(document.frmSubmit.prenom_contact.value == "")
{
alert("Please enter your first name");
document.frmSubmit.prenom_contact.focus();
return false;
}
if(document.frmSubmit.nom_contact.value == "")
{
alert("Please enter your last name");
document.frmSubmit.nom_contact.focus();
return false;
}
if(document.frmSubmit.telephone_contact.value == "")
{
alert("Please enter your phone number");
document.frmSubmit.telephone_contact.focus();
return false;
}
if(document.frmSubmit.entreprise_contact.value == "")
{
alert("Please enter your company");
document.frmSubmit.entreprise_contact.focus();
return false;
}
if(document.frmSubmit.fonction_contact.value == "")
{
alert("Please enter your position in the company");
document.frmSubmit.fonction_contact.focus();
return false;
}
if(document.frmSubmit.adresse_entreprise_contact.value == "")
{
alert("Please enter your company address");
document.frmSubmit.adresse_entreprise_contact.focus();
return false;
}
if(document.frmSubmit.code_postal_entreprise_contact.value == "")
{
alert("Please enter your company zip code");
document.frmSubmit.code_postal_entreprise_contact.focus();
return false;
}
if(document.frmSubmit.ville_entreprise_contact.value == "")
{
alert("Please enter your company city");
document.frmSubmit.ville_entreprise_contact.focus();
return false;
}
if(document.frmSubmit.inscription_contact && document.frmSubmit.inscription_contact.selectedIndex == 0 && document.frmSubmit.membre_contact[1].checked)
{
alert("Please enter your registration");
document.frmSubmit.inscription_contact.focus();
return false;
}
if(document.frmSubmit.montant_total.value == "" || document.frmSubmit.montant_total.value == "0")
{
alert("Please enter your registration");
return false;
}
return true
}
function toutcalc()
{
if (document.getElementById('checkbox_don').checked && (document.getElementById('checkbox_journee').checked || document.getElementById('checkbox_diner').checked))
{
document.getElementById('checkbox_don').checked = false;
don_sup = document.getElementById('don_sup').value = '';
alert ("These choices are incompatible");
}
var radio_journee = 0;
var journee_sup = 0;
if (document.getElementById('journee_sup').value != '' && !isNaN(document.getElementById('journee_sup').value))
{
var journee_sup = document.getElementById('journee_sup').value;
document.getElementById('checkbox_journee').checked = true;
}
if (document.getElementById('checkbox_journee').checked) { radio_journee = 250;}
var journee_diner = 0;
var diner_sup = 0;
if (document.getElementById('diner_sup').value != '' && !isNaN(document.getElementById('diner_sup').value))
{
var diner_sup = document.getElementById('diner_sup').value;
if (!document.frmSubmit.radio_diner[0].checked && !document.frmSubmit.radio_diner[1].checked)
{
document.frmSubmit.radio_diner[0].checked = true;
}
}
if (document.frmSubmit.radio_diner[0].checked) { journee_diner = 500; document.getElementById('checkbox_diner').checked = true; }
if (document.frmSubmit.radio_diner[1].checked) { journee_diner = 750; document.getElementById('checkbox_diner').checked = true; }
var don_sup = 0;
if (document.getElementById('checkbox_don').checked)
{
if (document.getElementById('don_sup').value != '' && !isNaN(document.getElementById('don_sup').value))
{
don_sup = document.getElementById('don_sup').value;
}
}
else
{
document.getElementById('don_sup').value = '';
}
document.getElementById('total').innerHTML = parseInt(radio_journee) + parseInt(journee_sup) + parseInt(journee_diner) + parseInt(diner_sup) + parseInt(don_sup);
document.getElementById('montant_total').value = document.getElementById('total').innerHTML;
}
</script>
<style type="text/css">
/* General styles */
body { margin: 0; padding: 0; font: 80%/1.5 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;}
#divfiscal {margin: auto; padding:10px; text-align:left; border-width:1px; 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;">Inscription</p>
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#0172b6; width: 100%;">
<div style="text-align: center; color:#ffffff; font-size: 20px;"><b><?=utf8_encode(html_entity_decode($line['libelle_evenement']))?></b></div>
<?php
if ($line['descriptif_evenement'] != '')
{
?>
<div style="text-align: center; color:#ffffff; font-size: 14px;"><b><?=nl2br($line['descriptif_evenement'])?></b></div>
<?php
}
?>
<div style="text-align: center; color:#ffffff; font-size: 18px;"><b>november 18-19, 2011</b></div>
</td>
</tr>
<tr>
<td colspan="2" style="width: 100%;">
<div class="form-container">
<form action="/evenements/paiement2-us.php" method="post" name="frmSubmit" onSubmit="return verification()">
<input type="hidden" name="id_evenement" value="<?=$id_evenement?>">
<fieldset>
<legend>Contact</legend>
<table width="100%">
<tr>
<td>
<div><label for="email_contact">Email <em>*</em></label> <input id="email_contact" name="email_contact" size="25" type="text"><input id="email" name="email" type="hidden" value="" /></div>
</td>
</tr>
<tr>
<td>
<div><label for="civilite_contact">Civility <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">First Name <em>*</em></label> <input id="prenom_contact" name="prenom_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="nom_contact">Last Name <em>*</em></label> <input id="nom_contact" name="nom_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="telephone_contact">Mobile phone<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">Mobile phone</label> <input id="portable_contact" size="25" name="portable_contact" type="text"></div>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Entreprise</legend>
<table width="100%">
<tr>
<td>
<div><label for="entreprise_contact">Company <em>*</em></label> <input id="entreprise_contact" name="entreprise_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="fonction_contact">Position <em>*</em></label> <input id="fonction_contact" name="fonction_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="adresse_entreprise_contact">Address <em>*</em></label> <input id="adresse_entreprise_contact" name="adresse_entreprise_contact" size="50" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="code_postal_entreprise_contact">Zip Code <em>*</em></label> <input id="code_postal_entreprise_contact" name="code_postal_entreprise_contact" size="25" type="text"></div>
</td>
</tr>
<tr>
<td>
<div><label for="ville_entreprise_contact">City <em>*</em></label> <input id="ville_entreprise_contact" name="ville_entreprise_contact" size="25" type="text"></div>
</td>
</tr>
</table>
</fieldset>
<table width="100%">
<tr>
<td width="50%">
<div>
<input id="checkbox_journee" name="checkbox_journee" type="checkbox" onclick="if (document.frmSubmit.checkbox_journee.checked) {toutcalc();} else { document.getElementById('journee_sup').value = ''; toutcalc(); }" /> <span style="font-weight:bold; color:#0172b6; text-decoration:underline;">Journées du trentième anniversaire</span>
<table width="100%">
<tr>
<td width="180px">
Participation aux frais
</td>
<td>
250 $
</td>
</tr>
<tr>
<td width="180px">
</td>
<td>
</td>
</tr>
<tr>
<td width="180px">
Don Trentième anniversaire
</td>
<td>
<input type="text" name="journee_sup" id="journee_sup" size="6" onchange="toutcalc()"/> $
</td>
</tr>
</table>
</div>
</td>
<td width="50%">
<div><input id="checkbox_diner" name="checkbox_diner" type="checkbox" onclick="if (document.frmSubmit.checkbox_diner.checked) { if (!document.frmSubmit.radio_diner[0].checked && !document.frmSubmit.radio_diner[1].checked) {document.frmSubmit.radio_diner[0].checked = true;} toutcalc();} else { document.getElementById('diner_sup').value = ''; document.frmSubmit.radio_diner[0].checked = false; document.frmSubmit.radio_diner[1].checked = false; toutcalc();}" /> <span style="font-weight:bold; color:#0172b6; text-decoration:underline;">Dîner de Gala</span>
<table width="100%">
<tr>
<td width="180px">
<input id="radio_diner" name="radio_diner" type="radio" value="individuel" onclick="toutcalc()" /> Individuel
</td>
<td>
500 $
</td>
</tr>
<tr>
<td width="180px">
<input id="radio_diner" name="radio_diner" type="radio" value="couple" onclick="toutcalc()" /> Couple
</td>
<td>
750 $
</td>
</tr>
<tr>
<td width="180px">
Don Gala
</td>
<td>
<input type="text" name="diner_sup" id="diner_sup" size="6" onchange="toutcalc()" /> $
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2">
<div><input id="checkbox_don" name="checkbox_don" type="checkbox" onclick="toutcalc()" /> Je ne participerai pas aux célébrations du trentième anniversaire mais je souhaite faire un don à la French-American Foundation – France pour soutenir le financement de ses activités.</div>
<table width="100%">
<tr>
<td width="180px">
Don
</td>
<td>
<input type="text" name="don_sup" id="don_sup" size="6" onchange="toutcalc()" /> $
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%">
<tr>
<td width="180px">
</td>
<td>
</td>
</tr>
</table>
</td>
<td>
<table width="100%">
<tr>
<td width="180px" colspan="2">
Montant total de votre règlement : <strong><span id="total">0</span> $</strong><input type="hidden" name="montant_total" id="montant_total" value="" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<div id="divfiscal">
<p style="font-weight:bold; color:#0172b6; text-decoration:underline;">Avantages fiscaux pour les particuliers :</p>
<p style="font-weight:bold; color:#FF0000; text-decoration:none;">Un reçu fiscal vous sera délivré sur demande par la French-American Foundation – France.</p>
</div>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td align="left" width="20%" colspan="2">
<div id="prix">
<?php
if ($line['mode_paiement'] == 'CHEQUE+PAYPAL')
{
echo '<table width="30%">';
echo '<tr>';
echo '<td colspan="2">';
echo 'Mode de règlement';
echo '</td>';
echo '</tr>';
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" /><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>';
}
else
{
echo '<INPUT type=hidden name="type_paiement" value="'.$line['mode_paiement'].'" />';
}
?>
</div>
</td>
</tr>
<?php
if ($line['mode_paiement'] == 'CHEQUE')
{
?>
<tr>
<td align="left" width="20%" colspan="3">
<div id="messageCheque" style="display:block;">
« Les chèques bancaires sont à libeller à l’ordre de le <strong>French-American Foundation – France</strong>, 18 bis boulevard Arago, 75013 Paris. »
</div>
</td>
</tr>
<?php
}
?>
<?php
if ($line['mode_paiement'] == 'CHEQUE+PAYPAL')
{
?>
<tr>
<td align="left" width="20%" colspan="3">
<div id="messageCheque" style="display:none;">
« Les chèques bancaires sont à libeller à l’ordre de le <strong>French-American Foundation – France</strong>, 18 bis boulevard Arago, 75013 Paris. »
</div>
</td>
</tr>
<?php
}
?>
</table>
<div class="buttonrow">
<input value="Confirm Your Registration" style="height: 30px; width: 170px;" name="envoiForm" type="submit">
</div>
</form>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>