|
@@ -2,23 +2,24 @@
|
|
|
<?php
|
|
<?php
|
|
|
include('db.php');
|
|
include('db.php');
|
|
|
|
|
|
|
|
-$statement = $db->prepare("SELECT p.nombre, d.desc_corta, d.descripcion
|
|
|
|
|
|
|
+if (!$statement = $db->prepare("SELECT p.idproducto,p.nombre, d.desc_corta
|
|
|
FROM productos p
|
|
FROM productos p
|
|
|
left join descripcion d on p.idproducto = d.idproducto
|
|
left join descripcion d on p.idproducto = d.idproducto
|
|
|
left join categorias c on c.idcategoria = p.categoria
|
|
left join categorias c on c.idcategoria = p.categoria
|
|
|
-WHERE c.nombre = ? AND c.idioma = 'espanol' ");
|
|
|
|
|
-$cat = 'Limpieza';
|
|
|
|
|
-if (isset($_GET['cat'])) {
|
|
|
|
|
- $cat = $_GET['cat'];
|
|
|
|
|
|
|
+WHERE c.nombre = ? AND c.idioma = 'espanol' ")) {
|
|
|
|
|
+die('error!!!');
|
|
|
}
|
|
}
|
|
|
|
|
+$cat = 'Limpieza';
|
|
|
|
|
+if (isset($_GET['cat'])) { $cat = $_GET['cat']; }
|
|
|
$statement->bind_param('s', $cat);
|
|
$statement->bind_param('s', $cat);
|
|
|
$statement->execute();
|
|
$statement->execute();
|
|
|
$statement->store_result();
|
|
$statement->store_result();
|
|
|
-$statement->bind_result($nombre,$desc,$descripcion);
|
|
|
|
|
|
|
+$statement->bind_result($id,$nombre,$desc);
|
|
|
$count=$statement->num_rows;
|
|
$count=$statement->num_rows;
|
|
|
$i=0;
|
|
$i=0;
|
|
|
$pag=0;
|
|
$pag=0;
|
|
|
|
|
|
|
|
|
|
+if ($count > 6) echo "<div id='flechaatras'><!--imagen--></div>";
|
|
|
while ( $statement->fetch() ) {
|
|
while ( $statement->fetch() ) {
|
|
|
$i++;
|
|
$i++;
|
|
|
if (($i-1) % 6 == 0 && $i > 1 || $i == 1) {
|
|
if (($i-1) % 6 == 0 && $i > 1 || $i == 1) {
|
|
@@ -31,12 +32,12 @@ while ( $statement->fetch() ) {
|
|
|
<img src='Images/producto.jpg'>
|
|
<img src='Images/producto.jpg'>
|
|
|
</div>
|
|
</div>
|
|
|
<div class='texto'>
|
|
<div class='texto'>
|
|
|
- <h5>$nombre</h5><br>$desc<br><br><u>Ver más</u>
|
|
|
|
|
|
|
+ <h5>$nombre</h5><br>$desc<br><br><u prodid='$id'>Ver más</u>
|
|
|
</div>
|
|
</div>
|
|
|
</div>";
|
|
</div>";
|
|
|
echo $html;
|
|
echo $html;
|
|
|
if($i % 2 == 0) { echo "</div>"; } # listaproductos
|
|
if($i % 2 == 0) { echo "</div>"; } # listaproductos
|
|
|
if($i % 6 == 0) { echo "</div>"; } #pagina
|
|
if($i % 6 == 0) { echo "</div>"; } #pagina
|
|
|
}
|
|
}
|
|
|
|
|
+if ($count > 6) echo "<div id='flechafwd'><!--imagen--></div>";
|
|
|
?>
|
|
?>
|
|
|
-
|
|
|