<?

include("../fnc.php");

enlinea_a();

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Buscar alumnos</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="../estilo1.css" rel="stylesheet" type="text/css">

<script language="javascript">

  function select(parametro){

   top.opener.ifield.value=parametro;

   top.close();

   return false;

  }

</script>

<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></head>



<body>

<table width="385" border="0" align="center" cellpadding="1" cellspacing="0">

  <tr>

    <td><form name="form1" method="post" action="">

      <table width="100%"  border="0" cellspacing="0" cellpadding="1">

        <tr bgcolor="#336699">

          <td colspan="2" class="titulo_seccion_blanco"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="9%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_buscar.png" width="35" height="32"></td>
              <td width="91%" background="../images/tema/bg_titulo_frm.png">Busqueda de usuarios </td>
            </tr>
          </table></td>

          </tr>

        <tr class="parrafo">

          <td width="19%" background="../images/tema/bg_frm_campos.png"><strong>Nombres:</strong></td>

          <td width="81%" background="../images/tema/bg_frm_campos.png"><input name="txtnombres" type="text" class="textbox" id="txtnombres" size="60" maxlength="60"></td>

        </tr>

        <tr class="parrafo">

          <td background="../images/tema/bg_frm_campos.png"><strong>Apellidos:</strong></td>

          <td background="../images/tema/bg_frm_campos.png"><input name="txtapellidos" type="text" class="textbox" id="txtapellidos" size="60" maxlength="60"></td>

        </tr>

        <tr class="parrafo">

          <td colspan="2" background="../images/tema/bg_frm_campos.png"><div align="center">

            <input name="Submit" type="submit" class="boton_guardar" value="Buscar">

          </div></td>

        </tr>

        <tr class="parrafo">

          <td colspan="2"><strong>Llene s&oacute;lo los campos que desea incluir en la b&uacute;squeda </strong></td>

          </tr>

        <tr class="parrafo">

          <td colspan="2">&nbsp;</td>

        </tr>

        <?

        if(!$txtnombres and !$txtapellidos){ exit();}

        $sql="select * from alumnos where 1 ";

        if($txtnombres){$sql.=" and nombre like '%$txtnombres%'";}

        if($txtapellidos){$sql.=" and apellido like '%$txtapellidos%'";}

        $qal=mysql_query($sql);

        ?>

        <tr bgcolor="#336699" class="parrafo">

          <td colspan="2" class="titulo_seccion_blanco"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="9%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_editar.png" width="35" height="32"></td>
              <td width="91%" background="../images/tema/bg_titulo_frm.png">Resultados de la b&uacute;squeda </td>
            </tr>
          </table></td>

        </tr>

        <?

         while($ial=mysql_fetch_array($qal)){

        ?>

        <tr bgcolor="#FFFFFF" class="parrafo">

          <td colspan="2" class="parrafo"><img src="../images/flecha_1.png" width="9" height="9">

          <a href="#" class="link_parrafo" onclick="return select('<?=$ial[carnet];?>')"><?=$ial[carnet]." ".$ial[apellido]." ".$ial[nombre];?></a></td>

        </tr>

        <?

        }

        ?>

      </table>

    </form></td>

  </tr>

</table>

</body>

</html>
