<?php
	$rersp = '';	
	if($_POST["documento"] != ""){
		$query = mysqli_query($connect,"SELECT * FROM Asistentes WHERE correo = '".$_POST["documento"]."' ");
		if($query->num_rows > 0){
			$data = mysqli_fetch_array($query);
			$_SESSION['id_user'] = $data["id"];
			$_SESSION['name_user'] = $data["nombre"]." ".$data["apellidos"];
			if ($data['imagen'] == '' || $data['imagen'] == null) {
				echo '<script>
				window.location = "/avatar";
			</script>';
			} else {
				$_SESSION['imagen'] = $url.'/img/avatar/'.$data["imagen"];
			}
			echo '
			<script>
				window.location = "/registro"
			</script>
			';
		}
		else{
			$rersp = '
			<div role="alert" style="text-align: center; background-color: #ffffff; padding: 20px; border-radius: 0px 0px 20px 20px;">
				Lo sentimos, este correo no se encuentra registrado en nuestro sistema.<!--<br>Lo invitamos a realizar su registro ahora en el siguiente botón.<br>
				
				<a href="/registro">
				<button class="btn btn-warning btn_item_menu" style="background-color: #0b80ba; border: 0;font-size: 17px; border-radius: 30px; padding: 4px 30px;">
					REGISTRARME AHORA
				</button>
				</a>-->
				
			</div>
			';
			
		}
	}
?>


<div class="container">
<video autoplay muted id="myVideo" >
        
		<!-- <source src="https://firebasestorage.googleapis.com/v0/b/fora2020-b6f9b.appspot.com/o/ournorth%2FPeru-Ecuador_1.mp4?alt=media&token=ca26bb13-2654-46b3-acc3-1ff6704ca1db" type="video/mp4"> -->
		<source src="https://firebasestorage.googleapis.com/v0/b/beegoup-160ea.appspot.com/o/astellas-0960-1040.mp4?alt=media&token=3cba805f-f11f-4adc-9ccd-53d3865018ec" type="video/mp4">

		
   </video>
	   <!-- <img id="myVideo" src="img/bg_home.jpeg" alt=""> -->

   <style>
	  #myVideo {
		 position: fixed;
		 right: 0;
		 bottom: 0px;
		 min-width: 100%;
		 min-height: 100%;
		   z-index: -1;
		   width: 100%;
	   }
   </style>
	<?php echo $rersp; ?>
	
	<div class="row">
		
        <div class="col-md-12" align="center">
            <!-- <h1 style="margin-top: 3%; color: #006db7;">INGRESO</h1>
			<img src="img/login.png" style="width: 90%; max-width: 170px; "><br> -->

            
            <div style="max-width: 500px; text-align: center; padding-top: 200px;">
			
                <form action="" method="post">
                    <label style="font-size: 12">* Por favor ingrese su correo electrónico en un formato valido.</label>
                    <input type="email" class="form-control" name="documento" placeholder="Correo" required style="text-align: center; font-size: 25px;">

                    <button type="submit" class="btn btn-primary btn_ingreso" style=" font-size: 22px; background-color: #fdd300; border: 0; border-radius: 0px; padding: 10px 50px; border-radius: 60px; margin-bottom: 25px; margin-top: 15px">
                        Ingresar <i class="fa fa-arrow-right" aria-hidden="true" style=" margin-left: 8px;"></i>
                    </button>
                </form>
                
            </div>
			
		</div>
		
	</div>
	
</div>

<style>
    /* body{
        background-image: url(<?php /* echo $url */; ?>/img/bg_register.jpeg);
        
    }
     */
    
    ::-webkit-input-placeholder { /* Edge */
      color: #000 !important;
    }

    :-ms-input-placeholder { /* Internet Explorer 10-11 */
      color: #000 !important;
    }
    
    input::placeholder{
      color: #000 !important;
    }

	.btn_ingreso{
		margin-top: 0px;
		font-size: 14px;
		color: #000;
		padding: 5px 8px;
	}
	.btn_ingreso:hover{
		color: #d91e49;
	}
    
</style>

   
        