<!--
/* Coded by Ing. Ulises Morales Ramirez */
-->

<?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];
	$_SESSION["clave_escuela"] = $_POST['clave_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 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 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 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 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) {

					} else {
						header("location: index.php?err=1");
						mysql_close();
					}
				}
			}
		}
	}
}

?>
<!DOCTYPE html>
<html>


<head>


    <title>Mi Huella por la Paz - Yucatán</title>

    <!-- Favicon -->
    <link rel="shortcut icon" href="favicon.ico?v2">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css"
          integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="ownStyle.css" media="screen"/>


</head>

<body>

<!--div class="text-center" style="z-index: -1"><img src="images/header.png" width="800px"></div-->
<div class="ripple-background">
    <div class="circle xxlarge shade1"></div>
    <div class="circle xlarge shade2"></div>
    <div class="circle large shade3"></div>
    <div class="circle mediun shade4"></div>
    <div class="circle small shade5"></div>
</div>


<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">
            <div class="d-flex justify-content-center">
                <div class="brand_logo_container">
                    <img src="images/logo_geo.png" class=" visible-md brand_logo img-fluid" alt="Logo">
                </div>
                <div class="brand_logo_container1">
                    <img src="images/g980.png" class=" hidden visible-xs visible-sm  img-fluid" alt="Logo">
                </div>
                <div class="brand_logo_container2">
                    <img src="images/g1010.png" class="visible-md  img-fluid" alt="Logo">
                </div>
            </div>
            <div class=" justify-content-center container form_container">

                <form action="encuesta.php" method="post">

                    <input type="hidden" name="escuela" value="<?= $_SESSION["escuela"] ?>">

                    <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>
                        </b>
                    </div>

                    <div class="d-flex justify-content-center mt-3 login_container">
                        <div class="col-md-6">
                            <button type="submit" name="idioma" value="Español" class="btn login_btn">Español</button>
                        </div>
                        <div class="col-md-6">
                            <button type="submit" name="idioma" value="Maya" class="btn login_btn">Maya</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>


    <div class="text-center" style="margin:40px;">
        <img class="img-fluid img-responsive" src="images/Logo-Horizontal-V2-blanco.png" width="200"><br>

        <div class="text-center" style="margin:40px;">
            <img class="img-fluid img-responsive" src="images/g122.png" width="300">
        </div>

    </div>

</div>
</body>
</html>

