<?php

include ("clases/autor.class.php"); $objau = new autor();
?>
<!DOCTYPE html>
<html>
<head>
<title>Consulta Docentes</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="Shortcut Icon" type="image/x-icon" href="assets/icons/book.ico" />
    <script src="js/sweet-alert.min.js"></script>
    <link rel="stylesheet" href="css/sweet-alert.css">
    <link rel="stylesheet" href="css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/jquery.mCustomScrollbar.css">
    <link rel="stylesheet" href="css/timeline.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.11.2.min.js"><\/script>')</script>
    <script src="js/modernizr.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/main.js"></script>
	
	<script>
	function consultar(f){
	f.action = 'consultadocentes.php';
	f.submit();return true;
	}
	</script>
</head>

<body><form action="controladores/procesa.php" method="post" enctype="multipart/form-data" name="f" class="navbar-form navbar-left">
    
	<div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="home">
	<ul>
			   <h4> 
			      Consultar Docentes
				<a href="listaentradas.php" class="close" data-dismiss="modal" aria-hidden="true">
			   <span class="glyphicon glyphicon-share" aria-hidden="true"></span>			 </a>
				</h4>
			
			  
              
                    <table class="table table-responsive" >
                      <tr >
                        <td colspan="2"  ><input type="text" name="buscar" class="form-control" placeholder="Nombre de Docente">                          
						<button class="btn btn-primary" type="button" onClick="consultar(this.form);"><span class="glyphicon glyphicon-search"></span></button></td>
                      </tr>
                      <? 
			  $obj = new autor();
			  $c = $_REQUEST['buscar'];
			  if($c==""){
			  $lista = $obj->ListaTotal();
			  }
			  else{
			  $lista=$obj->ListarPorAutor($c);
			  }
			  for($i = 0; $i<count($lista); $i++)
			  {
			  ?>
  <tr >
     <td width="3%"><span class="glyphicon glyphicon-user"></span></td>
                        <td width="97%"><a href="pagdocente.php?id=<?=$lista[$i]['iddoc'];?>" target="trabajos" class="text-muted text_docentes">
                          <?= $lista[$i]["nombres"];?>
                          <?= $lista[$i]["apellidos"];?>
                        </a></td>
                      </tr>
                      
                      <?
			  }
			  ?>
                    </table>
					
		
	
	</form>

</body>
</html>
