ClaveAudio_Web/admin/shoop/pedidos_show.php
2011-05-06 11:33:27 +00:00

188 lines
6.4 KiB
PHP

<?php
// ####################################################
// pedido_procesa.php
// parte de shoop
// © ff 2005
ini_set ('error_reporting', E_ALL);
ini_set ('display_errors', '1');
require_once('../../_config.php');
require_once('../../_incl/datosClass.php');
require_once('../../_incl/code.php');
$pedidoID = $_REQUEST['id'];
?>
<!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>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="_imgs/ptos.gif"></td>
<td colspan="5" width="528" valign="top"><p>
<?php
$db = new datosClass($DATA_USER, $DATA_PWD, $DATA_DATABASE, $DATA_HOST);
if($db) {
if($db->query("SELECT pedido_cod_pedido, pedido_fecha, pedido_forma_pago, pedido_transaccion_resultado, pedido_transaccion_codigo FROM shoop_pedidos WHERE pedido_id = " . $pedidoID, true)) {
if($row = $db->getNext()) {
$pedido_codigo = $row['pedido_cod_pedido'];
$formapago = $row['pedido_forma_pago'];
$visa_resultado = $row['pedido_transaccion_resultado'];
$visa_codigo = $row['pedido_transaccion_codigo'];
}
} else {
echo 'error con el pedido';
}
}
?>
<p class="trece">N&uacute;mero de pedido: <b class="t1 trece"><?php echo $pedido_codigo; ?></b>.</p>
<p class="trece"><span class="capi">1.</span> Datos del cliente:<br /><br />
<?php
if($db){
if($db->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 = " . $pedidoID, true)) {
if($row = $db->getNext()) {
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&eacute;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 />' : '');
}
}
}
?>
</p>
<p class="trece"><span class="capi">2.</span> Datos del pedido.<br />
<?php
if($db) {
if($db->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, true)) {
?>
<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
$totalPedido = 0;
while($row = $db->getNext()) {
$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']); ?>&euro;</td>
<td width="65" class="data" align="right"><?php echo miNumberFormat($row['pp_subtotal']); ?>&euro;</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); ?>&euro;</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&iacute;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); ?>&euro;</td></tr>
<tr>
<td><img src="_imgs/d.gif" width="12" height="12"></td>
<td colspan="3" class="data" align="right">Gastos de env&iacute;o: <?php echo $GLOBALS['portes']; ?>&euro;<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); ?>&euro;<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
}
}
?>
</p>
<p class="trece"><span class="capi">3.</span> Forma de pago:
<?php
if($formapago == 'trans') {
?>
Transferencia Bancaria.
<?php
} else {
?>
VISA <br />
<?php
// si es visa muestro el c—digo o el error de la transacci—n.
if($visa_resultado) {
echo $visa_codigo;
} else {
echo 'N&uacute;mero de autorizaci&oacute;n: ' . $visa_codigo;
}
}
?>
<tr><td colspan="2"><img src="_imgs/d.gif" width="6" height="6"></td></tr>
</table>
<p><a href="ped.php?op=dal&id=<?php echo $pedidoID; ?>" onclick="return confirm('Est&aacute;s seguro de querer borrar este pedido?')" class="button">[ borrar ]</a></p>
</td>
</tr>
</table>
</body>
</html>