Se adapta ofertas para que solo tenga nombre, descripcion, foto y pdf en el caso que lo tenga

git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@16 44ade383-bb54-5b4f-835b-923f7702b206
This commit is contained in:
roberto 2011-06-16 15:34:28 +00:00
parent 75bd9cca22
commit dd89620ad7
8 changed files with 120 additions and 106 deletions

View File

@ -27,7 +27,7 @@
.oferta_precio {
font-family: "Times New Roman", Times, serif;
position: relative;
font-size: 36px;
font-size: 24px;
color: #CB2C54;
font-weight: normal;
top: 12px;
@ -35,6 +35,7 @@
.oferta_texto {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #555555;
font-size: 10px;
position: relative;
top: 14px;

View File

@ -80,9 +80,8 @@ var $curTipo;
$conn = db_connect();
if($conn) {
$query = 'SELECT oferta_id, oferta_fab_id, fab_nombre, oferta_categoria, oferta_nombre, oferta_estado, oferta_pvp, oferta_descripcion
$query = 'SELECT oferta_id, oferta_fab_id, 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;
@ -107,7 +106,6 @@ var $curTipo;
'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 {

View File

@ -24,19 +24,15 @@ include('../db.php');
<?php
$conn = db_connect();
if($conn) {
$query = "SELECT oferta_id, oferta_categoria, fab_nombre, oferta_nombre, oferta_estado, oferta_pvp, oferta_unidades, oferta_descripcion
$query = "SELECT oferta_id, oferta_categoria, oferta_nombre, oferta_estado, oferta_pvp, oferta_unidades, 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);
?>
<tr>
<td width="100" valign="top" class="hdr" align="left">Marca</td>
<td width="355" valign="top" class="hdr">Nombre</td>
<td width="40" valign="top" class="hdr" align="right">Uds.</td>
<td width="80" valign="top" class="hdr" align="right">PVP</td>
<td width="90" valign="top" class="hdr">&nbsp;</td>
<td width="455" valign="top" class="hdr">Nombre</td>
<td width="100" valign="top" class="hdr" align="right">PVP</td>
<td width="100" valign="top" class="hdr">&nbsp;</td>
</tr>
<?php
$secciones = array('', 'Altavoces', 'Electr&oacute;nicas', 'Reproductores de CD, convertidores D/A, etc.', 'Varios');
@ -48,26 +44,12 @@ include('../db.php');
$oferta_nombre = $row['oferta_nombre'];
$oferta_estado = $row['oferta_estado'];
$oferta_pvp = $row['oferta_pvp'];
$oferta_fab_nombre = $row['fab_nombre'];
$oferta_unidades = $row['oferta_unidades'];
$oferta_descripcion = $row['oferta_descripcion'];
if($oferta_categoria != $curSeccion){
$curSeccion = $oferta_categoria;
?>
<tr>
<td colspan="5" class="lbl"><?php echo $secciones[$oferta_categoria]; ?><img src="../_imgs/d.gif" width="15" height="20"></td>
</tr>
<?php
}
?>
<tr>
<td width="100" valign="top" align="left" class="data"><?php echo $oferta_fab_nombre; ?></td>
<td width="355" valign="top" class="data">&nbsp;&nbsp;<?php echo '<span class="lbl">' . $oferta_nombre . '</span>' . (strlen($oferta_estado) ? ' (' . $oferta_estado . ')': "") . (strlen($oferta_descripcion) ? '<br>&nbsp;&nbsp;<i>' . $oferta_descripcion . '</i>': "") ; ?></td>
<td width="40" valign="top" align="right" class="data"><?php echo $oferta_unidades; ?></td>
<td width="80" valign="top" align="right" class="data"><?php echo number_format($oferta_pvp, 2, ',', '.');; ?></td>
<td valign="top" class="data">&nbsp;&nbsp;<?php echo '<span class="lbl">' . $oferta_nombre . '</span>' . (strlen($oferta_estado) ? ' (' . $oferta_estado . ')': "") . (strlen($oferta_descripcion) ? '<br>&nbsp;&nbsp;<i>' . $oferta_descripcion . '</i>': "") ; ?></td>
<td valign="top" align="right" class="data"><?php echo number_format($oferta_pvp, 2, ',', '.');; ?></td>
<td valign="top" class="data" align="center">&nbsp;<a href="oferta_edit.php?op=edit&id=<?php echo $oferta_id; ?>" class="button">[ editar ]</a></td>
</tr>
<tr>

View File

@ -70,7 +70,7 @@ define("MAX_SIZE", $max_size);
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="lbl">Categor&iacute;a</span><br/>
<!--td><span class="lbl">Categor&iacute;a</span><br/>
<select name="oferta_categoria" id="oferta_categoria" style="width:250px">
<option value="1">Altavoces</option>
<option value="2">Electr&oacute;nicas</option>
@ -78,7 +78,7 @@ define("MAX_SIZE", $max_size);
<option value="4">Varios</option>
</select>
<script language="JavaScript" type="text/JavaScript"> selectOption('oferta_categoria', '<?= $oferta_categoria; ?>'); </script>
</td>
</td-->
<td rowspan="16" valign="top">
<table width="250" border="0" cellspacing="0" cellpadding="0">
@ -133,19 +133,19 @@ define("MAX_SIZE", $max_size);
</tr>
<tr>
<!--tr>
<td width="200" class= "lbl">Marca</td>
<td></td>
</tr>
</tr-->
<tr>
<!--tr>
<td class="data"><select name="oferta_fab_id" id="oferta_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('oferta_fab_id', '<?php echo $oferta_fab_id; ?>'); </script>
</td>
</tr>
</tr-->
<tr>
<td width="200" class= "lbl">Nombre</td>
@ -157,8 +157,8 @@ define("MAX_SIZE", $max_size);
<tr><td width="200" class= "lbl">Descripción</td></tr>
<tr><td width="" class="data"><textarea name="oferta_descripcion" cols="50"><?= $oferta_descripcion; ?></textarea></td></tr>
<tr><td width="200" class= "lbl">Estado</td></tr>
<tr><td width="" class="data"><input name="oferta_estado" style="width:px" value="<?= $oferta_estado; ?>">
<!--tr><td width="200" class= "lbl">Estado</td></tr>
<tr><td width="" class="data"><input name="oferta_estado" style="width:px" value="<?= $oferta_estado; ?>"-->
<tr><td width="200" class= "lbl">PVP</td></tr>
<tr><td width="" class="data"><input name="oferta_pvp" type="text" value="<?= $oferta_pvp; ?>" size="10" maxlength="10"></td></tr>

View File

@ -8,38 +8,48 @@
<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 class="destacado_foto">
<?php
//SI TIENE PDF la imagen irá al pdf si no a la ficha
$path_pdf = '_ofr/' . $arrayOferta['id'] . '.pdf';
$path_jpg = '_ofr/' . $arrayOferta['id'] . '_247.jpg';
if (!file_exists($path_pdf))
$path_pdf = "";
if (!file_exists($path_jpg))
$path_jpg = "";
if ($path_pdf != "") {
$enlace = $path_pdf;
}
else
$enlace = "oferta_ficha.php?id=". $arrayOferta['id'];
?>
<a href="<?php echo $enlace; ?>">
<?php
if ($path_jpg != "") {
?>
<img src="<?php echo $path_jpg; ?>" border="0">
<?php } ?>
</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="tit azul"><a href="oferta_ficha.php?id=<?php echo $arrayOferta['id']; ?>" class="lmod"><?php echo $arrayOferta['nombre']; ?></a></div>
<div class="producto_ocasion1"><br />Precio PVP: <?php echo $arrayOferta['pvp'];?> &euro;</div>
<?php
//FOLLETO PDF
$path = '_ofr/' . $arrayOferta['id'] . '.pdf';
if (file_exists($path)) {
echo "<br/><a href='". $path ."'>Ver folleto PDF </a>";
}
?>
<?php $longitud=150;
if (($arrayOferta['pvp']=="") || ($arrayOferta['pvp']==0)) {
$longitud=200;
}
else {?>
<div class="oferta_precio"><?php echo ($arrayOferta['pvp'] == '-1' ? 'Consultar' : miNumberFormat($arrayOferta['pvp']) . '<span class="euro">&euro;</span>'); ?></div>
<?php } ?>
<div class="oferta_texto"><?php if(strlen($arrayOferta['descripcion'])) { echo substr($arrayOferta['descripcion'], 0, $longitud); } ?><a href="oferta_ficha.php?id=<?php echo $arrayOferta['id']; ?>" class="mas">[+]</a>
</div>
</td>
</tr>

View File

@ -4,23 +4,43 @@
<div class="oferta_foto">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td valign="middle" align="center">
<a href="oferta_ficha.php?id=<?php echo $arrayOfertas['id']; ?>"><img src="_ofr/<?php echo $arrayOfertas['id']; ?>_168.jpg" width="160" border="0"></a>
<?php
//SI TIENE PDF la imagen irá al pdf si no a la ficha
$path_pdf = '_ofr/' . $arrayOfertas['id'] . '.pdf';
$path_jpg = '_ofr/' . $arrayOfertas['id'] . '_168.jpg';
if (!file_exists($path_pdf))
$path_pdf = "";
if (!file_exists($path_jpg))
$path_jpg = "";
if ($path_pdf != "") {
$enlace = $path_pdf;
}
else
$enlace = "oferta_ficha.php?id=". $arrayOfertas['id'];
?>
<a href="<?php echo $enlace; ?>">
<?php
if ($path_jpg != "") {
?>
<img src="<?php echo $path_jpg; ?>" width="160" border="0">
<?php } ?>
</a>
</td></tr></table>
</div>
</td>
<td width="8"></td>
<td width="152" valign="top">
<div class="oferta_marca"><?php echo $arrayOfertas['fab_nombre']; ?><br><span class="azul"><?php echo $arrayOfertas['nombre']; ?></span></div>
<div class="tit azul"><?php echo $arrayOfertas['nombre']; ?></div>
<?php $longitud=50;
if (($arrayOfertas['pvp']=="") || ($arrayOfertas['pvp']==0)) {
$longitud=70;
}
else {?>
<div class="oferta_precio"><?php echo ($arrayOfertas['pvp'] == '-1' ? 'Consultar' : miNumberFormat($arrayOfertas['pvp']) . '<span class="euro">&euro;</span>'); ?></div>
<div class="oferta_texto"><?php if(strlen($arrayOfertas['descripcion'])) { echo substr($arrayOfertas['descripcion'], 0, 150) . '...'; } ?></div>
<!--div class="producto_ocasion1"><br />Precio PVP: <?php echo $arrayOfertas['pvp'];?> &euro;</div-->
<?php
//FOLLETO PDF
$path = '_ofr/' . $arrayOfertas['id'] . '.pdf';
if (file_exists($path)) {
echo "<br/><a href='". $path ."'>Ver folleto PDF </a>";
}
?>
<?php } ?>
<div class="oferta_texto"><?php if(strlen($arrayOfertas['descripcion'])) { echo substr($arrayOfertas['descripcion'], 0, $longitud); } ?><a href="oferta_ficha.php?id=<?php echo $arrayOfertas['id']; ?>" class="mas">[+]</a>
</div>
</td></tr>
</table>

View File

@ -126,20 +126,10 @@ switch($oferta_categoria_id) {
<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>
<span class="producto_precio_ocasion2">PVP: <?php echo $oferta_pvp; ?></span><span class="euro">&euro;</span><br>
<img src="_imgs/d.gif" width="170" height="6"><br>
<?php
//FOLLETO PDF
$path = '_ofr/' . $oferta_id . '.pdf';
if (file_exists($path)) {
echo "<a href='". $path ."'>Ver folleto PDF </a>";
}
?>
<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>
@ -148,23 +138,30 @@ switch($oferta_categoria_id) {
<td></td>
<td width="170" valign="top" align="center">
<?php
//SI TIENE PDF la imagen irá al pdf si no a la ficha
$path_pdf = '_ofr/' . $oferta_id . '.pdf';
$path_jpg = '_ofr/' . $oferta_id . '_168.jpg';
if (!file_exists($path_pdf))
$path_pdf = "";
if (!file_exists($path_jpg))
$path_jpg = "";
if ($path_pdf != "") {
$enlace = $path_pdf;
}
else
$enlace = "oferta_ficha.php?id=". $oferta_id;
?>
<?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>
<a href="<?php echo $enlace; ?>">
<?php
if ($path_jpg != "") {
?>
<img src="<?php echo $path_jpg; ?>" width="160" border="0">
<?php } ?>
</a>
<?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>

View File

@ -143,6 +143,12 @@ include('top.htm');
if($result && $numProductos) {
?>
<table border="0" cellspacing="0" cellpadding="0" width="528">
<tr>
<td colspan="2" class="lbl">OFERTA<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
$secciones = array('', 'Altavoces', 'Electr&oacute;nicas', 'Reproductores de CD, convertidores D/A, etc.', 'Varios');
$curSeccion='';
@ -157,20 +163,20 @@ include('top.htm');
$fab_nombre = $row['fab_nombre'];
$oferta_descripcion = $row['oferta_descripcion'];
if($oferta_categoria != $curSeccion){
$curSeccion = $oferta_categoria;
// 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>
<span class="tit azul"><a href="oferta_ficha.php?id=<?= $oferta_id; ?> " class="pielink"> <?= $oferta_nombre . (strlen($oferta_estado) ? '</span>': "") ; ?></a></span><br/>
<?php if(strlen($oferta_descripcion)) { echo substr($oferta_descripcion, 0, 150); } ?><a href="oferta_ficha.php?id=<?php echo $oferta_id; ?>" class="mas">[+]</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>