HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/frenchy/refonte2023/wordpress/evenements/paiement-gala-2012.php
<?php
require_once("_mysql.php");
require_once("admin/phpmailer/class.phpmailer.php");
setlocale (LC_TIME, 'fr_FR.utf8','fra');
if (isset($_POST['email']) && $_POST['email'] != "")
{
  die("Robot");
}
$erreur = '';
if (isset($_POST['id_evenement']))
{
  $id_evenement = $_POST['id_evenement'];
  $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 ("Aucun evenement ne correspond");
  }
}
else
{
  die ("Aucun evenement ne correspond");
}
if (isset($_POST['envoiForm']))
{
  $type_paiement = 'NON PAYE PAYPAL';
  if ($_POST['type_paiement'] == 'CHEQUE')
  {
    $type_paiement = 'CHEQUE';
  }
  $montant = $_POST['totalhidden'];
  if ($montant == 0)
  {
    $type_paiement ='AUCUN';
  }
  
  $choix = $_POST['choixradio'];
  $nbreChoix = 0;
  $don = $_POST['don'];
  if ($choix != 6)
  {
    $nbreChoix = $_POST['selectradio'.$_POST['choixradio']];
  }
  $choix = $choix."|".$nbreChoix."|".$don;
  
  mysqli_query($link_bdd, "INSERT INTO `contactsgala2012` ( `civilite_contact`, `prenom_contact`, `nom_contact`, `fonction_contact`, `entreprise_contact`, `telephone_contact`, `portable_contact`, `email_contact`, `adresse_entreprise_contact`, `code_postal_entreprise_contact`, `ville_entreprise_contact`, `id_evenement`, `montant_paiement`, `top_paiement`, `choix`) VALUES
                                      ( '".mysqli_real_escape_string($link_bdd, $_POST['civilite_contact'])."', '".mysqli_real_escape_string($link_bdd, $_POST['prenom_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['nom_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['fonction_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['entreprise_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['telephone_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['portable_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['email_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['adresse_entreprise_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['code_postal_entreprise_contact'])."','".mysqli_real_escape_string($link_bdd, $_POST['ville_entreprise_contact'])."',".$id_evenement.",'".mysqli_real_escape_string($link_bdd, $montant)."','".$type_paiement."','".$choix."')");

  $id_contact = mysqli_insert_id($link_bdd);

  // Gestion email Cheque
  if ($type_paiement =='CHEQUE' || $type_paiement =='AUCUN' || $montant == 0)
  {
    // Specifique Facture
    $Specifique = "";
    
    // On envoi un mail
    $subject = "Confirmation inscription : GALA 2012 du MARDI 27 NOVEMBRE 2012";
    $fd = fopen("mailconfirmation-gala2012.htm", "r");
    $message = fread($fd, filesize('mailconfirmation-gala2012.htm'));
    fclose($fd);
    
    $ligne1 = "<td width='50%'>GALA 2012 du MARDI 27 NOVEMBRE 2012</td><td width='50%'>&nbsp;</td>";
    
    $ligne2 = "<td width='50%'>";
    if ($choix[0] == '0')
    {
      $ligne2 .= "Table(s) 10 personnes : M&eacute;c&egrave;ne - ".$nbreChoix." X 15 000&euro;<br />";
    }
    if ($choix[0] == '1')
    {
      $ligne2 .= "Table(s) 10 personnes : Bienfaiteur - ".$nbreChoix." X 10 000&euro;<br />";
    }
    if ($choix[0] == '2')
    {
      $ligne2 .= "Table(s) 10 personnes : Donateur - ".$nbreChoix." X 7 500&euro;<br />";
    }
    if ($choix[0] == '3')
    {
      $ligne2 .= "Place(s) Individuelle(s) : M&eacute;c&egrave;ne - ".$nbreChoix." X 1 500&euro;<br />";
    }
    if ($choix[0] == '4')
    {
      $ligne2 .= "Place(s) Individuelle(s) : Bienfaiteur - ".$nbreChoix." X 1 000&euro;<br />";
    }
    if ($choix[0] == '5')
    {
      $ligne2 .= "Place(s) Individuelle(s) : Donateur - ".$nbreChoix." X 750&euro;<br />";
    }
    if ($choix[0] == '6')
    {
      $ligne2 .= "Je ne participerai pas au Gala de la French-American Foundation - France<br />";
    }
    if ($don != 0)
    {
      $ligne2 .= "Don au profit de la French-American Foundation - France";
    }
    $ligne2 .= "</td>";
    $ligne2 .= "<td width='50%'>";
    $ligne2 .= "&nbsp;";
    if ($choix[0] == '0')
    {
      $ligne2 .= number_format($nbreChoix*15000, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '1')
    {
      $ligne2 .= number_format($nbreChoix*10000, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '2')
    {
      $ligne2 .= number_format($nbreChoix*7500, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '3')
    {
      $ligne2 .= number_format($nbreChoix*1500, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '4')
    {
      $ligne2 .= number_format($nbreChoix*1000, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '5')
    {
      $ligne2 .= number_format($nbreChoix*750, 2, ',', ' ')."&euro;<br />";
    }
    if ($choix[0] == '6')
    {
      $ligne2 .= "Gratuit<br />";
    }
    if ($don != 0)
    {
      $ligne2 .= number_format($don, 2, ',', ' ')."&euro;<br />";
    }
    $ligne2 .= "</td>";
    if ($montant != 0)
    {
      $ligne3 = "<td width='50%'><b>Total r&eacute;gl&eacute;</b></td><td width='50%'><b>".number_format($montant, 2, ',', ' ')."&euro;</b></td>";
    }
    else
    {
      $ligne3 = "";
    }
    $message = str_replace("%LIGNEPAIEMENT%", "", $message);
    if ($montant != 0)
    {
      $message = str_replace("%FACTUREJOINTE%", "Vous trouverez en pi&egrave;ce jointe votre facture.", $message);
      $message = str_replace("%MESSAGE1%", "<p>Merci d'envoyer votre r&egrave;glement par ch&egrave;que libell&eacute; &agrave; l'ordre de la French-American Foundation - France, 18 bis boulevard Arago, 75013 Paris <br />Votre inscription sera confirm&eacute;e d&egrave;s r&eacute;ception de votre r&egrave;glement.</p>", $message);
    }
    else
    {
      $message = str_replace("%FACTUREJOINTE%", "&nbsp;", $message);
      $message = str_replace("%MESSAGE1%", "&nbsp;", $message);
    }
    $message = str_replace("%DATEEVENEMENT%", "MARDI 27 NOVEMBRE 2012", $message);
    $message = str_replace("%LIGNE1%", $ligne1, $message);
    $message = str_replace("%LIGNE2%", $ligne2, $message);
    $message = str_replace("%LIGNE3%", $ligne3, $message);
    $message = str_replace("%LIBELLEEVENEMENT%", "GALA 2012", $message);
    $message = str_replace("%ENTETENOM%", stripcslashes($_POST['civilite_contact'] . " " . $_POST['prenom_contact'] . " " . $_POST['nom_contact']), $message);
    // Envoi de la copie du pdf
    $reqContact = mysqli_query($link_bdd, "select * from contactsgala2012 where id_contact=".$id_contact);
    $lineContact = mysqli_fetch_array($reqContact);
    $type_paiement = 'CHEQUE';
    $designation = "GALA 2012 du MARDI 27 NOVEMBRE 2012";
    if ($montant !=0)
    {
      require_once("admin/pdf/genepdfgala2012.php");
    }
    // PHP Mailer
    $mail = new PHPmailer();
    $mail->IsSMTP();                                  // send via SMTP
    $mail->Mailer = "smtp";                           // Mode d'acces
    $mail->Host = "smtp.outlook.office365.com";       // SMTP servers
    $mail->SMTPAuth = true;                           // turn on SMTP authentification
    $mail->Username = "sendmail@french-american.org";   // SMTP username
    $mail->Password = "SE4848+1";                      // SMTP password
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;
    $mail->IsHTML(true);
    $mail->Sender = "contact@french-american.org";
    $mail->From="contact@french-american.org";
    $mail->FromName="French-american.org";
    $mail->AddReplyTo("contact@french-american.org");
    if ($montant !=0)
    {
      $mail->AddAttachment("admin/pdf/factures/".$nompdf);
    }
    $mail->Subject=$subject;
    $mail->Body=utf8_decode($message);
    $mail->ClearAddresses();
    $mail->AddAddress($_POST['email_contact']);
    if ($line['confirmation'] != 'non')
    {
      if (!$mail->Send())
      {
        echo '<script>document.location.href="http://www.french-american.org/evenements/merci.php?id_evenement='.$id_evenement.'&top=ko";</script>';
      }
    }
    
    if ($montant !=0)
    {
      // PHP Mailer
      $mail2 = new PHPmailer();
      $mail2->IsSMTP();                                  // send via SMTP
      $mail2->Mailer = "smtp";                           // Mode d'acces
      $mail2->Host = "smtp.outlook.office365.com";       // SMTP servers
      $mail2->SMTPAuth = true;                           // turn on SMTP authentification
      $mail2->Username = "sendmail@french-american.org";   // SMTP username
      $mail2->Password = "SE4848+1";                      // SMTP password
      $mail2->SMTPSecure = 'tls';
      $mail2->Port = 587;
      $mail2->IsHTML(true);
      $mail2->Sender = "contact@french-american.org";
      $mail2->From="contact@french-american.org";
      $mail2->FromName="French-american.org";
      $mail2->AddReplyTo("contact@french-american.org");
      $mail2->AddAttachment("admin/pdf/factures/".$nompdf);
      $mail2->Subject='Commande par Cheque Formulaire French American Foundation';
      $mail2->Body=utf8_decode($message);
      $mail2->ClearAddresses();
      $mail2->AddAddress('magali.durand@french-american.org');
      //$mail2->AddAddress('stephane.didier@live.fr');
      if (!$mail2->Send())
      {
        echo '<script>document.location.href="http://www.french-american.org/evenements/merci.php?id_evenement='.$id_evenement.'&top=ko";</script>';
      }
      @unlink("admin/pdf/factures/".$nompdf);
    }
    
    header('location:http://www.french-american.org/evenements/merci.php?id_evenement='.$id_evenement); 
    
  }
}

if ($id_evenement == '')
{
  die ("Aucun evenement ne correspond");
}

?>
<!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>Evenement <?=$line['libelle_evenement']?> - Merci de votre inscription</title>
<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: #666; }
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: auto; 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;}
#checkboxMembre { font-size: 14px; 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>18-19 novembre 2011</b></div>
</td>
</tr>
<tr>
<td colspan="2">
<?php
/* Debut de paiement Paypal */
echo '<font face=Verdana size=2><center><br><br>
Merci.<br /><br />Pour finaliser votre inscription, nous vous invitons à effectuer votre paiement en ligne d\'un montant de <b>'.($montant).' &euro;</b> par carte bancaire via Paypal.<br>
<br><br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type=hidden name="amount" value="'.number_format($montant, 2, '.', '').'">
<input type=hidden name="cmd" value="_xclick">
<input name="return" type="hidden" value="http://www.french-american.org/evenements/merci.php?id_evenement='.$id_evenement.'">
<input name="cancel_return" type="hidden" value="http://www.french-american.org/evenements/annule.php?id_evenement='.$id_evenement.'">
<input name="notify_url" type="hidden" value="http://www.french-american.org/evenements/ipn_paypalgalal2012.php?id_commande='.$id_contact.'">
<input type=hidden name="email" value="'.$_POST['email_contact'].'">
<input type=hidden name="currency_code" value="EUR">
<input type=hidden name="no_shipping" value="1">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="business_dev" value="'.'franck_1300481920_biz@netcourrier.com'.'">
<input type="hidden" name="business" value="'.'hugues.derevel@french-american.org'.'">
<input type=hidden name="item_name" value="Evenement '.$line['libelle_evenement'].'">
<input type=hidden name="no_note" value="1">
<input name="custom" type="hidden" value="'.$id_contact.'" />
<input type=submit name=submit value="Proc&eacute;der au paiement s&eacute;curis&eacute; par CB &gt;&gt;">
</form>
<br><br>';
/* Fin de paiement Paypal */
?>
</td>
</tr>
</table>
</div>
</body></html>