151 lines
5.8 KiB
PHP
151 lines
5.8 KiB
PHP
<?php
|
|
/*****************************************************************************
|
|
*
|
|
* Auteur : Bruno | atnos.com (contact: contact@atnos.com)
|
|
* Version : 0.1
|
|
* Date : 29/07/2007
|
|
*
|
|
* Copyright (C) 2007 Bruno PERLES
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
*****************************************************************************/
|
|
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Navigation.class.php");
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Venteprod.class.php");
|
|
include_once(realpath(dirname(__FILE__)) . "/config2.php");
|
|
|
|
session_start();
|
|
|
|
$total = 0;
|
|
|
|
$total = $_SESSION['navig']->commande->total;
|
|
|
|
|
|
?>
|
|
|
|
<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
<title>Paiement Paypal</title>
|
|
<style type="text/css">
|
|
/* CSS issu des tutoriels www.alsacreations.com/articles */
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background-color: #eee;
|
|
}
|
|
|
|
#global {
|
|
position:absolute;
|
|
left: 50%;
|
|
top: 50%;
|
|
width: 400px;
|
|
height: 150px;
|
|
margin-top: -75px; /* moitié de la hauteur */
|
|
margin-left: -200px; /* moitié de la largeur */
|
|
background-color: transparent;
|
|
text-align: center;
|
|
}
|
|
|
|
#global span {
|
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
font-size: 11px;
|
|
}
|
|
</style>
|
|
<body onLoad="document.getElementById('formpaypal').submit()">
|
|
<?php
|
|
|
|
// R?f?rence
|
|
$Reference_Cde = urlencode($_SESSION['navig']->commande->transaction);
|
|
|
|
// Montant
|
|
$Montant = $total;
|
|
|
|
?>
|
|
|
|
<div id="global">
|
|
<img src="cc_paypal/pp_secure_213wx37h.gif" alt="" /><br /><br />
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="1">
|
|
<tr>
|
|
<td><img src="cc_paypal/logo_ccAmex.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccAurora_37wx23h.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccCB_37wx23h.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccCofidis_37wx23h.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccCofinoga_22wx23h.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccMC.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_ccVisa.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/PayPal_mark_37x23.gif" alt="" /></td>
|
|
<td><img src="cc_paypal/logo_VIPwhite_66x27.gif" alt="" /></td>
|
|
</tr>
|
|
</table> <br />
|
|
<span>Merci de votre commande, vous allez être redirigé vers la page de paiement sécurisé Paypal, <strong>veuillez patienter...</strong></span>
|
|
</div>
|
|
|
|
|
|
<form action="<?php echo $serveur; ?>" id="formpaypal" method="post">
|
|
|
|
<input type="hidden" name="upload" value="1">
|
|
<input type="hidden" name="first_name" value="<?php echo $_SESSION["navig"]->client->prenom; ?>" />
|
|
<input type="hidden" name="last_name" value="<?php echo $_SESSION["navig"]->client->nom; ?>" />
|
|
<input type="hidden" name="address1" value="<?php echo $_SESSION["navig"]->client->adresse1; ?>" />
|
|
<?php
|
|
if($_SESSION["navig"]->client->adresse2 != ""){
|
|
?>
|
|
<input type="hidden" name="address2" value="<?php echo $_SESSION["navig"]->client->adresse2; ?>" />
|
|
<?php
|
|
}
|
|
?>
|
|
<input type="hidden" name="city" value="<?php echo $_SESSION["navig"]->client->ville; ?>" />
|
|
<input type="hidden" name="zip" value="<?php echo $_SESSION["navig"]->client->cpostal; ?>" />
|
|
<input type="hidden" name="amount" value="<?php echo round($Montant, 2); ?>" />
|
|
<input type="hidden" name="email" value="<?php echo $_SESSION["navig"]->client->email; ?>">
|
|
<input type="hidden" name="shipping_1" value="<?php echo $_SESSION["navig"]->commande->port; ?>" />
|
|
<input type="hidden" name="discount_amount_cart" value="<?php echo round($_SESSION["navig"]->commande->codereduction, 2); ?>" />
|
|
<?php
|
|
$venteprod = new Venteprod();
|
|
$query = "select * from $venteprod->table where commande=".$_SESSION["navig"]->commande->id;
|
|
$resul = mysql_query($query);
|
|
$i=0;
|
|
while($row = mysql_fetch_object($resul)){
|
|
$i++;
|
|
?>
|
|
<input type="hidden" name="item_name_<?php echo($i); ?>" value="<?php echo trim($row->titre); ?>" />
|
|
<input type="hidden" name="amount_<?php echo($i); ?>" value="<?php echo $row->prixu; ?>" />
|
|
<input type="hidden" name="quantity_<?php echo($i); ?>" value="<?php echo $row->quantite; ?>" />
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<input type="hidden" name="business" value="<?php echo $compte_paypal; ?>" />
|
|
<input type="hidden" name="receiver_email" value="<?php echo $compte_paypal; ?>" />
|
|
<input type="hidden" name="cmd" value="_cart" />
|
|
<input type="hidden" name="currency_code" value="<?php echo $Devise; ?>" />
|
|
<input type="hidden" name="payer_id" value="<?php echo $_SESSION["navig"]->client->id; ?>" />
|
|
<input type="hidden" name="payer_email" value="<?php echo $_SESSION["navig"]->client->email; ?>" />
|
|
<input type="hidden" name="return" value="<?php echo $retourok; ?>" />
|
|
<input type="hidden" name="notify_url" value="<?php echo $confirm; ?>" />
|
|
<input type="hidden" name="cancel_return" value="<?php echo $retournok; ?>" />
|
|
<input type="hidden" name="invoice" value="<?php echo $Reference_Cde; ?>" />
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|