Jelajahi Sumber

expande ver mas

tati 12 tahun lalu
induk
melakukan
2094955b29
3 mengubah file dengan 66 tambahan dan 24 penghapusan
  1. 1 1
      css/especificos.css
  2. 32 23
      productos.php
  3. 33 0
      vermas.php

+ 1 - 1
css/especificos.css

@@ -39,7 +39,7 @@ html, body
     color: white;
     color: white;
     font-size: 26px;
     font-size: 26px;
     text-align: center;
     text-align: center;
-
+	display: none;
 }
 }
 
 
     
     

+ 32 - 23
productos.php

@@ -12,19 +12,38 @@
 <script src="//code.jquery.com/jquery-1.9.1.js"></script>
 <script src="//code.jquery.com/jquery-1.9.1.js"></script>
 <script>
 <script>
 $(document).ready(function() {
 $(document).ready(function() {
+	
+	
 	curpag=1;
 	curpag=1;
     var cat = 'Limpieza';
     var cat = 'Limpieza';
-    $(".cambiarcat").click(function() {
+    
+	$(".cambiarcat").click(function() {
         cat = $(this).attr('val');
         cat = $(this).attr('val');
         getData();
         getData();
     });
     });
-    function getData() {
+    
+	function getData() {
 	$.get('listaprod.php', { cat : cat }).done(function(data) {
 	$.get('listaprod.php', { cat : cat }).done(function(data) {
 		$("#paginas_wrapper").html(data);
 		$("#paginas_wrapper").html(data);
+		$(".texto u").click(function(){
+			expand = $(this).attr('prodid');
+			getDesc();
+		});
 	});
 	});
-} //getData
-    getData();
+	} //getData
+    
+	
+	var expand="";
 
 
+	
+	getData();
+	function getDesc(){
+	$.get('vermas.php', {id : expand}).done(function(data){
+		$("#descripcion-completa").html(data);
+	});
+	}
+	
+	
 	$(".next").click(function() {
 	$(".next").click(function() {
 		if ( ! $(".pagina[num='"+(curpag+1)+"']").length )
 		if ( ! $(".pagina[num='"+(curpag+1)+"']").length )
 			return;
 			return;
@@ -103,29 +122,19 @@ $(document).ready(function() {
         </div>
         </div>
         
         
         <div id ="paginas_wrapper">
         <div id ="paginas_wrapper">
-
         </div>
         </div>
-        
-    </div>
+		
+		<div id="overlay-contact">
+		</div>
+		<div id="descripcion-completa">
+		</div>
+
+			
+	</div>
 
 
 </body>
 </body>
 </html>
 </html>
-<!--            <div num="" class="pagina" >
-                <div class="nav" style="display: inline; float: left; height: 30px; margin-top: 170px;">
-                    <label for="img-1" class="prev">&#x2039;</label>
-                </div>
-                <div id="lista_productos">
-
-                    <div id="producto" style="float:left;">
-                        <div style="float : left;  width:15%;">
-                            <img src="Images/producto.jpg">
-                        </div>
-                        <div style="float : left; width: 74%;">
-                            <h4> <php echo $nombre; ?> </h4>
-                            <br> <php echo $desc; ?> <br><br>
-                             <u>Ver más</u> 
-                        </div>
-                    </div>
+<!--
 
 
                 </div>
                 </div>
                 <div class="nav" style="float: right; height: 30px; margin-top: 170px;">
                 <div class="nav" style="float: right; height: 30px; margin-top: 170px;">

+ 33 - 0
vermas.php

@@ -0,0 +1,33 @@
+<?php
+include('db.php');
+if (!$statement = $db->prepare("SELECT p.presentacion, p.nombre, d.descripcion, f.formula, pri.principio 
+FROM productos p
+left join descripcion d
+on p.idproducto = d.idproducto
+left join principios pri
+on p.idproducto =  pri.idprincipios
+left join formulas f
+on p.idproducto = f.idproducto
+where p.idproducto = ?")) { die('Error');}
+
+if (isset($_GET['id'])) { 	$id = $_GET['id']; } else { die('sin id');}
+$statement->bind_param('d', $id);
+$statement->execute();
+$statement->store_result();
+$statement->bind_result($presentacion, $nombre, $descripcion, $formula, $principio);
+if (!$statement->fetch()) { die('why'); }
+$html = " <div id = 'texto'>
+				<h5>$nombre</h5><br/><br/>
+				<h5>Descripción</h5><br/>
+				$descripcion<br/><br/>
+				<h5>Formula</h5><br/>
+				$formula<br/><br/>
+				<h5>Principios</h5><br/>
+				$principio<br/><br/>
+				<h5>Presentación</h5><br/>
+				$presentacion<br/><br/>
+		  </div>";
+echo $html;
+
+?>
+