cambio de selector

parent be8c950e
......@@ -77,7 +77,7 @@ session_start();
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-sort-numeric-up"></i></span>
</div>
<input type="number" pattern="\d*" min="1" max="99" name="edad" class="form-control input_user" value="" placeholder="<?php
<input type="number" pattern="\d*|^[0-9]*$" min="1" max="99" name="edad" class="form-control input_user" value="" placeholder="<?php
if ($_POST['idioma']=='Maya')
{
echo "Ja'ab";
......
<!--
/* Coded by Ing. Ulises Morales Ramirez */
-->
<?php
include 'conexion.php';
$sql = "SELECT * FROM Inicial";
$result0 = $conn->query($sql);
$sql = "SELECT * FROM Preescolar";
$result1 = $conn->query($sql);
$sql = "SELECT * FROM Primaria";
$result2 = $conn->query($sql);
$sql = "SELECT * FROM Secundaria";
$result3 = $conn->query($sql);
$sql = "SELECT * FROM Media";
$result4 = $conn->query($sql);
$sql = "SELECT * FROM Superior";
$result5 = $conn->query($sql);
/*
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Mi Huella por la Paz - Yucatán</title>
<!-- Favicon -->
......@@ -98,7 +67,7 @@ $conn->close();*/
<input type="hidden" name="longitude" id="longitude">
</div>
<div class="input-group">
<div id="suggesstion-box" ></div>
<div id="suggesstion-box" class="col-md-12"></div>
</div>
<div class="" style="color: white;">
......@@ -151,57 +120,7 @@ $conn->close();*/
</div>
</div>
<script>
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
$("#latitude").val(position.coords.latitude);
$("#longitude").val(position.coords.longitude);
}
$(document).ready(function () {
$("#search-box").keyup(function () {
$.ajax({
type: "POST",
url: "readEscuelas.php",
data: 'keyword=' + $(this).val(),
beforeSend: function () {
$("#search-box").css("background", "#FFF url(images/LoaderIcon.gif) no-repeat 165px");
},
success: function (data) {
$("#suggesstion-box").show();
$("#suggesstion-box").html(data);
$("#search-box").css("background", "#FFF");
}
});
});
});
function selectCountry(val,clave,localidad) {
$('#nombre_escuela').empty();
$('#clave').empty();
$('#titulo1').empty();
$('#titulo2').empty();
$("#search-box").val(val);
$("#suggesstion-box").hide();
$('#clave_escuela').val(clave);
$('#nombre_escuela').append('' + $('#search-box').val());
$('#titulo1').append('<h1><b>Escuela: </b></h1>');
$('#titulo2').append('<h3><b>Localidad:</b></h3>');
$('#clave').append(localidad);
$('#next').attr("disabled", false);
}
</script>
<script src="script.js"></script>
</body>
</html>
......@@ -16,7 +16,7 @@ $nombre = str_replace("'","''",$_POST['nombre']);
$comentario = str_replace("'","''",$_POST['comentario']);
$sql = "INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'".$_SESSION['clave_escuela']."','".$_POST['idioma']."','".$nombre."',".$_POST['edad'].",'".$comentario."', CURRENT_TIMESTAMP,'".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."','".$_SESSION["latitude"]."','".$_SESSION["longitude"]."')";
$sql = "INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'".$_SESSION['clave_escuela']."','".$_POST['idioma']."','".$nombre."',".abs($_POST['edad']).",'".$comentario."', CURRENT_TIMESTAMP,'".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."','".$_SESSION["latitude"]."','".$_SESSION["longitude"]."')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
......
......@@ -308,7 +308,13 @@ input[type=number]::-webkit-outer-spin-button {
}
}
#suggesstion-box {
position: absolute;
height: 20em;
overflow-y: auto;
overflow-x: hidden;
}
#country-list{list-style:none;z-index: 1; position: absolute;}
#country-list{list-style:none;z-index: 1; position: absolute; max-height: 10px}
#country-list li{padding: 10px; background: #f0f0f0; border-bottom: #bbb9b9 1px solid;}
#country-list li:hover{background:#ece3d2;cursor: pointer;}
\ No newline at end of file
......@@ -2,7 +2,7 @@
include "conexion.php";
if (!empty($_POST["keyword"])) { ?>
<ul id="country-list" class="col-md-12 pull-right">
<ul id="country-list" class="col-md-12 pull-right dropdown" >
<?php
$sql = 'SELECT * FROM Inicial WHERE CV_CCT LIKE "%' . $_POST['keyword'] . '%" OR NOMBRECT LIKE "%' . $_POST['keyword'] . '%" LIMIT 0,6';
$result = $conn->query($sql);
......
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
$("#latitude").val(position.coords.latitude);
$("#longitude").val(position.coords.longitude);
}
$(document).ready(function () {
$("#search-box").keyup(function () {
$.ajax({
type: "POST",
url: "readEscuelas.php",
data: 'keyword=' + $(this).val(),
beforeSend: function () {
$("#search-box").css("background", "#FFF url(images/LoaderIcon.gif) no-repeat 165px");
},
success: function (data) {
$("#suggesstion-box").show();
$("#suggesstion-box").html(data);
$("#search-box").css("background", "#FFF");
}
});
});
});
function selectCountry(val,clave,localidad) {
$('#nombre_escuela').empty();
$('#clave').empty();
$('#titulo1').empty();
$('#titulo2').empty();
//$("#suggesstion-box").empty();
$("#search-box").val(val);
//
$('#suggesstion-box').empty();
$("#suggesstion-box").hide();
$('#clave_escuela').val(clave);
$('#nombre_escuela').append('' + $('#search-box').val());
$('#titulo1').append('<h1><b>Escuela: </b></h1>');
$('#titulo2').append('<h3><b>Localidad:</b></h3>');
$('#clave').append(localidad);
$('#next').attr("disabled", false);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment