nuevo sistema de busqueda

parent 35e508a3
......@@ -5,47 +5,43 @@
<?php
session_start();
include "conexion.php";
if (isset($_POST['escuela'])) {
$control = 0;
$arr = explode(" de ", $_POST['escuela']);
$_SESSION["escuela"] = $arr[0];
$_SESSION["localidad"] = $arr[1];
if (isset($_POST['clave_escuela'])) {
$_SESSION["escuela"] = $_POST['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);
if ($result->num_rows > 0) {
} 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);
if ($result->num_rows > 0) {
} 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);
if ($result->num_rows > 0) {
} 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);
if ($result->num_rows > 0) {
} 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);
if ($result->num_rows > 0) {
} 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);
if ($result->num_rows > 0) {
......
......@@ -18,7 +18,6 @@ $(document).ready(function () {
});
function selectClave(clave) {
$.ajax({
type: "POST",
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