Переглянути джерело

Merge branch 'master' of ssh://davidventura.com.ar:443/tati/especificosweb

tati 12 роки тому
батько
коміт
0c55c23ed2
5 змінених файлів з 47 додано та 17 видалено
  1. 10 0
      contacto.php
  2. 5 3
      css/especificos.css
  3. 18 7
      index.php
  4. 9 0
      newsletter.php
  5. 5 7
      productos.php

+ 10 - 0
contacto.php

@@ -0,0 +1,10 @@
+<?php
+include('db.php');
+
+if (!isset($_POST['nombre'])||!isset($_POST['mail'])||!isset($_POST['consulta'])) die ("Completa todos los campos.");
+if (strpos($_POST['mail'], "@") === false || strlen($_POST['mail']) < 5) die ("Mail invalido");
+if (!$statement = $db->prepare("INSERT INTO consultas(nombre,email,consulta,fecha) VALUES (?,?,?,NOW())")) die("Hubo un error con la base de datos");
+$statement->bind_param("sss",$_POST['nombre'],$_POST['mail'],$_POST['consulta']);
+$statement->execute();
+//TODO mail
+echo "Consulta enviada correctamente.";

+ 5 - 3
css/especificos.css

@@ -215,7 +215,8 @@ html, body
     width: 90%;
     height: auto;
     text-align: center;
-    margin: 70px auto;
+    margin: 0px auto;
+    padding-top: 70px;
     border-bottom: 1px solid #475A68;
 }
 
@@ -314,7 +315,8 @@ width: 70%;
 	width: 100%;
     height: auto;
     text-align: center;
-    margin: 70px auto;
+    margin: 0px auto;
+    padding-top: 70px;
     border-bottom: 1px solid #475A68;
 }
 #cursos h1 span{
@@ -331,7 +333,7 @@ width: 70%;
     height: 400px;*/
     max-height: 100%;
     width: 90%; 
-    margin: 100px auto;
+    margin: 0px auto;
     font-family: 'Champagne and Limousine';
     /*font-size: 200%;*/
     color: #D8DFE1;

+ 18 - 7
index.php

@@ -30,7 +30,7 @@ header('Content-Type: text/html; charset=UTF-8');
             });
 
 	        $('li a').click(function () {
-	            $('html, body').animate({ scrollTop: $($(this).attr('href')).position().top }, 'slow');
+                $('html, body').animate({ scrollTop: $($(this).attr('href')).position().top }, 'slow');
 	            return false;
 	        });
 
@@ -50,6 +50,17 @@ header('Content-Type: text/html; charset=UTF-8');
                     $('#logo').css({'opacity':'0', 'transition': 'opacity 0.5s ease-in-out'});
                 }
             });
+            $("#btnconsulta").click(function() {
+                $.post('contacto.php',{nombre: $("#name").val(), mail:$("#email").val(),consulta:$("#message").val()}).done(function(data) {
+                    $("#respuestacontacto").html(data);
+                });
+            });
+            $("#ok").click(function() {
+                $.post('newsletter.php',{mail:$("#suscribe").val()}).done(function(data) {
+                    $("#respuestanewsletter").html(data);
+                });
+            });
+
 
             
         });
@@ -69,7 +80,9 @@ header('Content-Type: text/html; charset=UTF-8');
     <div id="exit"><h5>X</h5></div>
     <form action="" method="post" class="STYLE-NAME">
     <h5>Contacto</h5><br>
-    Un equipo de profesionales está a su servicio para responder sus consultas
+    Un equipo de profesionales está a su servicio para responder sus consultas<br>
+    Av. Bernardino Rivadavia 5427 3F, CABA (1424), Buenos Aires, Argentina.<br>
+    Tel&eacute;fono: +5411 4139-6860/1 +5411 4904-0289.
     <br><br>
     <label>
 
@@ -89,8 +102,9 @@ header('Content-Type: text/html; charset=UTF-8');
     <br> 
     <label>
         <span>&nbsp;</span> 
-        <input type="button" class="button" value="Send" /> 
+        <input id="btnconsulta" type="button" class="button" value="Enviar" /> 
     </label>    
+    <div id="respuestacontacto"></div>
     </form>
 </div>
 
@@ -130,7 +144,6 @@ header('Content-Type: text/html; charset=UTF-8');
     </div>
 
 	<div class="seccion" id="nosotros">
-        <br /><br />
 	    <h1><span>NOSOTROS</span></h1>
 	    
 		<div id="principal">
@@ -196,7 +209,6 @@ header('Content-Type: text/html; charset=UTF-8');
     </div>
 
     <div class="seccion" id="actividades">
-    <br /><br />
         <h1><span>ACTIVIDADES</span></h1>
 		<p>
 		</p>
@@ -204,7 +216,6 @@ header('Content-Type: text/html; charset=UTF-8');
 
 
     <div id="cursos">
-    <br /><br />
 	<div id="curso">	
     <h1><span>CURSOS</span></h1>
 
@@ -253,7 +264,6 @@ OBJETIVOS DEL CURSO: Obtener los conocimientos teóricos y prácticos en el áre
 	
 	
     <div class="seccion" id="distribuidoras">
-    <br /><br />
         <h1><span>DONDE COMPRAR</span></h1>    
 	<?php
 		header('Content-Type: text/html; charset=UTF-8');
@@ -316,6 +326,7 @@ OBJETIVOS DEL CURSO: Obtener los conocimientos teóricos y prácticos en el áre
             <div id="input-footer">
                 <input id="suscribe" type="text" /> 
                 <input id="ok" type="submit" value="Inscribirse" />
+                <div id="respuestanewsletter"></div>
             </div>
 
         </div>

+ 9 - 0
newsletter.php

@@ -0,0 +1,9 @@
+<?php
+include('db.php');
+if (!isset($_POST['mail'])) die ("Completa todos los campos.");
+if (strpos($_POST['mail'], "@") === false || strlen($_POST['mail']) < 5) die ("Mail invalido");
+if (!$statement = $db->prepare("INSERT INTO newsletter(mail,activo) VALUES (?,1)")) die("Hubo un error con la base de datos");
+$statement->bind_param("s",$_POST['mail']);
+if(!$statement->execute()) die("Este mail ya estaba registrado.");
+//TODO mail?
+echo "Suscripto correctamente al newsletter.";

+ 5 - 7
productos.php

@@ -97,13 +97,11 @@ $(document).ready(function() {
     <div id="top_wrapper">
         <div id="navbar" font-family="champagne">
             <ul id="navlist">
-                <li><a href="Especificos.html#nosotros">nosotros</a></li>
-                <li><a href="#productos">productos</a></li>
-                <li><a href="#actividades">actividades</a></li>
-                <li><a href="#top_wrapper"><img src="Images/icons/logo.png" style="width: 51px; height: 50px;" /></a></li>
-                <li><a href="#cursos">cursos</a></li>
-                <li><a href="#distribuidoras">donde comprar</a></li>
-                <li>contacto</li>
+                <li><a href="index.php#nosotros">nosotros</a></li>
+                <li><a href="index.php#actividades">actividades</a></li>
+                <li><a href="index.php#top_wrapper"><img src="Images/icons/logo.png" style="width: 51px; height: 50px;" /></a></li>
+                <li><a href="index.php#cursos">cursos</a></li>
+                <li><a href="index.php#distribuidoras">donde comprar</a></li>
             </ul>
         </div>
     </div>