302 lines
11 KiB
PHP
302 lines
11 KiB
PHP
|
|
<?php
|
|||
|
|
// ####################################################
|
|||
|
|
// pedido_ok.php
|
|||
|
|
// parte de shoop
|
|||
|
|
// <20> ff 2005
|
|||
|
|
|
|||
|
|
// wfcart siempre antes del inicio de sesion
|
|||
|
|
include('_incl/wfCart.php');
|
|||
|
|
session_start();
|
|||
|
|
|
|||
|
|
// ini_set ('error_reporting', E_ALL);
|
|||
|
|
// ini_set ('display_errors', '1');
|
|||
|
|
|
|||
|
|
include('db.php');
|
|||
|
|
include('_incl/code.php');
|
|||
|
|
|
|||
|
|
include('_config.php');
|
|||
|
|
|
|||
|
|
$visa_ok = 0;
|
|||
|
|
|
|||
|
|
if(isset($_REQUEST['pof'])) { // vengo de la visa
|
|||
|
|
if($_REQUEST['tes'] == 0) { // pago realizado
|
|||
|
|
$visa_ok = 1;
|
|||
|
|
} else { // pago no realizado
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
$pedidoID = substr($_REQUEST['pof'], 5) + 0; // la suma convierte el string en num
|
|||
|
|
$clienteID = $pedidoID;
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|||
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|||
|
|
<title>clave audio</title>
|
|||
|
|
<link href="_incl/ca.css" rel="stylesheet" type="text/css" />
|
|||
|
|
<script type="text/javascript" src="_incl/code.js"></script>
|
|||
|
|
<link href="_incl/ca.css" rel="stylesheet" type="text/css" />
|
|||
|
|
<link href="_incl/sformi.css" rel="stylesheet" type="text/css" />
|
|||
|
|
<link href="_incl/banners.css" rel="stylesheet" type="text/css" />
|
|||
|
|
<script type="text/javascript" src="_incl/code.js"></script>
|
|||
|
|
<style type="text/css">
|
|||
|
|
<!--
|
|||
|
|
.capi {
|
|||
|
|
font-size: 16px;
|
|||
|
|
color: #FF6600;
|
|||
|
|
font-weight: bold;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
label, .input2 {
|
|||
|
|
display: block;
|
|||
|
|
width: 120px;
|
|||
|
|
float: left;
|
|||
|
|
margin-bottom: 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
label {
|
|||
|
|
text-align: right;
|
|||
|
|
width: 75px;
|
|||
|
|
padding-right: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
br {
|
|||
|
|
clear: left;
|
|||
|
|
}
|
|||
|
|
.Estilo1 {
|
|||
|
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|||
|
|
font-size: 14px;
|
|||
|
|
}
|
|||
|
|
-->
|
|||
|
|
</style>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<?php
|
|||
|
|
include("top.htm");
|
|||
|
|
?>
|
|||
|
|
<table border="0" align="center" cellpadding="0" cellspacing="0">
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="168" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="168" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="168" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td><img src="_imgs/d.gif" width="168" height="12"></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td valign="top" width="168"><ul id="menuTree">
|
|||
|
|
<li class="mudo"><a href="clavefaq.php" class="parent upper">Preguntas Frecuentes</a></li></ul>
|
|||
|
|
<?php
|
|||
|
|
$conn = db_connect();
|
|||
|
|
if($conn) {
|
|||
|
|
$query = "SELECT faq_pregunta, faq_respuesta FROM shoop_faq WHERE faq_seccion >= 2 AND faq_seccion <=4 ORDER BY RAND() LIMIT 1 ";
|
|||
|
|
$result = mysql_query($query, $conn);
|
|||
|
|
if($result) {
|
|||
|
|
$row = mysql_fetch_array($result);
|
|||
|
|
?>
|
|||
|
|
<div class="qa"><span class="capi">¿</span><b><?php echo stripslashes($row['faq_pregunta']); ?>?</b><br /><?php echo stripslashes($row['faq_respuesta']); ?></div>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
</td>
|
|||
|
|
<td background="_imgs/ptos.gif"></td>
|
|||
|
|
<td colspan="5" width="528" valign="top"><p><img src="_imgs/titPedido.gif" width="325" height="20"><br>
|
|||
|
|
<img src="_imgs/g.gif" width="528" height="1"><br><br>
|
|||
|
|
<?php
|
|||
|
|
// ####################################################
|
|||
|
|
// cargo el carrito o lo creo nuevo si fuera menester
|
|||
|
|
|
|||
|
|
$cart =& $_SESSION['cart'];
|
|||
|
|
if(!is_object($cart)) $cart = new wfCart();
|
|||
|
|
|
|||
|
|
$numProducts = 0;
|
|||
|
|
|
|||
|
|
if(is_object($cart)) {
|
|||
|
|
$numProducts = $cart->itemcount;
|
|||
|
|
$subTotal = $cart->total;
|
|||
|
|
} else {
|
|||
|
|
|
|||
|
|
// ####################################################
|
|||
|
|
// OJO: como he llegado aqui sin pedido?
|
|||
|
|
}
|
|||
|
|
if(isset($_SESSION['clave.cliente'])) {
|
|||
|
|
$pedidoID = $_SESSION['clave.pedido'];
|
|||
|
|
$clienteID = $_SESSION['clave.cliente'];
|
|||
|
|
$formapago = $_SESSION['clave.pago'];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$conn = db_connect();
|
|||
|
|
if(!$conn) {
|
|||
|
|
// no tengo conexion
|
|||
|
|
echo '<p class="trece">Ha ocurrido un error intentando conectsar con la base de datos. Intentelo de nuevo pasados unos minutos o pongase en contacto con nosotros en el teléfono 91 401 63 07';
|
|||
|
|
exit;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<?php
|
|||
|
|
if($visa_ok) {
|
|||
|
|
?>
|
|||
|
|
<p class="trece">Sistema 4B nos confirma que su pago ha sido realizado. </p>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<p class="trece">Imprima esta página como referencia de su pedido. Contiene información importante que puede necesitar más adelante.</p>
|
|||
|
|
<?php
|
|||
|
|
if(!$visa_ok) {
|
|||
|
|
?>
|
|||
|
|
<p class="trece">El pedido se considera en firme una vez se ha recibido el pago, bien mediante transferencia, bien mediante pago eletrónico.</p>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<p class="trece">Su número de pedido es el <b class="t1 trece"><?php echo date(dm) . '-' . substr(10000 + $pedidoID, 1, 4); ?></b>. Utilice este número para cualquier comunicación o consulta sobre el mismo.</p>
|
|||
|
|
|
|||
|
|
<p class="trece"><span class="capi">1.</span> Esta es la dirección donde enviaremos su pedido.<br /><br />
|
|||
|
|
<?php
|
|||
|
|
|
|||
|
|
$query = "SELECT cliente_nombre, cliente_direccion, cliente_codigopostal, cliente_localidad, cliente_provincia, cliente_telefono, cliente_fax, cliente_email, cliente_nif
|
|||
|
|
FROM shoop_clientes WHERE cliente_id = " . $clienteID;
|
|||
|
|
|
|||
|
|
|
|||
|
|
$result = mysql_query($query, $conn);
|
|||
|
|
if($result) {
|
|||
|
|
$row = mysql_fetch_array($result);
|
|||
|
|
|
|||
|
|
echo '<b>' . $row['cliente_nombre'] . '</b><br />';
|
|||
|
|
echo $row['cliente_direccion'] . '<br />';
|
|||
|
|
echo $row['cliente_codigopostal'] . ' ' . $row['cliente_localidad'] . '<br />';
|
|||
|
|
echo (strlen ($row['cliente_provincia']) ? $row['cliente_provincia'] . '<br />' : '');
|
|||
|
|
echo '<br />';
|
|||
|
|
echo (strlen ($row['cliente_telefono']) ? 'Teléfono: ' . $row['cliente_telefono'] . '<br />' : '');
|
|||
|
|
echo (strlen ($row['cliente_fax']) ? 'Fax: ' . $row['cliente_fax'] . '<br />' : '');
|
|||
|
|
echo (strlen ($row['cliente_email']) ? 'email: ' . $row['cliente_email'] . '<br />' : '');
|
|||
|
|
} else {
|
|||
|
|
echo 'Ha ocurrido un error leyendo los datos del cliente';
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
</p>
|
|||
|
|
<p class="trece"><span class="capi">2.</span> Este es el detalle de su pedido.<br />
|
|||
|
|
<?php
|
|||
|
|
$query = "SELECT pp_cantidad, pp_precio_ud, pp_subtotal, pp_prd_tipo, pp_prd_marca, pp_prd_modelo, pp_prd_color
|
|||
|
|
FROM shoop_pedi_productos WHERE pp_id_pedido = " . $pedidoID;
|
|||
|
|
|
|||
|
|
$result = mysql_query($query, $conn);
|
|||
|
|
if($result) {
|
|||
|
|
$totalPedido = 0;
|
|||
|
|
?>
|
|||
|
|
<table border="0" cellpadding="2" cellspacing="0">
|
|||
|
|
<tr>
|
|||
|
|
<td width="28" class="cab">Ud.</td>
|
|||
|
|
<td width="350" class="cab">Producto</td>
|
|||
|
|
<td width="64" class="cab" align="right">PVP Ud. </td>
|
|||
|
|
<td width="65" class="cab" align="right">Subtotal</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
<table border="0" cellpadding="2" cellspacing="0">
|
|||
|
|
<?php
|
|||
|
|
while($row = mysql_fetch_array($result)) {
|
|||
|
|
$totalPedido += $row['pp_subtotal'];
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td width="28" class="data"><?php echo $row['pp_cantidad']; ?></td>
|
|||
|
|
<td width="350" class="data"><?php echo $row['pp_prd_tipo'] . ' ' . $row['pp_prd_marca'] . ' ' . $row['pp_prd_modelo'] . (strlen($row['pp_prd_color']) ? ' (Acabado ' . ucwords($row['pp_prd_color']) . ')' : ''); ?></td>
|
|||
|
|
<td width="64" class="data" align="right"><?php echo miNumberFormat($row['pp_precio_ud']); ?>€</td>
|
|||
|
|
<td width="65" class="data" align="right"><?php echo miNumberFormat($row['pp_subtotal']); ?>€</td></tr>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
if($totalPedido >= $GLOBALS['no_portes']) {
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="15"></td>
|
|||
|
|
<td colspan="3" class="data" align="right" valign="bottom"><b>Total: </b><?php echo miNumberFormat($totalPedido); ?>€</td></tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td colspan="3" class="data" align="right">IVA y Gastos de envío incluidos.</td></tr>
|
|||
|
|
<?php
|
|||
|
|
} else {
|
|||
|
|
?>
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="15"></td>
|
|||
|
|
<td colspan="3" class="data" align="right">Subtotal: <?php echo miNumberFormat($totalPedido); ?>€</td></tr>
|
|||
|
|
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td colspan="3" class="data" align="right">Gastos de envío: <?php echo $GLOBALS['portes']; ?>€<br></td></tr>
|
|||
|
|
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td colspan="3" class="data" align="right"><b>Total: </b><?php $totalPedido += $GLOBALS['portes']; echo miNumberFormat($totalPedido); ?>€<br></td></tr>
|
|||
|
|
|
|||
|
|
<tr>
|
|||
|
|
<td><img src="_imgs/d.gif" width="12" height="12"></td>
|
|||
|
|
<td colspan="3" class="data" align="right">IVA incluido.</td></tr>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
</table>
|
|||
|
|
<?php
|
|||
|
|
} else {
|
|||
|
|
echo 'Ha ocurrido un error leyendo los datos del cliente';
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<br />
|
|||
|
|
</p>
|
|||
|
|
<?php
|
|||
|
|
if(!$visa_ok) {
|
|||
|
|
|
|||
|
|
// patch: grabo el total y el codigo en el registro del pedido para que lo recupere 4B
|
|||
|
|
$query = "UPDATE shoop_pedidos SET pedido_total = " . $totalPedido . ", pedido_cod_pedido = '" . date(dm) . '-' . substr(10000 + $pedidoID, 1, 4) . "' WHERE pedido_id = " . $pedidoID;
|
|||
|
|
$result = mysql_query($query, $conn);
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<p class="trece"><span class="capi">3.</span> Ha elegido, como forma de pago,
|
|||
|
|
<?php
|
|||
|
|
if ($formapago == 'transferencia'){
|
|||
|
|
?>
|
|||
|
|
Transferencia Bancaria.<br />
|
|||
|
|
<br />
|
|||
|
|
Para formalizar el pedido debe hacer una transferencia por un importe de <span class="Estilo1"><?php echo miNumberFormat($totalPedido); ?>€</span> a la cuenta número <span class="Estilo1">0049 5114 91 2116111854</span> del Banco Santander Central Hispano.<br />
|
|||
|
|
<br />
|
|||
|
|
Indique como referencia el código <b class="t1 trece">"Pedido <?php echo date(dm) . '-' . substr(10000 + $pedidoID, 1, 4); ?>"</b><br />
|
|||
|
|
<br />
|
|||
|
|
Una vez realizada la transferencia envíenos una copia del justificante de la misma a la dirección de email info@claveaudio.com (si es una transferencia electrónica) o al número de fax 91 402 79 48.
|
|||
|
|
<?php
|
|||
|
|
} else {
|
|||
|
|
// esto lo necesitare para pasaserlo una vez mas a 4B
|
|||
|
|
$_SESSION['clave.cod_pedido'] = date(dm) . '-' . substr(10000 + $pedidoID, 1, 4);
|
|||
|
|
$_SESSION['clave.total_pedido'] = $totalPedido;
|
|||
|
|
?>
|
|||
|
|
Tarjeta de Crédito.<br />
|
|||
|
|
<br />
|
|||
|
|
Para formalizar el pedido sólo necesita utilizar el sistema de pago seguro 4B.<br /><br />
|
|||
|
|
Haga clic en el enlace <strong>'Realizar pago'</strong> para acceder al sistema de pago seguro y completar el pedido.<br>
|
|||
|
|
<br>
|
|||
|
|
Será redirigido al servidor de pago seguro de Sistema 4B donde se le solicitarán los datos de su tarjeta de crédito. ClaveAudio no tendrá acceso en ningún momento a dichos datos.
|
|||
|
|
<p align="center">
|
|||
|
|
<form action="https://tpv.4b.es/tpvv/teargral.exe" method="post" align="center">
|
|||
|
|
<input type="hidden" name="a" value="<?php echo date(dm) . '-' . substr(10000 + $pedidoID, 1, 4); ?>">
|
|||
|
|
<input type="hidden" name="z" value="PI00004597">
|
|||
|
|
<input type="hidden" name="x" value="es">
|
|||
|
|
<input type="submit" value="Realizar Pago"></form>
|
|||
|
|
</p>
|
|||
|
|
<?php
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
|
|||
|
|
<tr><td colspan="3"><img src="_imgs/d.gif" width="6" height="6"></td></tr>
|
|||
|
|
</table>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr><td colspan="7"><img src="_imgs/d.gif" width="708" height="12"></td></tr>
|
|||
|
|
<tr><td colspan="7"><?php include("pie.htm"); ?></td></tr>
|
|||
|
|
<tr><td colspan="7"><img src="_imgs/d.gif" width="708" height="12"></td></tr>
|
|||
|
|
</table>
|
|||
|
|
</body>
|
|||
|
|
</html>
|