git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@7 44ade383-bb54-5b4f-835b-923f7702b206
199 lines
8.4 KiB
PHP
199 lines
8.4 KiB
PHP
<?php
|
||
// ####################################################
|
||
// tienda.php
|
||
// parte de shoop
|
||
// © 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/shoopOfertas.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();
|
||
|
||
|
||
$result = false;
|
||
$conn = db_connect();
|
||
if($conn) {
|
||
$query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion
|
||
FROM shoop_ocasion
|
||
WHERE ocasion_unidades > 0
|
||
ORDER BY ocasion_categoria, ocasion_id';
|
||
|
||
$result = mysql_query($query, $conn);
|
||
if($result) {
|
||
$numProductos = mysql_num_rows($result);
|
||
$topLabel = '<span class="seccion"><a href="tienda.php" class="pielink">Tienda ></a> Material de Ocasión</span>';
|
||
}
|
||
}
|
||
|
||
// ####################################################
|
||
// llegados a este punto sabemos en que estado esta la pagina
|
||
// tenemos, incluso, los resultados de la busqueda, if any
|
||
?>
|
||
|
||
<!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/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>
|
||
</head>
|
||
<body onLoad="MM_preloadImages('_imgs/comprbm.gif')">
|
||
<?php
|
||
// ####################################################
|
||
// la banda superior y el menœ principal
|
||
|
||
include('top.htm');
|
||
|
||
// ####################################################
|
||
// esta es la tabla general que da forma a la pagina.
|
||
?>
|
||
<table border="0" align="center" cellpadding="0" cellspacing="0">
|
||
<tr>
|
||
<td colspan="7"><img src="_bann/ocasion.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">
|
||
|
||
<?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 = '';
|
||
include("categorias.php");
|
||
?>
|
||
<img src="_imgs/d.gif" width="168" height="12"><br>
|
||
<?php include("carrito.php"); ?></td>
|
||
<td></td>
|
||
<td colspan="5" valign="top" width="528">
|
||
|
||
<?php
|
||
// ####################################################
|
||
// esta parte es comun: texto y destacado de 3 columnas.
|
||
?>
|
||
|
||
<table border="0" cellspacing="0" cellpadding="0" id="topClaim">
|
||
|
||
<?php
|
||
// ####################################################
|
||
// dependiendo de si estoy en el indice muestro el bienvenidos o el nombre de la secci—n/busqueda.
|
||
?>
|
||
<tr><td><?= $topLabel; ?><br><img src="_imgs/g.gif" width="528" height="1"></td></tr>
|
||
|
||
<tr><td>
|
||
<?php
|
||
// ####################################################
|
||
// este es el destacado que aparece en la parte superior de todas las paginas de la tienda.
|
||
|
||
// quiero una oferta de tipo dos de la categoria que me han pasado (o de cualquiera si no hay categor’a)
|
||
$miOferta = new shoopOfertas(1, '', '2');
|
||
if($miOferta->getNum()){
|
||
$arrayOferta = $miOferta->getNextOferta();
|
||
include('bann2.php');
|
||
?>
|
||
</td></tr>
|
||
<tr><td background="_imgs/ptoshb.gif"><img src="_imgs/d.gif" width="168" height="8"></td></tr>
|
||
<?php
|
||
}
|
||
?>
|
||
</table>
|
||
|
||
<table border="0" cellspacing="0" cellpadding="0" id="saludo">
|
||
<tr><td><img src="_imgs/d.gif" width="168" height="8"></td></tr>
|
||
<tr><td width="528" class="parr">Este es un listado parcial de productos en oferta.<br \>Los productos que aparecen a continuación proceden tanto de material de exposición como material recogido a nuestros clientes. También, en algunos casos, se trata de modelos descatalogados. En cualquier caso, todos ellos han sido revisados por nosotros y están garantizados por un período mínimo de tres meses.<br \>
|
||
Estos precios incluyen IVA.
|
||
</td></tr>
|
||
<tr><td background="_imgs/ptoshb.gif"><img src="_imgs/d.gif" width="168" height="8"></td></tr>
|
||
</table>
|
||
|
||
|
||
<?php
|
||
if($result && $numProductos) {
|
||
?>
|
||
<table border="0" cellspacing="0" cellpadding="0" width="528">
|
||
<?php
|
||
$secciones = array('', 'Altavoces', 'Electrónicas', 'Reproductores de CD, convertidores D/A, etc.', 'Varios');
|
||
$curSeccion='';
|
||
while ($row = mysql_fetch_array($result))
|
||
{
|
||
$ocasion_id = $row['ocasion_id'];
|
||
$ocasion_categoria = $row['ocasion_categoria'];
|
||
$ocasion_nombre = $row['ocasion_nombre'];
|
||
$ocasion_estado = $row['ocasion_estado'];
|
||
$ocasion_pvp = $row['ocasion_pvp'];
|
||
$ocasion_precio = $row['ocasion_precio'];
|
||
$ocasion_descripcion = $row['ocasion_descripcion'];
|
||
|
||
if($ocasion_categoria != $curSeccion){
|
||
$curSeccion = $ocasion_categoria;
|
||
?>
|
||
<tr>
|
||
<td colspan="2" class="lbl"><?= $secciones[$ocasion_categoria]; ?><img src="_imgs/d.gif" width="15" height="18"></td>
|
||
<td width="70" class="lbl" align="right" valign="bottom">PVP</td>
|
||
<td width="70" class="lbl" align="right" valign="bottom">Oferta</td>
|
||
<td width="30"></td></tr>
|
||
<?php
|
||
}
|
||
?>
|
||
<tr onMouseOver="overRow(this);return false;" onMouseOut="outRow(this);return false;">
|
||
<td width="10"></td>
|
||
<td width="335" valign="top" class="data"><a href="ocasion_ficha.php?id=<?= $ocasion_id; ?> " class="pielink"> <?= $ocasion_nombre . (strlen($ocasion_estado) ? ' (<i>' . $ocasion_estado . '</i>)': "") . (strlen($ocasion_descripcion) ? '<br><span class="seccion">' . $ocasion_descripcion . '</span>': "") ; ?></a></td>
|
||
<td width="70" valign="top" align="right" class="data"><?= miNumberFormat($ocasion_pvp); ?></td>
|
||
<td width="70" valign="top" align="right" class="data"><?= miNumberFormat($ocasion_precio); ?></td>
|
||
<td width="30" align="right" valign="top"><a href="ocasion_add.php?id=<?= $ocasion_id; ?>&precio=<?= $ocasion_precio; ?>&modelo=<?= $ocasion_nombre; ?>" onMouseOver="MM_swapImage('comprar<?= $ocasion_id; ?>','','_imgs/comprbm.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="_imgs/compram.gif" name="comprar<?= $ocasion_id; ?>" width="16" height="13" border="0" id="comprar<?= $ocasion_id; ?>"></a></td></tr>
|
||
|
||
<?php
|
||
/*
|
||
<td width="240" valign="top" class="data"> <?= substr($prod_categoria, 0, 25) . (strlen($prod_categoria) > 25 ? '...' : ''); ?></td>
|
||
<td width="330" valign="top" class="data"><?= '<a href="producto.php?id=' . $ocasion_id . '&cat=' . $prod_categoria_id . '" class="pielink"><b>' . $prod_fab_id . '</b> ' . $prod_modelo . '</a>'; ?></td>
|
||
<td width="100" valign="top" class="data" align="right"><?= ($prod_precio == -1 ? '<a href="javascript:doConsultar(' . $ocasion_id . ', \'precio\', \'' . componProducto($prod_categoria, $seccion_nombre) . str_replace('&', 'etperse', $prod_fab_id) . ' ' . str_replace('&', 'etperse', $prod_modelo) . '\');" class="pielink"><b>CONSULTAR</b></a>' : miNumberFormat($prod_precio) . '€'); ?></td></tr>
|
||
*/
|
||
?>
|
||
<tr>
|
||
<td bgcolor="#EDEEF1" colspan="5"><img src="_imgs/d.gif" width="2" height="1"></td></tr>
|
||
<?php
|
||
} // while
|
||
?>
|
||
</table>
|
||
<?php
|
||
}
|
||
?>
|
||
</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>
|