modificaciones:

responsivo
no permita ingresar escuelas inexistentes
parent d12fa8ca
This diff is collapsed.
......@@ -2,31 +2,37 @@
include 'conexion.php';
//echo $_POST['dato'];
$sql = 'SELECT * FROM Preescolar WHERE CV_CCT LIKE "'.$_POST['dato'].'" OR NOMBRECT LIKE "'.$_POST['dato'].'"';
$sql = 'SELECT * FROM Inicial WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
$sql = 'SELECT * FROM Primaria WHERE CV_CCT LIKE "'.$_POST['dato'].'" OR NOMBRECT LIKE "'.$_POST['dato'].'"';
$sql = 'SELECT * FROM Preescolar WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
$sql = 'SELECT * FROM Secundaria WHERE CV_CCT LIKE "'.$_POST['dato'].'" OR NOMBRECT LIKE "'.$_POST['dato'].'"';
$sql = 'SELECT * FROM Primaria WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
$sql = 'SELECT * FROM Media WHERE CV_CCT LIKE "'.$_POST['dato'].'" OR NOMBRECT LIKE "'.$_POST['dato'].'"';
$sql = 'SELECT * FROM Secundaria WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
$sql = 'SELECT * FROM Superior WHERE CV_CCT LIKE "'.$_POST['dato'].'" OR NOMBRECT LIKE "'.$_POST['dato'].'"';
$sql = 'SELECT * FROM Media WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
$sql = 'SELECT * FROM Superior WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
......@@ -37,5 +43,6 @@ if ($result->num_rows > 0) {
}
}
}
}
}
$conn->close();
\ No newline at end of file
......@@ -4,6 +4,8 @@
<?php
include 'conexion.php';
$sql = "SELECT * FROM Inicial";
$result0 = $conn->query($sql);
$sql = "SELECT * FROM Preescolar";
$result1 = $conn->query($sql);
$sql = "SELECT * FROM Primaria";
......@@ -92,6 +94,10 @@ $conn->close();*/
<datalist id="Escuelas">
<?php
while ($row = $result0->fetch_assoc()) {
echo '<option value="' . utf8_encode($row["CV_CCT"]) . '">' . utf8_encode($row["NOMBRECT"]) . ' <br>(' . utf8_encode($row["C_NOM_LOC"]) . ')</option>';
//echo '<option value="'.utf8_encode($row["NOMBRECT"]).'">de '.utf8_encode($row["C_NOM_LOC"]).' <br>clave: '.utf8_encode($row["CV_CCT"]).'</option>';
}
while ($row = $result1->fetch_assoc()) {
echo '<option value="' . utf8_encode($row["CV_CCT"]) . '">' . utf8_encode($row["NOMBRECT"]) . ' <br>(' . utf8_encode($row["C_NOM_LOC"]) . ')</option>';
//echo '<option value="'.utf8_encode($row["NOMBRECT"]).'">de '.utf8_encode($row["C_NOM_LOC"]).' <br>clave: '.utf8_encode($row["CV_CCT"]).'</option>';
......
......@@ -9,35 +9,41 @@ if (isset($_POST['escuela'])) {
$control = 0;
$arr = explode(" de ", $_POST['escuela']);
$_SESSION["escuela"] = $arr[0];
$_SESSION["localidad"]=$arr[1];
$_SESSION["localidad"] = $arr[1];
$_SESSION["clave_escuela"] = $_POST['clave_escuela'];
}
$sql = 'SELECT * FROM Preescolar WHERE CV_CCT LIKE "'.$_SESSION["clave_escuela"].'" AND NOMBRECT LIKE "'.$_SESSION["escuela"].'"';
$sql = 'SELECT * FROM Inicial WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["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 Preescolar WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["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 Primaria WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["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 Secundaria WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["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 Media WHERE CV_CCT LIKE "' . $_SESSION["clave_escuela"] . '" AND NOMBRECT LIKE "' . $_SESSION["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"] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
......@@ -49,7 +55,9 @@ if ($result->num_rows > 0) {
}
}
}
}
}
?>
<!DOCTYPE html>
<html>
......@@ -107,7 +115,7 @@ if ($result->num_rows > 0) {
<input type="hidden" name="escuela" value="<?= $_SESSION["escuela"] ?>">
<div class="mt-4 text-center" style="margin-top: -20px!important; color: white;" >
<div class="mt-4 text-center" style="margin-top: -20px!important; color: white;">
<b>
<h1>Escuela:</h1>
<h2><?= $_SESSION["escuela"] ?></h2>
......
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