ClaveAudio_Web/producto.php

235 lines
8.8 KiB
PHP
Raw Normal View History

<?php
// ####################################################
// producto.php
// parte de shoop
// <20> 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();
$prod_id = $_REQUEST['id'];
$cat_str = $_REQUEST['cat'];
$prod_categoria_id = "";
$prod_fab_id = "";
$prod_modelo = "";
$prod_precio = "";
$prod_colores = "";
$prod_peso = "";
$prod_dimensiones = "";
$prod_volumen = "";
$prod_descripcion = "";
$conn = db_connect();
if($conn) {
$query = 'SELECT prod_id, prod_categoria_id, prod_fab_id, prod_modelo, prod_precio, prod_colores, prod_peso, prod_codigo, prod_dimensiones, prod_volumen, prod_descripcion, prod_intro,
seccion_nombre, cat_nombre, fab_nombre
FROM shoop_secciones, shoop_productos, shoop_fabricantes, shoop_categorias
WHERE cat_seccion=seccion_code AND fab_id=prod_fab_id AND cat_codigo=prod_categoria_id AND prod_id="' . $prod_id . '"';
$result = mysql_query($query, $conn);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$prod_categoria_id = $row['prod_categoria_id'];
$prod_fab_id = $row['prod_fab_id'];
$prod_modelo = $row['prod_modelo'];
$prod_precio = $row['prod_precio'];
$prod_colores = $row['prod_colores'];
$prod_peso = $row['prod_peso'];
$prod_dimensiones = $row['prod_dimensiones'];
$prod_volumen = $row['prod_volumen'];
$prod_descripcion = $row['prod_descripcion'];
$cat_nombre = $row['cat_nombre'];
$seccion_nombre = $row['seccion_nombre'];
$fab_nombre = $row['fab_nombre'];
$prod_intro = $row['prod_intro'];
$tipo_producto = componProducto($cat_nombre, $seccion_nombre);
$topLabel = '<span class="seccion"><a href="tienda.php" class="pielink">' . 'Tienda&nbsp;></a><a href="tienda.php?cat=' . $prod_categoria_id . '" class="pielink">&nbsp;' . $seccion_nombre . '&nbsp;>&nbsp;' . $cat_nombre . '</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">
<?php
if($prod_precio > 0) {
?>
<form id="producto" name="producto" method="post" action="carrito_add.php">
<input name="marca" id="marca" type="hidden" value="<?php echo $fab_nombre; ?>">
<input name="tipo" id="tipo" type="hidden" value="<?php echo $tipo_producto; ?>">
<input name="modelo" id="modelo" type="hidden" value="<?php echo $prod_modelo; ?>">
<input name="id" id="id" type="hidden" value="<?php echo $prod_id; ?>">
<input name="precio" id="precio" type="hidden" value="<?php echo $prod_precio; ?>">
<?php
if(strlen($prod_colores)) {
?>
<input name="acabados" id="acabados" type="hidden" value="<?php echo $prod_colores; ?>">
<?php
}
}
?>
<tr>
<td width="170" valign="top" class="producto_texto">
<span class="producto_tipo azul"><?php echo $tipo_producto; ?></span><br>
<span class="producto_modelo"><?php echo $prod_modelo; ?></span><br>
<span class="producto_precio"><?php echo ($prod_precio <= 0 ? 'Consultar' : miNumberFormat($prod_precio) . '<span class="euro">&euro;</span>'); ?></span><br>
<img src="_imgs/d.gif" width="170" height="6"><br>
<?php
// solo quiero menu si tengo una coma en el campo colores.
if(strlen($prod_colores) && strstr($prod_colores, ',')) {
?>
<select name="color" id="color">
<?php
// cur<75>monos en salut:
// normalizo todas las comas-espacio a coma
$prod_colores = str_replace(', ', ',', $prod_colores);
echo array2Select(split(",", $prod_colores));
?>
</select><br>
<?php
}
?>
<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">
<img src="_logos/c/<?php echo $prod_fab_id; ?>.gif"><br>
<img src="_imgs/d.gif" width="170" height="6"><br>
<img src="_prds/<?php echo $prod_id; ?>_168.jpg"></td></tr>
<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($prod_descripcion)) {
?>
<tr><td class="tit azul">DESCRIPCI&Oacute;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"><?php echo $prod_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
}
}
}
?>
</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>