git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@20 44ade383-bb54-5b4f-835b-923f7702b206
264 lines
10 KiB
PHP
264 lines
10 KiB
PHP
<?php
|
|
// ####################################################
|
|
// producto.php
|
|
// parte de shoop
|
|
// © ff 2005
|
|
|
|
// wfcart siempre antes del inicio de sesion
|
|
include("_incl/wfCart.php");
|
|
session_start();
|
|
|
|
include('db.php');
|
|
include("_incl/code.php");
|
|
include("_incl/shoopBanners.php");
|
|
|
|
|
|
// ####################################################
|
|
// cargo el carrito o lo creo nuevo si fuera menester
|
|
|
|
$cart =& $_SESSION['cart'];
|
|
if(!is_object($cart)) $cart = new wfCart();
|
|
|
|
$ocasion_id = $_REQUEST['id'];
|
|
|
|
$ocasion_categoria_id = "";
|
|
$ocasion_categoria_nombre = "";
|
|
$ocasion_nombre = "";
|
|
$ocasion_descripcion = "";
|
|
$ocasion_estado = "";
|
|
$ocasion_pvp = "";
|
|
$ocasion_precio = "";
|
|
$ocasion_unidades = "";
|
|
$ocasion_fab_id = "";
|
|
|
|
$conn = db_connect();
|
|
if($conn) {
|
|
$query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades, ocasion_fab_id
|
|
FROM shoop_ocasion
|
|
WHERE ocasion_id="' . $ocasion_id . '"';
|
|
$result = mysql_query($query, $conn);
|
|
if (mysql_num_rows($result)) {
|
|
$row = mysql_fetch_array($result);
|
|
$ocasion_categoria_id = $row['ocasion_categoria'];
|
|
$ocasion_nombre = $row['ocasion_nombre'];
|
|
$ocasion_descripcion = $row['ocasion_descripcion'];
|
|
$ocasion_estado = $row['ocasion_estado'];
|
|
$ocasion_pvp = $row['ocasion_pvp'];
|
|
$ocasion_precio = $row['ocasion_precio'];
|
|
$ocasion_unidades = $row['ocasion_unidades'];
|
|
$ocasion_fab_id = $row['ocasion_fab_id'];
|
|
|
|
//PARCHE DE CATEGORIAS DE OCASION
|
|
switch($ocasion_categoria_id) {
|
|
case 1: $ocasion_categoria_nombre = 'Altavoces'; break;
|
|
case 2: $ocasion_categoria_nombre = 'Electrónicas'; break;
|
|
case 3: $ocasion_categoria_nombre = 'Reproductores de CD, convertidores D/A, etc.'; break;
|
|
case 4: $ocasion_categoria_nombre = 'Varios'; break;
|
|
default: $ocasion_categoria_nombre = 'N/A';
|
|
}
|
|
|
|
|
|
$topLabel = '<span class="seccion"><a href="tienda.php" class="pielink">Tienda ></a><a href="ocasion.php" class="pielink"> Ocasión</a></span>';
|
|
}
|
|
}
|
|
?>
|
|
|
|
<!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" />
|
|
<link href="_incl/prod.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>
|
|
</head>
|
|
<body onLoad="MM_preloadImages('_imgs/comprb.gif')">
|
|
<?php
|
|
include("top.htm");
|
|
?>
|
|
<table border="0" align="center" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td colspan="7"><img src="_bann/topTienda.jpg"></td></tr>
|
|
<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">
|
|
|
|
<?php
|
|
// ####################################################
|
|
// la celda que contiene el buscador, el menu y el carrito.
|
|
?>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0" id="colIzda">
|
|
<tr>
|
|
<td bgcolor="#7A706A"><img src="_imgs/d.gif" width="6" height="12"></td>
|
|
<td bgcolor="#7A706A"><img src="_imgs/titSearch.gif" width="156" height="18"></td>
|
|
<td bgcolor="#7A706A" align="right"><img src="_imgs/crnr.gif" width="6" height="18"></td></tr></table>
|
|
<?php include("buscar.php"); ?>
|
|
<img src="_imgs/d.gif" width="168" height="12"><br>
|
|
<?php
|
|
$menu_cat = (strlen($cat_str) ? substr($cat_str, 0, 2) : '');
|
|
include("categorias.php");
|
|
?>
|
|
<img src="_imgs/d.gif" width="168" height="12"><br>
|
|
<?php include("carrito.php"); ?></td>
|
|
<td></td>
|
|
<td colspan="3" width="348" valign="top">
|
|
<?php echo $topLabel; ?><br><img src="_imgs/g.gif" width="348" height="1"><br><br>
|
|
<table width="348" border="0" cellpadding="0" cellspacing="0">
|
|
|
|
<form id="ocasion" name="ocasion" method="post" action="carrito_add.php">
|
|
<input name="id" id="id" type="hidden" value="<?php echo $ocasion_id; ?>">
|
|
<input name="ocasion_categoria_id" id="ocasion_categoria_id" type="hidden" value="<?php echo $ocasion_categoria_id; ?>">
|
|
<input name="ocasion_categoria_nombre" id="ocasion_categoria_nombre" type="hidden" value="<?php echo $ocasion_categoria_nombre; ?>">
|
|
<input name="ocasion_nombre" id="ocasion_nombre" type="hidden" value="<?php echo $ocasion_nombre; ?>">
|
|
<input name="ocasion_descripcion" id="ocasion_descripcion" type="hidden" value="<?php echo $ocasion_descripcion; ?>">
|
|
<input name="ocasion_estado" id="ocasion_estado" type="hidden" value="<?php echo $ocasion_estado; ?>">
|
|
<input name="ocasion_pvp" id="ocasion_pvp" type="hidden" value="<?php echo $ocasion_pvp; ?>">
|
|
<input name="ocasion_precio" id="ocasion_precio" type="hidden" value="<?php echo $ocasion_precio; ?>">
|
|
<input name="ocasion_estado" id="ocasion_unidades" type="hidden" value="<?php echo $ocasion_unidades; ?>">
|
|
|
|
<tr>
|
|
<td colspan="3" width="348" valign="top" class="producto_texto">
|
|
<span class="producto_tipo azul"><?php echo $ocasion_categoria_nombre; ?></span><br>
|
|
<span class="producto_modelo"><?php echo $ocasion_nombre; ?></span><br>
|
|
<span class="producto_tipo azul"><?php echo $ocasion_estado; ?></span><!--span class="producto_tipo rojo"> <?php //echo $ocasion_unidades; ?> Unidades</span--><br>
|
|
<span class="producto_modelo">PVP:</span> <span class="producto_precio_ocasion1"><?php echo $ocasion_pvp; ?><span class="euro">€</span><br>
|
|
<span class="producto_modelo">Ocasión:</span> <span class="producto_precio_ocasion2"><?php echo $ocasion_precio; ?><span class="euro">€</span><br>
|
|
<img src="_imgs/d.gif" width="170" height="6"><br>
|
|
|
|
<a href="ocasion_add.php?id=<?= $ocasion_id; ?>&precio=<?= $ocasion_precio; ?>&modelo=<?= $ocasion_nombre; ?>" onMouseOver="MM_swapImage('comprar','','_imgs/comprb.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="_imgs/compra.gif" name="comprar" width="61" height="13" border="0" id="comprar"></a>
|
|
|
|
<!--a href="javascript:document.producto.submit();" onMouseOver="MM_swapImage('comprar','','_imgs/comprb.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="_imgs/compra.gif" name="comprar" width="61" height="13" border="0" id="comprar"></a><br>
|
|
<?php if($cart->find_item($prod_id)) echo $cart->find_item($prod_id) . ' unidad' . ($cart->find_item($prod_id) > 1 ? 'es' : '') . ' en su cesta'; ?>-->
|
|
</td>
|
|
<!--td></td>
|
|
<td width="170" valign="top" align="center">
|
|
|
|
<?php
|
|
//LOGOTIPO FABRICANTE
|
|
/* $path = '_logos/c/' . $ocasion_fab_id . '.gif';
|
|
if (file_exists($path)) {
|
|
echo '<img src="'.$path.'"><br>';
|
|
}
|
|
*/
|
|
?>
|
|
<img src="_imgs/d.gif" width="170" height="6"><br></td-->
|
|
<tr>
|
|
<td width="170"><img src="_imgs/d.gif" width="170" height="12"></td><td width="8"><img src="_imgs/d.gif" width="8" height="1"></td><td width="170"><img src="_imgs/d.gif" width="170" height="1"></td></tr>
|
|
|
|
<?php
|
|
if($prod_precio > 0) {
|
|
?>
|
|
</form>
|
|
<?php
|
|
}
|
|
?>
|
|
</table>
|
|
<table width="348" border="0" cellpadding="0" cellspacing="0">
|
|
<?php
|
|
if(strlen($ocasion_descripcion)) {
|
|
?>
|
|
<tr><td class="tit azul">DESCRIPCIÓN</td></tr>
|
|
<tr><td background="_imgs/ptoshg.gif"><img src="_imgs/d.gif" width="168" height="1"></td></tr>
|
|
<tr><td width="348" class="producto_texto"><br><?php echo $ocasion_descripcion; ?></td></tr>
|
|
<tr><td><img src="_imgs/d.gif" width="170" height="12"></td></tr>
|
|
<?php
|
|
}
|
|
|
|
if(strlen($prod_intro)) {
|
|
?>
|
|
<tr><td width="348" class="producto_texto"><?php echo str_replace("\r", "<br>", htmlentities(stripslashes($prod_intro))); ?></td></tr>
|
|
<tr><td><img src="_imgs/d.gif" width="170" height="12"></td></tr>
|
|
<?php
|
|
}
|
|
|
|
if(strlen($prod_dimensiones)){
|
|
?>
|
|
<tr><td width="348" class="producto_texto"><?php echo '<b>Dimensiones:</b> ' . $prod_dimensiones; ?></td></tr>
|
|
<?php
|
|
}
|
|
if(strlen($prod_peso) && $prod_peso != '0.00'){
|
|
?>
|
|
<tr><td width="348" class="producto_texto"><?php echo '<b>Peso:</b> ' . $prod_peso; ?></td></tr>
|
|
<?php
|
|
}
|
|
if(strlen($prod_volumen) && $prod_volumen != '0.00'){
|
|
?>
|
|
<tr><td width="348" class="producto_texto"><?php echo '<b>Volumen:</b> ' . $prod_volumen; ?></td></tr>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
if($conn){
|
|
$query = 'SELECT procat_valor, catop_label FROM shoop_prod_caracteristicas, shoop_cate_caracteristicas WHERE catop_id=procat_catop AND procat_producto=' . $prod_id ;
|
|
$result = mysql_query($query, $conn);
|
|
if($result){
|
|
while($row = mysql_fetch_array($result)) {
|
|
?>
|
|
<tr><td width="348" class="producto_texto"><?php echo '<b>' . $row['catop_label'] . ':</b> ' . $row['procat_valor']; ?></td></tr>
|
|
<?php
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
<tr><td align="center">
|
|
<?php
|
|
//SI TIENE PDF la imagen irá al pdf si no a la ficha
|
|
$path_pdf = '_ocs/' . $ocasion_id . '.pdf';
|
|
$path_jpg = '_ocs/' . $ocasion_id . '_348.jpg';
|
|
if (!file_exists($path_pdf))
|
|
$path_pdf = "";
|
|
if (!file_exists($path_jpg))
|
|
$path_jpg = "";
|
|
|
|
if ($path_pdf != "") {
|
|
$enlace = $path_pdf;
|
|
}
|
|
else
|
|
$enlace = "ocasion_ficha.php?id=". $ocasion_id;
|
|
?>
|
|
|
|
<a href="<?php echo $enlace; ?>">
|
|
<?php
|
|
if ($path_jpg != "") {
|
|
?>
|
|
<img src="<?php echo $path_jpg; ?>" width="348" border="0"></a>
|
|
<?php }
|
|
|
|
if ($path_pdf != "") {
|
|
?>
|
|
<a href="<?php echo $enlace; ?>">Ver ocasion</a>
|
|
<?php } ?>
|
|
|
|
</td></tr>
|
|
|
|
|
|
|
|
</table>
|
|
</td>
|
|
<td></td>
|
|
<td width="168" valign="top">
|
|
<img src="_bann/168clave.gif" alt="ventajas" border="0">
|
|
</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>
|