tati 12 lat temu
rodzic
commit
5e199c4ff2
1 zmienionych plików z 16 dodań i 18 usunięć
  1. 16 18
      Productos.php

+ 16 - 18
Productos.php

@@ -1,7 +1,7 @@
 <?
 include('db.php');
 
-$statement = $db->prepare("SELECT `nombre` FROM `productos` WHERE `categoria` = ? limit 3");
+$statement = $db->prepare("SELECT `nombre` FROM `productos` WHERE `categoria` = ? limit 7");
 $cat = 'FACIALES';
 $statement->bind_param('s', $cat);
 $statement->execute();
@@ -17,8 +17,6 @@ $statement->bind_result($nombre);
      <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.9.1.js"></script>
 <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
-<link rel="stylesheet" href="/resources/demos/style.css">
-
 </head>
 
 <body>
@@ -56,16 +54,19 @@ $statement->bind_result($nombre);
             </ul>
         </div>
         
-        <div id ="paginas_wrapper">
+        <div id ="paginas_wrapper">
+			<?
+				$i=1;
+				while($statement->fetch()){
+			?>
             <div id="pagina">
-                <div class="nav" style="display: inline; float: left;
-                        height: 30px; margin-top: 170px;">
+                <div class="nav" style="display: inline; float: left; height: 30px; margin-top: 170px;">
                     <label for="img-1" class="prev">&#x2039;</label>
                 </div>
-				<?
-				while($statement->fetch()){
-				?>
-                <div id="lista_productos">
+                <div id="lista_productos">
+					<? while (($i % 3)!=0 && $statement->fetch()) {
+						$i++;
+					?>
                     <div id="producto" style="float:left;">
                         <div style="float : left;">
                             <img src="Images/producto.jpg">
@@ -75,12 +76,9 @@ $statement->bind_result($nombre);
                             <br> blahblahlbahlbfdgracdmksla iaos fjdiosa f<br><br>
                              <u>Ver más</u> 
                         </div>
-                    </div>
+                    </div>
+					<? } //while $i %3 && st-fetch?>
                 </div>
-				<?
-				}
-				?>
-
                 <div class="nav" style="float: right; height: 30px; margin-top: 170px;">
                     <label for="img-3" class="next">&#x203a;</label>
                 </div> 
@@ -89,9 +87,9 @@ $statement->bind_result($nombre);
                         <li style="opacity: 0.5"> &#149; </li>
                         <li style="opacity: 0.5;"> &#149; </li>
                 </ul>
-            </div>
-
-            
+            </div>
+			<? } ?>
+           
             <br>
             <div id="pagina" class="hidden">
                 <div id="lista_productos">