modificaciones:

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