nuevo sistema de busqueda

parent 35e508a3
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<div class="brand_logo_container1"> <div class="brand_logo_container1">
<img src="images/g980.png" class=" hidden visible-xs visible-sm brand_logo1 " alt="Logo"> <img src="images/g980.png" class=" hidden visible-xs visible-sm brand_logo1 " alt="Logo">
</div> </div>
<div class="brand_logo_container2"> <div class="brand_logo_container2">
<img src="images/g1010.png" class="visible-md brand_logo1 " alt="Logo"> <img src="images/g1010.png" class="visible-md brand_logo1 " alt="Logo">
</div> </div>
</div> </div>
......
...@@ -5,47 +5,43 @@ ...@@ -5,47 +5,43 @@
<?php <?php
session_start(); session_start();
include "conexion.php"; include "conexion.php";
if (isset($_POST['escuela'])) {
$control = 0; if (isset($_POST['clave_escuela'])) {
$arr = explode(" de ", $_POST['escuela']); $_SESSION["escuela"] = $_POST['escuela'];
$_SESSION["escuela"] = $arr[0];
$_SESSION["localidad"] = $arr[1];
$_SESSION["clave_escuela"] = $_POST['clave_escuela']; $_SESSION["clave_escuela"] = $_POST['clave_escuela'];
$_SESSION["latitude"] = $_POST['latitude'];
$_SESSION["longitude"] = $_POST['longitude'];
} }
$sql = 'SELECT * FROM Inicial WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Inicial WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
} else { } else {
$sql = 'SELECT * FROM Preescolar WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Preescolar WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
} else { } else {
$sql = 'SELECT * FROM Primaria WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Primaria WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
} else { } else {
$sql = 'SELECT * FROM Secundaria WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Secundaria WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
} else { } else {
$sql = 'SELECT * FROM Media WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Media WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
} else { } else {
$sql = 'SELECT * FROM Superior WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["escuela"] . '"'; $sql = 'SELECT * FROM Superior WHERE CV_CCT ="' . $_POST['clave_escuela'] . '"';
$result = $conn->query($sql); $result = $conn->query($sql);
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
......
...@@ -18,7 +18,6 @@ $(document).ready(function () { ...@@ -18,7 +18,6 @@ $(document).ready(function () {
}); });
function selectClave(clave) { function selectClave(clave) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "getData.php", url: "getData.php",
......
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