modificaciones:

responsivo
no permita ingresar escuelas inexistentes
parent d12fa8ca
This diff is collapsed.
......@@ -2,37 +2,44 @@
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 {
echo "0";
$sql = 'SELECT * FROM Superior WHERE CV_CCT LIKE "' . $_POST['dato'] . '" OR NOMBRECT LIKE "' . $_POST['dato'] . '"';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "1";
} else {
echo "0";
}
}
}
}
......
......@@ -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>';
......
......@@ -6,50 +6,58 @@
session_start();
include "conexion.php";
if (isset($_POST['escuela'])) {
$control = 0;
$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 {
header("location: index.php?err=1");
mysql_close();
$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) {
} else {
header("location: index.php?err=1");
mysql_close();
}
}
}
}
}
}
?>
<!DOCTYPE html>
<html>
......@@ -86,7 +94,7 @@ if ($result->num_rows > 0) {
</div>
<div class="container col-md-12" style="margin-top: 10%">
<div class="container col-md-12" style="margin-top: 10%">
<div class="d-flex justify-content-center col-md-12 col-sm-12 col-xs-12">
<div class="user_card">
......@@ -107,15 +115,15 @@ 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>
<div class="d-flex justify-content-center links" style="margin-top: 100px!important;">
<b>¿EN QUÉ LENGUAJE DESEA CONTESTAR?
<br>
¿BA'AX TI T'AANIL A K'AAT A NÚUKTIK?</>
</div>
<h1>Escuela:</h1>
<h2><?= $_SESSION["escuela"] ?></h2>
<div class="d-flex justify-content-center links" style="margin-top: 100px!important;">
<b>¿EN QUÉ LENGUAJE DESEA CONTESTAR?
<br>
¿BA'AX TI T'AANIL A K'AAT A NÚUKTIK?</>
</div>
</b>
</div>
......@@ -141,7 +149,7 @@ if ($result->num_rows > 0) {
</div>
</div>
</div>
</body>
</html>
......
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