<?php  //session_destroy();
ob_start();
if(session_start()){session_destroy();}
include ('conf/config.inc.php');
if(isset($_POST['val']) && isset($_POST['db_name'])){
validar_entrada($_POST['usuario'],$_POST['pass'],$_POST['db_name'],$SERVER_NAME,$_POST['tipo']) ;
}
ob_end_flush();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="assets/ico/favicon.ico">
    <title>GESTOR ACADEMICO CDLE - Ingreso</title>

    <!-- Bootstrap core CSS -->
    <link href="dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="signin.css" rel="stylesheet">
        <link href="offcanvas.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script>
    function cambio_img(ide){

    if(ide=='A'){document.getElementById('imagen').src = 'img/foto/admin.jpg';}
    if(ide=='D'){document.getElementById('imagen').src = 'img/foto/teacher.jpg';}    
    if(ide=='E'){document.getElementById('imagen').src = 'img/foto/estudiante.jpg';}        
    if(ide=='P'){document.getElementById('imagen').src = 'img/foto/padres.jpg';}     
    }
    </script>
    
  </head>

  <body onkeyup='if (event.keyCode == 13) document.forms["ingreso"].ingresar.click()'>

    <div class="container">
<div class="panel panel-default well " align='center'>
<div class='' align='center' style='margin:10px auto'>
<img src='img/backpack2.png' width='200px'>
</div>
      <form class="form-signin" role="form" name='ingreso' method='post' action='index.php' target='_self'>
      <input type='hidden' name='val' id='val' value='1'>
      <input type='hidden' name='db_name' id='db_name' value='cdleweb_ga2026'>
      

      <div align=center><img id='imagen'  style='-moz-transition: all 1s ease-in-out;
					  -webkit-transition: all 1s ease-in-out;
					  -o-transition: all 1s ease-in-out;
					  transition: all 1s ease-in-out;
					border-radius: 50%;
					-moz-border-radius: 50%;
					-webkit-border-radius: 50%;
					-khtml-border-radius: 50%;
					border: 2px solid #cee6fb;
					margin-bottom:10px;
					 overflow: hidden;'  src='img/foto/teacher.jpg' width='70px' height='70px' ></div>
      
      
      <div class='input' style='width:93%;'>
        <select name='tipo' id='tipo'  class="form-control" placeholder="" required  onchange='cambio_img(this.value)' style='font-size:12px;margin-bottom:10px'>
        	<option value='D'>Docente</option>        	
        	<option value='E'>Estudiante</option>   
        	<option value='P'>Padres</option>        	     	
        	<option value='A'>Administrador</option>        	
        </select>
	</div>

      <div class='input-group'>
  	<span class='input-group-addon'><i class='glyphicon glyphicon-user'></i></span>
        <input name='usuario' id='usuario' type="text" class="form-control" placeholder="usuario" required >
	</div>
	<div class='input-group'>
      <span class='input-group-addon'><i class='glyphicon glyphicon-lock'></i></span>
                <input name='pass' id='pass' type="password" class="form-control" placeholder="clave" required>
	</div>



        <button class="btn btn-sm btn-primary btn-block" style='width:94%' type="submit">Ingresar</button>
      </form>
</div>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    
     <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="dist/js/bootstrap.min.js"></script>
    <script src="offcanvas.js"></script>

    
    
    <!-- Placed at the end of the document so the pages load faster -->
  </body>
</html>