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

<?php
session_start();
?>
<!DOCTYPE html>
<html>

<head>
    <title>Sin titulo</title>
	<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>
<!--Coded with love by Mutiullah Samim-->
<body>
<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 h-100">
    <!--div class="text-center" style="z-index: -1"><img src="images/header.png" width="800px"></div-->
	<div class="d-flex justify-content-center h-100">
		<div class="user_card">
            <div class="d-flex justify-content-center">
                <div class="brand_logo_container">
                    <img src="images/logo_geo.png" class="brand_logo" alt="Logo">
                </div>
                <div class="brand_logo_container1">
                    <img src="images/g980.png" class="brand_logo1" alt="Logo">
                </div>
                <div class="brand_logo_container2">
                    <img src="images/g1010.png" class="brand_logo1" alt="Logo">
                </div>
            </div>
			<div class="d-flex justify-content-center form_container">
				<form action="insertar.php" method="post">
					<input type="hidden" name="escuela" value="<?= $_SESSION["escuela"] ?>">
					<input type="hidden" name="idioma" value="<?= $_POST['idioma']; ?>">
					<div class="input-group mb-3">
						<div class="input-group-append">
							<span class="input-group-text"><i class="fas fa-user"></i></span>
						</div>
						<input type="text" name="nombre" class="form-control input_user" value="" placeholder="<?php
						if ($_POST['idioma']=='Maya')
						{
							echo "Tuláakal a k'aaba'";
						}
						else{
							echo "Nombre Completo ";
						}
						?>" required>
					</div>
					<div class="input-group mb-3">
						<div class="input-group-append">
							<span class="input-group-text"><i class="fas fa-user"></i></span>
						</div>
						<input type="number" pattern="\d*" min="1" max="99" name="edad" class="form-control input_user" value="" placeholder="<?php
						if ($_POST['idioma']=='Maya')
						{
							echo "Ja'ab";
						}
						else{
							echo "Edad ";
						}
						?>" required>
					</div>
					<div class="mt-4">
						<div class="d-flex justify-content-center links">
                            <?php
                            if ($_POST['idioma']=='Maya')
                            {
                                echo "¿Ti' teeche' ba'ax le jets' óolalo'?";
                            }
                            else{
                                echo "¿Qué es para ti la paz?";
                            }
                            ?>
						</div>
					</div>

					<div class="form-group">
						<textarea required class="form-control" rows="8" cols="50" name="comentario" style="resize: none" maxlength="200" onKeyDown="valida_longitud()" onKeyUp="valida_longitud()"></textarea>
						<?php
						if ($_POST['idioma']=='Maya')
						{
							echo "Cantidad u caracteres:.";
						}
						else{
							echo "Cantidad de caracteres: ";
						}
						?>
                        <input type="text" value="0" name=caracteres size=4 style="background: transparent; border: none;">
					</div>

					<div class="d-flex justify-content-center mt-3 login_container">
						<div class="col-md-6"><button type="submit"  class="btn login_btn"><?php
								if ($_POST['idioma']=='Maya')
								{
									echo "Túuxt a meyaj";
								}
								else{
									echo "Enviar";
								}
								?></button></div>
					</div>
				</form>
			</div>



		</div>
	</div>
</div>
<div class="text-center" ><img src="images/g122.png" width="500px" style="margin-bottom: 10px"></div>
<script>
    contenido_textarea = ""
    num_caracteres_permitidos = 200

    function valida_longitud(){
        num_caracteres = document.forms[0].comentario.value.length

        if (num_caracteres > num_caracteres_permitidos){
            document.forms[0].comentario.value = contenido_textarea
        }else{
            contenido_textarea = document.forms[0].comentario.value
        }

        if (num_caracteres >= num_caracteres_permitidos){
            document.forms[0].caracteres.style.color="#ff0000";
        }else{
            document.forms[0].caracteres.style.color="#000000";
        }

        cuenta()
    }
    function cuenta(){
        document.forms[0].caracteres.value=document.forms[0].comentario.value.length;
    }
</script>




</body>
</html>
