David 12 yıl önce
ebeveyn
işleme
94c76620b6
7 değiştirilmiş dosya ile 30 ekleme ve 53 silme
  1. 1 0
      .gitignore
  2. 5 1
      Images/productos/a.sh
  3. 1 3
      css/productos.css
  4. 4 1
      listaprod.php
  5. 14 1
      productos.php
  6. 0 47
      test1.php
  7. 5 0
      vermas.php

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+Images/*

+ 5 - 1
Images/productos/a.sh

@@ -1 +1,5 @@
-for f in $(ls *{jpg,png}); do convert "$f" -resize 180x180 "../thumbs/$f"; done
+for f in $(ls *{jpg,png}); do
+	if [ ! -f "../thumbs/$f" ]; then
+		convert "$f" -resize 180x180 "../thumbs/$f";
+	fi
+done

+ 1 - 3
css/productos.css

@@ -161,10 +161,8 @@ margin-top: 50px;
 #descripcion_completa{
 
     width: 55%;
-	min-width: 800px;
+	min-width: 850px;
     position: fixed;
-    left: 50%;
-    margin: 0px 0px 0px -25%;
     z-index: 11;
     background: url('../Images/wallpaper.jpg') no-repeat center center ; 
 	background-size: cover;

+ 4 - 1
listaprod.php

@@ -44,7 +44,8 @@ if (!$statement = $db->prepare("SELECT p.idproducto,p.nombre, co.desc_corta, p.t
 FROM productos p 
 left join contenido co on p.idproducto = co.idproducto
 left join categorias c on c.idcategoria = p.categoria
-WHERE c.nombre = ? AND c.idioma = 'espanol' ")) {
+WHERE c.nombre = ? AND c.idioma = 'espanol'
+ORDER BY p.idproducto desc")) {
 die('error!!!');
 }
 $statement->bind_param('s', $cat);
@@ -57,6 +58,8 @@ $pag=0;
 
 if ($count >= 6) echo "<div id='flechaatras'><img src='Images/left.png'></div>";
 while ( $statement->fetch() ) {
+	$nombre=utf8_encode($nombre);
+	$desc=utf8_encode($desc);
     $i++;
     if (($i-1) % 6 == 0  && $i > 1 || $i == 1) {
         echo "<div class='pagina' num='$pag'>\n";

+ 14 - 1
productos.php

@@ -9,6 +9,15 @@
 
 <script src="js/jquery-1.10.2.js"></script>
 <script>
+jQuery.fn.center = function () {
+    this.css("position","absolute");
+    this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + 
+                                                $(window).scrollTop()) + "px");
+    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + 
+                                                $(window).scrollLeft()) + "px");
+    return this;
+}
+
 $(document).ready(function() {
 	
 	
@@ -64,11 +73,16 @@ $(document).ready(function() {
 
 	
 	getData();
+	$(window).resize(function() {
+		$("#descripcion_completa").center();
+	});
+
 	function getDesc(){
 	$.get('vermas.php', {id : expand}).done(function(data){
 		$("#descripcion_completa").html(data);
 		$("#overlay-contact").css("display","block");
 		$("#descripcion_completa").css("display", "block");
+		$("#descripcion_completa").center();
 		$("#overlay-contact").css("height",$(document).height()+"px");
 		$('#overlay-contact').click(function(){
             $('#descripcion_completa, #overlay-contact').hide();
@@ -76,7 +90,6 @@ $(document).ready(function() {
 		$('#exit').click(function(){
 			$('#descripcion_completa, #overlay-contact').hide();
         });
-
 	});
 	}
 	

+ 0 - 47
test1.php

@@ -1,47 +0,0 @@
-Esto es un div
-<?php
-include('db.php');
-
-
-$statement = $db->prepare("SELECT d.nombre, d.telefono, d.direccion, d.localidad, d.provincia, c.categoria
-FROM distribuidoras d
-left join categorias_distribuidoras c
-on d.categoria = c.id
-where d.categoria = 2");
-
-
-$statement->execute();
-$statement->store_result();
-$statement->bind_result($nombre, $telefono, $direccion, $localidad, $provincia, $categoria );
-//$count=$statement->num_rows;
-$html= "<h1>$categoria</h1>
-		<table class='zona'>
-			<thead>
-				<tr>
-					<th>Provincia</th>
-                    <th>Localidad</th>
-                    <th>Distribuidor</th>
-                    <th>Domicilio</th>
-                    <th>Teléfono</th>
-                </tr>
-            </thead>
-			<tbody>";
-echo $html;
-while ( $statement->fetch() ) {
-	
-	
-	echo "
-		<tr>
-		  <td>$provincia</td>
-		  <td>$localidad</td>
-		  <td>$nombre</td>
-		  <td>$direccion</td>
-		  <td>$telefono</td>
-		</tr>";
-}
-
-echo "</tbody></table>";
-?>
-
-aca termina mi div
-

+ 5 - 0
vermas.php

@@ -13,6 +13,11 @@ $statement->store_result();
 $statement->bind_result($nombre, $descripcion, $activos, $aplicacion,$imagen);
 if (!$statement->fetch()) { die('why'); }
 
+$nombre=utf8_encode($nombre);
+$activos=utf8_encode($activos);
+$descripcion=utf8_encode($descripcion);
+$aplicacion=utf8_encode($aplicacion);
+
 echo "
 		<div class='left imagen-mas'>
 				<img src='$imagen'></img>