<?
include("../fnc.php");
enlinea_c();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>e-Ducativo - Bienvenido</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" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr>
    <td bgcolor="#336699">    <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E5E5E5">
      <tr bgcolor="#FFFFFF">
        <td width="40%"><img src="../images/logo_5.gif" width="300" height="50"></td>
        <td width="60%" background="../images/back_header_admin.gif" bgcolor="#FFFFFF"><div align="right" class="usuario_nombre_enc"><strong><strong><?echo "$unombre $uapellido";?></strong><br>
          </strong>Tiene <?=mensajes($uuser);?> mensaje(s) sin leer</div></td>
      </tr>
      <tr bgcolor="#FFFFFF">
        <td height="15" colspan="2" background="../images/barra_encabezado.gif">&nbsp;</td>
        </tr>
    </table>
      <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC">
        <tr>
          <td valign="top" bgcolor="#FFFFCC">&nbsp;            <div align="right"></div>            <table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#333333">
              <tr align="center" valign="middle" bgcolor="#FFFFCC">
                <td width="75%" height="20" bgcolor="#FFFFCC"><div align="left"><span class="titulo_pagina">REPORTES<img src="../images/flecha_3.jpg" width="9" height="9"> Alumnos por grado de estudio</span> </div>                  <div align="center" class="titulo_pagina"></div></td>
                <td width="25%" bgcolor="#FFFFCC" class="parrafo"><div align="right"><a href="frm_reportes.php" class="link_parrafo">Regresar al men&uacute; de reportes<img src="../images/ic_home.png" width="21" height="21" border="0"></a> </div></td>
              </tr>
              <tr>
                <td colspan="2" align="left" valign="top" bgcolor="#FFFFCC"><div align="left" class="parrafo">
                  <table width="99%"  border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#3886F0">
                    <tr>
                      <td align="left" valign="top">
                      <table width="100%"  border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td width="77%" bgcolor="#FFFFFF" class="lbl_campo">Seleccione un nivel:
                           <select name="menu1" class="textbox" onChange="MM_jumpMenu('self',this,0)">
                           <option value="#" selected>SELECCIONE UNO...</option>
                           <?
                           $qnivel=mysql_query("select * from niveles order by id");

                           while($inivel=mysql_fetch_array($qnivel)){
                             $seln="";
                             if( $inivel[id] == dec($nivel) ){
                               $seln="selected class='selected_option'";
                             }
                             echo "<option value='rpt_alumnosxgrado.php?nivel=".enc($inivel[id])."' $seln>{$inivel[nivel]}</option>";
                           }
                           ?>
                           </select>
                           <?if(!$nivel){exit();}?>
                           Seleccione un grado:
                           <select name="menu1" class="textbox" onChange="MM_jumpMenu('self',this,0)">
                           <option value="#" selected>SELECCIONE UNO...</option>
                           <?
                           $id_nivel=dec($nivel);
                           $qnivel=mysql_query("select * from grados where nivel=$id_nivel order by id");
                           while($inivel=mysql_fetch_array($qnivel)){
                             $selg="";
                             if( $inivel[id] == dec($grado) ){
                               $selg="selected class='selected_option'";
                             }

                             echo "<option value='rpt_alumnosxgrado.php?nivel=$nivel&grado=".enc($inivel[id])."' $selg>{$inivel[grado]}</option>";
                           }
                           ?>
                           </select>
                          </td>
                          <td width="23%" bgcolor="#FFFFFF"><div align="right"><a href="rpt_alumnosxgrado_print.php?<?="nivel=$nivel&grado=$grado";?>" target="_blank" class="link_parrafo"><img src="../images/printButton.png" width="16" height="16" border="0"> Versi&oacute;n imprimible</a> </div></td>
                        </tr>
                      <?
                        if(!$nivel or !$grado){exit();}
                        $id_nivel=dec($nivel);
                        $id_grado=dec($grado);
                        $qnivel=mysql_query("select * from niveles where id = $id_nivel");
                        $inivel=mysql_fetch_array($qnivel);

                        $qgrado=mysql_query("select * from grados where id = $id_grado");
                        $igrado=mysql_fetch_array($qgrado);
                      ?>

                        <tr>
                          <td colspan="2" bgcolor="#FFFFFF" class="titulo_pagina">NIVEL: <?=$inivel[nivel];?> </td>
                        </tr>
                        <tr>
                          <td colspan="2" bgcolor="#FFFFFF" class="titulo_seccion_mn">
                          <?
                          // inicio del ciclo de grados
                          $qgrado=mysql_query("select * from grados where id = {$igrado[id]}");
                          while($igrado=mysql_fetch_array($qgrado)){
                          ?>
                           <table width="100%"  border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="3%" bgcolor="#FFFFFF">&nbsp;</td>
                              <td colspan="2" bgcolor="#FFFFFF" class="titulo_seccion_mn"><br>
                                GRADO ESCOLAR:                                  <?=$igrado[grado];?> </td>
                            </tr>
                            <tr>
                              <td bgcolor="#FFFFFF">&nbsp;</td>
                              <td width="4%" bgcolor="#FFFFFF">&nbsp;</td>
                              <td width="93%" bgcolor="#FFFFFF">

                                <table width="99%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                                  <tr bgcolor="#CFDFEF" class="lbl_campo">
                                    <td width="15%"><div align="center"># Carnet </div></td>
                                    <td width="40%" bgcolor="#CFDFEF"><div align="center">Apellido(s)</div></td>
                                    <td width="45%" bgcolor="#CFDFEF"><div align="center">Nombre(s)</div></td>
                                  </tr>
                                  <?
                                  //inicio del ciclo de los alumnos
                                  $qalumno=mysql_query("select * from alumnos where grado_estudio={$igrado[id]} and nivel_estudio='$inivel[id]'");
                                  while($ialumno=mysql_fetch_array($qalumno)){
                                  ?>
                                  <tr bgcolor="#FFFFFF" class="parrafo">
                                    <td><div align="center"><?=$ialumno[carnet];?></div></td>
                                    <td bgcolor="#FFFFFF"><div align="left"><?=pmayuscula($ialumno[apellido]);?></div></td>
                                    <td bgcolor="#FFFFFF"><?=pmayuscula($ialumno[nombre]);?></td>
                                  </tr>
                                  <?
                                  //fin del ciclo de los alumnos
                                  }
                                  ?>
                                </table>
                            </td>
                            </tr>
                          </table>
                          <?
                          // fin del ciclo de grados
//                          }
                          ?>
                          </td>
                        </tr>
                        <tr>
                          <td colspan="2" bgcolor="#FFFFFF" class="titulo_seccion_mn">
                          <hr size="1" class="textbox"></td>
                        </tr>
                      <?
                      }
                      ?>
                      </table>
                      </td>
                      </tr>
                  </table>
                </div></td>
              </tr>
            </table>
          &nbsp;</td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>