ClaveAudio_Web/ocasion.php

196 lines
7.9 KiB
PHP
Raw Normal View History

<?php
// ####################################################
// tienda.php
// parte de shoop
// <20> 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_fab_id, fab_nombre, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion
FROM shoop_ocasion
LEFT JOIN shoop_fabricantes on (ocasion_fab_id=fab_id)
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&nbsp;></a>&nbsp;Material de Ocasi&oacute;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<65> 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<63>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<6F>a)
$miOcasion = new shoopOcasion(1, '');
if($miOcasion->getNum()){
$arrayOcasion = $miOcasion->getNextOcasion();
if(!empty($arrayOcasion))
include('bann2_ocasion.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&oacute;n proceden tanto de material de exposici&oacute;n como material recogido a nuestros clientes. Tambi&eacute;n, en algunos casos, se trata de modelos descatalogados. En cualquier caso, todos ellos han sido revisados por nosotros y est&aacute;n garantizados por un per&iacute;odo m&iacute;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&oacute;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'];
$fab_nombre = $row['fab_nombre'];
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"><b>
<?= $fab_nombre; ?> </b>&nbsp;&nbsp;<?= $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>
<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>