ClaveAudio_Web/ocasion_ficha.php

217 lines
9.0 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 = "";
$conn = db_connect();
if($conn) {
$query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades
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'];
//PARCHE DE CATEGORIAS DE OCASION
switch($ocasion_categoria_id) {
case 1: $ocasion_categoria_nombre = 'Altavoces'; break;
case 2: $ocasion_categoria_nombre = 'Electr&oacute;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&nbsp;></a><a href="ocasion.php" class="pielink">&nbsp;Ocasi&oacute;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 width="170" 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">&nbsp;&nbsp;&nbsp;<?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">&euro;</span><br>
<span class="producto_modelo">Oferta:</span> <span class="producto_precio_ocasion2"><?php echo $ocasion_precio; ?><span class="euro">&euro;</span><br>
<img src="_imgs/d.gif" width="170" height="6"><br>
<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="_ocs/<?php echo $ocasion_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($ocasion_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"><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
}
}
}
?>
</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>