Se hace la parte web de ofertas y se adaptan las ocasiones para que se pueda poner el fabricante (OJO TABLA SHOOP_OCASIONES)

git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@13 44ade383-bb54-5b4f-835b-923f7702b206
This commit is contained in:
roberto 2011-06-06 14:29:53 +00:00
parent 8ef9b1d0d8
commit 63c49a542c
16 changed files with 615 additions and 27 deletions

Binary file not shown.

View File

@ -25,7 +25,7 @@
.producto_precio_ocasion2 {
font-family: "Times New Roman", Times, serif;
font-size: 28px;
font-size: 24px;
color: #CB2C54;
font-weight: normal;
}

View File

@ -12,6 +12,7 @@ var $cuantas;
var $numOfertas;
var $curTipo;
//LA QUE VIENE POR DEFECTO CON LA TIENDA - (NO SE USA)
function shoopOfertas($cuantos, $categoria = '', $tipo = 1){
// esta es mi entrada en la clase, aqu? inicializo las globales.
$this->numOfertas = 0;
@ -63,6 +64,62 @@ var $curTipo;
}
}
//Esta clase sale para hacer ofertas igual que ocasiones, segun como ya viene hecho
class shoopOfertaNueva{
var $result;
var $cuantas;
var $numOfertas;
var $curTipo;
function shoopOfertaNueva($cuantos, $categoria = '', $tipo = 1){
// esta es mi entrada en la clase, aqu? inicializo las globales.
$this->numOfertas = 0;
$this->contador = 0;
$this->result = false;
$this->curTipo = $tipo;
$cuantos = $cuantos * 4;
$conn = db_connect();
if($conn) {
$query = 'SELECT oferta_id, oferta_fab_id, fab_nombre, oferta_categoria, oferta_nombre, oferta_estado, oferta_pvp, oferta_descripcion
FROM shoop_oferta
LEFT JOIN shoop_fabricantes on (oferta_fab_id=fab_id)
WHERE oferta_unidades > 0
ORDER BY RAND()';
// LIMIT ' . $cuantos;
$this->result = mysql_query($query, $conn);
$this->numOfertas = mysql_num_rows($this->result);
}
}
function getNum() {
return $this->numOfertas;
}
function getNextOferta(){
$oferta = '';
if($this->contador < $this->numOfertas) {
$row = mysql_fetch_array($this->result);
$this->contador ++;
if(file_exists('_ofr/' . $row['oferta_id'] . ($this->curTipo != 2 ? '_168.jpg' : '_247.jpg'))) {
$oferta = array ( 'categoria_id' => $row['oferta_categoria'],
'nombre' => $row['oferta_nombre'],
'id' => $row['oferta_id'],
'estado' => $row['oferta_estado'],
'fab_id' => $row['oferta_fab_id'],
'fab_nombre' => $row['fab_nombre'],
'pvp' => $row['oferta_pvp'],
'descripcion' => $row['oferta_descripcion']);
} else {
$oferta = $this->getNextOferta();
}
}
return $oferta; // es un array
}
}
class shoopOcasion{
var $result;
@ -81,7 +138,7 @@ var $curTipo;
$conn = db_connect();
if($conn) {
$query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion
$query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion, ocasion_fab_id
FROM shoop_ocasion
WHERE ocasion_unidades > 0
ORDER BY RAND()';
@ -106,6 +163,7 @@ var $curTipo;
$ocasion = array ( 'categoria_id' => $row['ocasion_categoria'],
'nombre' => $row['ocasion_nombre'],
'id' => $row['ocasion_id'],
'fab_id' => $row['ocasion_fab_id'],
'estado' => $row['ocasion_estado'],
'precio' => $row['ocasion_precio'],
'pvp' => $row['ocasion_pvp'],

View File

@ -27,19 +27,20 @@ $ocasion_estado=$_REQUEST['ocasion_estado'];
$ocasion_pvp=$_REQUEST['ocasion_pvp'];
$ocasion_precio=$_REQUEST['ocasion_precio'];
$ocasion_unidades=$_REQUEST['ocasion_unidades'];
$ocasion_fab_id=$_REQUEST['ocasion_fab_id'];
$conn = db_connect();
if($conn) {
switch($operacion) {
case "add":
$sql = 'INSERT INTO shoop_ocasion(ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades) VALUES("' . $ocasion_categoria . '", "' . $ocasion_nombre . '", "' . $ocasion_descripcion . '", "' . $ocasion_estado . '", "' . $ocasion_pvp . '", "' . $ocasion_precio . '", "' . $ocasion_unidades . '");';
$sql = 'INSERT INTO shoop_ocasion(ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades, ocasion_fab_id) VALUES("' . $ocasion_categoria . '", "' . $ocasion_nombre . '", "' . $ocasion_descripcion . '", "' . $ocasion_estado . '", "' . $ocasion_pvp . '", "' . $ocasion_precio . '", "' . $ocasion_unidades . '", "' . $ocasion_fab_id . '");';
$result = mysql_query($sql, $conn) or header('Location: ../error.php');
$id = mysql_insert_id($conn);
break;
case "edit":
$sql = 'UPDATE shoop_ocasion SET ocasion_categoria="' . $ocasion_categoria . '", ocasion_nombre="' . $ocasion_nombre . '", ocasion_descripcion="' . $ocasion_descripcion . '", ocasion_estado="' . $ocasion_estado . '", ocasion_pvp="' . $ocasion_pvp . '", ocasion_precio="' . $ocasion_precio . '", ocasion_unidades="' . $ocasion_unidades . '" WHERE ocasion_id = ' . $id;
$result = mysql_query($sql, $conn) or header('Location: ../error.php');
$sql = 'UPDATE shoop_ocasion SET ocasion_categoria="' . $ocasion_categoria . '", ocasion_nombre="' . $ocasion_nombre . '", ocasion_descripcion="' . $ocasion_descripcion . '", ocasion_estado="' . $ocasion_estado . '", ocasion_pvp="' . $ocasion_pvp . '", ocasion_precio="' . $ocasion_precio . '", ocasion_unidades="' . $ocasion_unidades . '", ocasion_fab_id="' . $ocasion_fab_id .'" WHERE ocasion_id = ' . $id;
$result = mysql_query($sql, $conn) or header('Location: ../error.php');
break;
case "del":

View File

@ -33,6 +33,7 @@ $ocasion_estado = "";
$ocasion_pvp = "";
$ocasion_precio = "";
$ocasion_unidades = "";
$ocasion_fab_id = "";
switch($operacion)
{
@ -42,7 +43,7 @@ switch($operacion)
case "edit";
$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 = " . $id;
$query = "SELECT ocasion_id, ocasion_fab_id, ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades FROM shoop_ocasion WHERE ocasion_id = " . $id;
$result = mysql_query($query, $conn);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
@ -53,6 +54,8 @@ switch($operacion)
$ocasion_pvp = $row['ocasion_pvp'];
$ocasion_precio = $row['ocasion_precio'];
$ocasion_unidades = $row['ocasion_unidades'];
$ocasion_fab_id = $row['ocasion_fab_id'];
}
}
break;
@ -127,6 +130,20 @@ define("MAX_SIZE", $max_size);
</tr>
<tr>
<td width="200" class= "lbl">Marca</td>
<td></td>
</tr>
<tr>
<td class="data"><select name="ocasion_fab_id" id="ocasion_fab_id" style="width:200px" class="data">
<option value="" selected>Marcas</option>
<?php include("menu_marcas.php"); ?>
</select>
<script language="JavaScript" type="text/JavaScript"> selectOption('ocasion_fab_id', '<?php echo $ocasion_fab_id; ?>'); </script>
</td>
</tr>
<tr>
<td width="200" class= "lbl">Nombre</td>
<td></td>

View File

@ -11,13 +11,13 @@ include('../db.php');
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ocasi&oacute;n</title>
<title>Oferta</title>
<link href="../sformi.css" rel="stylesheet" type="text/css">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="200"><a href="oferta_edit.php?op=add" class="button">[ a&ntilde;adir ocasi&oacute;n ]</a></td>
<td width="200"><a href="oferta_edit.php?op=add" class="button">[ a&ntilde;adir oferta ]</a></td>
<tr><td colspan="5"><img src="../_imgs/d.gif" width="200" height="5"></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">

View File

@ -65,7 +65,7 @@ define("MAX_SIZE", $max_size);
<input name="op" type="hidden" value="<?= $operacion; ?>">
<input name="id" type="hidden" value="<?= $id; ?>">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td class="lbl12">Detalles del producto de ocasi&oacute;n</td></tr>
<tr><td class="lbl12">Detalles del producto de oferta</td></tr>
<tr><td bgcolor="#777777"><img src="../../_imgs/d.gif" width="100" height="1"></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">

View File

@ -9,16 +9,25 @@
<tr>
<td width="247" align="center" valign="middle">
<div class="destacado_foto">
<a href="ocasion_ficha.php?id=<?php echo $arrayOcasion['id']; ?>"><img src="_ocs/<?php echo $arrayOcasion['id']; ?>_247.jpg" border="0" alt=""></a>
<?php
//LOGOTIPO FABRICANTE
$path = '_logos/c/' . $arrayOcasion['fab_id'] . '.gif';
if (file_exists($path)) {
echo '<img src="'.$path.'"><br>';
}
?>
<img src="_imgs/d.gif" height="6"><br>
<a href="oferta_ficha.php?id=<?php echo $arrayOcasion['id']; ?>"><img src="_ocs/<?php echo $arrayOcasion['id']; ?>_247.jpg" border="0" alt=""></a>
</div>
<div class="destacado_precio"><?php echo ($arrayOcasion['precio'] == '-1' ? 'Consultar' : 'Oferta ' . miNumberFormat($arrayOcasion['precio']) . '<span class="euro">&euro;</span>'); ?></div>
<div class="destacado_precio"><?php echo ($arrayOcasion['precio'] == '-1' ? 'Consultar' : 'Ocasi&oacute;n ' . miNumberFormat($arrayOcasion['precio']) . '<span class="euro">&euro;</span>'); ?></div>
</td>
<td width="12"><img src="_imgs/d.gif" width="12" alt=""></td>
<td width="279" valign="top">
<div class="destacado_tipo azul"><?php echo $arrayOcasion['nombre']; ?></div>
<div class="destacado_modelo"><a href="ocasion_ficha.php?id=<?php echo $arrayOcasion['id']; ?>" class="lmod"><?php echo $arrayOcasion['nombre']; ?></a></div>
<div class="destacado_modelo"><a href="oferta_ficha.php?id=<?php echo $arrayOcasion['id']; ?>" class="lmod"><?php echo $arrayOcasion['nombre']; ?></a></div>
<div class="oferta_texto"><?php if(strlen($arrayOcasion['descripcion'])) { echo substr($arrayOcasion['descripcion'], 0, 150) . '...'; } ?></div>
<div class="producto_ocasion1"><br />Precio PVP: <?php echo $arrayOcasion['pvp'];?> &euro;</div>

39
bann2_oferta.php Normal file
View File

@ -0,0 +1,39 @@
<div class="destacado">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="247"><img src="_imgs/d.gif" width="247" height="1" alt=""></td>
<td width="12"><img src="_imgs/d.gif" width="12" height="1" alt=""></td>
<td width="279"><img src="_imgs/d.gif" width="279" height="1" alt=""></td>
</tr>
<tr>
<td width="247" align="center" valign="middle">
<div class="destacado_foto">
<?php
//LOGOTIPO FABRICANTE
$path = '_logos/c/' . $arrayOferta['fab_id'] . '.gif';
if (file_exists($path)) {
echo '<img src="'.$path.'"><br>';
}
?>
<img src="_imgs/d.gif" height="6"><br>
<a href="oferta_ficha.php?id=<?php echo $arrayOferta['id']; ?>"><img src="_ofr/<?php echo $arrayOferta['id']; ?>_247.jpg" border="0" alt=""></a>
</div>
<div class="destacado_precio"><?php echo ($arrayOferta['pvp'] == '-1' ? 'Consultar' : 'Oferta ' . miNumberFormat($arrayOferta['pvp']) . '<span class="euro">&euro;</span>'); ?></div>
</td>
<td width="12"><img src="_imgs/d.gif" width="12" alt=""></td>
<td width="279" valign="top">
<div class="destacado_tipo azul"><?php echo $arrayOferta['nombre']; ?></div>
<div class="destacado_modelo"><a href="oferta_ficha.php?id=<?php echo $arrayOferta['id']; ?>" class="lmod"><?php echo $arrayOferta['nombre']; ?></a></div>
<div class="oferta_texto"><?php if(strlen($arrayOferta['descripcion'])) { echo substr($arrayOferta['descripcion'], 0, 150) . '...'; } ?></div>
<div class="producto_ocasion1"><br />Precio PVP: <?php echo $arrayOferta['pvp'];?> &euro;</div>
</td>
</tr>
</table>
</div>

View File

@ -80,4 +80,5 @@
</ul>
</li>
<li class="mudo"><a href="ocasion.php" class="parent">OCASI&Oacute;N</a></li>
<li class="mudo"><a href="ofertas.php" class="parent">OFERTAS</a></li>
</ul>

View File

@ -25,8 +25,9 @@ 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
$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';
@ -154,6 +155,7 @@ include('top.htm');
$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;
@ -168,18 +170,12 @@ include('top.htm');
?>
<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="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>
<?php
/*
<td width="240" valign="top" class="data">&nbsp;&nbsp;&nbsp;<?= 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) . '&euro;'); ?></td></tr>
*/
?>
<tr>
<td bgcolor="#EDEEF1" colspan="5"><img src="_imgs/d.gif" width="2" height="1"></td></tr>
<?php

View File

@ -29,10 +29,11 @@ $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
$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);
@ -45,6 +46,7 @@ if($conn) {
$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) {
@ -130,17 +132,20 @@ switch($ocasion_categoria_id) {
<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>
<span class="producto_modelo">Ocasi&oacute;n:</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>
<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/' . $prod_fab_id . '.gif';
$path = '_logos/c/' . $ocasion_fab_id . '.gif';
if (file_exists($path)) {
echo '<img src="'.$path.'"><br>';
}

28
oferta_add.php Normal file
View File

@ -0,0 +1,28 @@
<?php
// ####################################################
// ocasion_add.php
// parte de shoop
// © ff 2005
include("_incl/wfCart.php");
session_start();
include('db.php');
// ####################################################
// cargo el carrito o lo creo nuevo si fuera menester
$cart =& $_SESSION['cart'];
if(!is_object($cart)) $cart = new wfCart();
$cart->add_item($_REQUEST['id'],
1,
$_REQUEST['precio'],
array( 'tipo'=>'OFERTA',
'marca'=>'',
'modelo'=>$_REQUEST['modelo'],
'color'=>'',
'acabados'=>''));
header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
?>

233
oferta_ficha.php Normal file
View File

@ -0,0 +1,233 @@
<?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();
$oferta_id = $_REQUEST['id'];
$oferta_categoria_id = "";
$oferta_categoria_nombre = "";
$oferta_nombre = "";
$oferta_descripcion = "";
$oferta_estado = "";
$oferta_pvp = "";
$oferta_fab_id = "";
$oferta_unidades = "";
$conn = db_connect();
if($conn) {
$query = 'SELECT oferta_id, oferta_categoria, oferta_nombre, oferta_descripcion, oferta_estado, oferta_pvp, oferta_fab_id, oferta_unidades
FROM shoop_oferta
WHERE oferta_id="' . $oferta_id . '"';
$result = mysql_query($query, $conn);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$oferta_categoria_id = $row['oferta_categoria'];
$oferta_nombre = $row['oferta_nombre'];
$oferta_descripcion = $row['oferta_descripcion'];
$oferta_estado = $row['oferta_estado'];
$oferta_pvp = $row['oferta_pvp'];
$oferta_fab_id = $row['oferta_fab_id'];
$oferta_unidades = $row['oferta_unidades'];
//PARCHE DE CATEGORIAS DE OFERTA
switch($oferta_categoria_id) {
case 1: $oferta_categoria_nombre = 'Altavoces'; break;
case 2: $oferta_categoria_nombre = 'Electr&oacute;nicas'; break;
case 3: $oferta_categoria_nombre = 'Reproductores de CD, convertidores D/A, etc.'; break;
case 4: $oferta_categoria_nombre = 'Varios'; break;
default: $oferta_categoria_nombre = 'N/A';
}
$topLabel = '<span class="seccion"><a href="tienda.php" class="pielink">Tienda&nbsp;></a><a href="ocasion.php" class="pielink">&nbsp;Oferta</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 $oferta_id; ?>">
<input name="oferta_categoria_id" id="oferta_categoria_id" type="hidden" value="<?php echo $oferta_categoria_id; ?>">
<input name="oferta_categoria_nombre" id="oferta_categoria_nombre" type="hidden" value="<?php echo $oferta_categoria_nombre; ?>">
<input name="oferta_nombre" id="oferta_nombre" type="hidden" value="<?php echo $oferta_nombre; ?>">
<input name="oferta_descripcion" id="oferta_descripcion" type="hidden" value="<?php echo $oferta_descripcion; ?>">
<input name="oferta_estado" id="oferta_estado" type="hidden" value="<?php echo $oferta_estado; ?>">
<input name="oferta_pvp" id="oferta_pvp" type="hidden" value="<?php echo $oferta_pvp; ?>">
<input name="oferta_precio" id="oferta_fab_id" type="hidden" value="<?php echo $oferta_fab_id; ?>">
<input name="oferta_estado" id="oferta_unidades" type="hidden" value="<?php echo $oferta_unidades; ?>">
<tr>
<td width="170" valign="top" class="producto_texto">
<span class="producto_tipo azul"><?php echo $oferta_categoria_nombre; ?></span><br>
<span class="producto_modelo"><?php echo $oferta_nombre; ?></span><br>
<span class="producto_tipo azul"><?php echo $oferta_estado; ?></span><!--span class="producto_tipo rojo">&nbsp;&nbsp;&nbsp;<?php //echo $oferta_unidades; ?> Unidades</span--><br>
<span class="producto_modelo">Oferta PVP:</span> <span class="producto_precio_ocasion2"><?php echo $oferta_pvp; ?><span class="euro">&euro;</span><br>
<img src="_imgs/d.gif" width="170" height="6"><br>
<a href="oferta_add.php?id=<?= $oferta_id; ?>&precio=<?= $oferta_pvp; ?>&modelo=<?= $oferta_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>
</td>
<td></td>
<td width="170" valign="top" align="center">
<?php
//LOGOTIPO FABRICANTE
$path = '_logos/c/' . $oferta_fab_id . '.gif';
if (file_exists($path)) {
echo '<img src="'.$path.'"><br>';
}
?>
<img src="_imgs/d.gif" width="170" height="6"><br>
<?php
//IMAGEN ARTICULO OCASION
$path = '_ofr/' . $oferta_id . '_168.jpg';
if (file_exists($path)) {
echo '<img src="'.$path.'"></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($oferta_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 $oferta_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>

194
ofertas.php Normal file
View File

@ -0,0 +1,194 @@
<?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 oferta_id, oferta_fab_id, fab_nombre, oferta_categoria, oferta_nombre, oferta_estado, oferta_pvp, oferta_descripcion
FROM shoop_oferta
LEFT JOIN shoop_fabricantes on (oferta_fab_id=fab_id)
WHERE oferta_unidades > 0
ORDER BY oferta_categoria, oferta_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 oferta</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 categora)
$miOferta = new shoopOfertaNueva(1, '');
if($miOferta->getNum()){
$arrayOferta = $miOferta->getNextOferta();
if(!empty($arrayOferta))
include('bann2_oferta.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 \>
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))
{
$oferta_id = $row['oferta_id'];
$oferta_categoria = $row['oferta_categoria'];
$oferta_nombre = $row['oferta_nombre'];
$oferta_estado = $row['oferta_estado'];
$oferta_pvp = $row['oferta_pvp'];
$oferta_fab_id = $row['oferta_fab_id'];
$fab_nombre = $row['fab_nombre'];
$oferta_descripcion = $row['oferta_descripcion'];
if($oferta_categoria != $curSeccion){
$curSeccion = $oferta_categoria;
?>
<tr>
<td colspan="2" class="lbl"><?= $secciones[$oferta_categoria]; ?><img src="_imgs/d.gif" width="15" height="18"></td>
<td width="70" class="lbl" align="right" valign="bottom">PVP 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="oferta_ficha.php?id=<?= $oferta_id; ?> " class="pielink"> <b><?=$fab_nombre;?></b>&nbsp;&nbsp;<?= $oferta_nombre . (strlen($oferta_estado) ? '</span>': "") ; ?></a></td>
<td width="70" valign="top" align="right" class="data"><?= miNumberFormat($oferta_pvp); ?>&nbsp;&euro;</td>
<td width="30" align="right" valign="top"><a href="oferta_add.php?id=<?= $oferta_id; ?>&precio=<?= $oferta_pvp; ?>&modelo=<?= $oferta_nombre; ?>" onMouseOver="MM_swapImage('comprar<?= $oferta_id; ?>','','_imgs/comprbm.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="_imgs/compram.gif" name="comprar<?= $oferta_id; ?>" width="16" height="13" border="0" id="comprar<?= $oferta_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>

View File

@ -9,6 +9,13 @@
<tr>
<td bgcolor="#000000" width="174"><a href="index.php"><img src="_imgs/logo.gif" width="174" height="60" border="0"></a></td>
<td valign="bottom" id="menu">
<a href="index.php">Inicio</a> | <a href="clavequien.php">Quiénes somos</a> | <a href="tienda.php">Tienda</a> | <a href="articulos.php?t=1">Novedades</a> | <a href="articulos2.php?t=2">Learning center</a> | <a href="articulos3.php?t=3">Instalaciones</a> | <a href="ocasion.php">Ocasión</a>
<a href="index.php">Inicio</a> |
<a href="clavequien.php">Quiénes somos</a> |
<a href="tienda.php">Tienda</a> |
<a href="articulos.php?t=1">Novedades</a> |
<a href="ocasion.php">Ocasión</a> |
<a href="ofertas.php">Ofertas</a> |
<a href="articulos3.php?t=3">Instalaciones</a> |
<a href="articulos2.php?t=2">e-Learning</a>
</td></tr>
</table>