Explorar el Código

imagenes+thumbs

david hace 12 años
padre
commit
c006255628
Se han modificado 3 ficheros con 7 adiciones y 6 borrados
  1. 1 1
      css/productos.css
  2. 3 3
      listaprod.php
  3. 3 2
      vermas.php

+ 1 - 1
css/productos.css

@@ -40,7 +40,6 @@
 }
 
 #productos_descripcion{
-	margin-top: 100px;
 	border-bottom: 0px solid black;
 	margin-bottom: -100px;
 }
@@ -145,3 +144,4 @@ margin-top: 50px;
 .vermas { display: inline; margin: 0px; font-weight: bold; }
 .pagina[num="1"] { display: none; }
 .pagina { height: 760px; }
+.center { display:block; margin: 0px auto; }

+ 3 - 3
listaprod.php

@@ -1,7 +1,7 @@
 <?php
 include('db.php');
 
-if (!$statement = $db->prepare("SELECT p.idproducto,p.nombre, co.desc_corta
+if (!$statement = $db->prepare("SELECT p.idproducto,p.nombre, co.desc_corta, p.thumb
 FROM productos p 
 left join contenido co on p.idproducto = co.idproducto
 left join categorias c on c.idcategoria = p.categoria
@@ -13,7 +13,7 @@ if (isset($_GET['cat'])) { 	$cat = $_GET['cat']; }
 $statement->bind_param('s', $cat);
 $statement->execute();
 $statement->store_result();
-$statement->bind_result($id,$nombre,$desc);
+$statement->bind_result($id,$nombre,$desc,$thumb);
 $count=$statement->num_rows;
 $i=0;
 $pag=0;
@@ -32,7 +32,7 @@ while ( $statement->fetch() ) {
 
 	$html ="<div class='$class'>
                 <div class='imagen'>
-                    <img src='Images/producto.jpg'>
+                    <img src='$thumb'>
                 </div>
                 <div class='texto'>
                     <h5>$nombre</h5><br>$desc<p class='vermas' prodid='$id' style='cursor:pointer;'> [+]</p>

+ 3 - 2
vermas.php

@@ -1,6 +1,6 @@
 <?php
 include('db.php');
-if (!$statement = $db->prepare("SELECT p.nombre, c.descripcion, c.activos, c.aplicacion
+if (!$statement = $db->prepare("SELECT p.nombre, c.descripcion, c.activos, c.aplicacion,p.imagen
 FROM productos p
 left join contenido c
 on p.idproducto = c.idproducto
@@ -10,11 +10,12 @@ if (isset($_GET['id'])) { 	$id = $_GET['id']; } else { die('sin id');}
 $statement->bind_param('d', $id);
 $statement->execute();
 $statement->store_result();
-$statement->bind_result($nombre, $descripcion, $activos, $aplicacion);
+$statement->bind_result($nombre, $descripcion, $activos, $aplicacion,$imagen);
 if (!$statement->fetch()) { die('why'); }
 
 echo "<div id = 'texto'>
 	    <h5 style='color:#2B4C5F; text-align:right;'>$nombre</h5><br/><br/>
+        <img class='center' src='$imagen'></img>
 		<h5 style='color:#2B4C5F;'>Descripción</h5><br/>
 		$descripcion<br/><br/>";
 		if($activos != ''){