modificaciones:

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