<?
include("../fnc.php");
enlinea_p();
?>
<!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_padre.gif" bgcolor="#FFFFFF"><div align="right" class="usuario_nombre_enc"><strong>ALUMNO: <?echo "$unombre $uapellido";?><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">
        <tr>
          <td width="20%" valign="top" bgcolor="#FFFFCC"><?php include("menu.php"); ?>&nbsp;</td>
          <td width="80%" valign="top" bgcolor="#FFFFCC"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#333333">
            <tr align="center" valign="middle" bgcolor="#FFFFCC">
              <td height="20" class="titulo_pagina"><div align="center" class="titulo_pagina"><strong>Bienvenido al sistema </strong></div></td>
            </tr>
            <tr>
              <td align="left" valign="top" bgcolor="#FFFFCC"><div align="left" class="parrafo">
                <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
                  <tr>
                    <td bgcolor="#FFFFFF"><form name="form1" method="post" action="asistencia.php">
                      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                        <tr bgcolor="#6699CC">
                          <td colspan="2" class="titulo_formulario">Control de asistencia
                            <input name="busqueda" type="hidden" id="busqueda" value="ok"></td>
                        </tr>
                        <tr>
                          <td width="30%" bgcolor="#CFDFEF" class="lbl_campo">Seleccione un mes a consultar: </td>
                          <td width="70%" bgcolor="#ECF2F9">
                          <select name="menu1" class="textbox" onChange="MM_jumpMenu('self',this,0)">
                          <option value="#" selected>Seleccione uno...</option>
                            <?
                            $qmes=mysql_query("select distinct year(fecha) as year, month(fecha) as mes
                                               from asistencias
                                               where alumno='$uuser'
                                               order by year, mes");
                            while($imes=mysql_fetch_array($qmes)){
                            ?>
                            <option value='asistencia.php?mes=<?=$imes[mes]."&busqueda=1&year=".$imes[year];?>'><?=mes_letras($imes[mes])." ".$imes[year];?></option>
                            <?
                            }
                            ?>
                          </select>
                          </td>
                        </tr>
                        <tr>
                          <td colspan="2" class="lbl_campo">&nbsp;</td>
                          </tr>
                        <tr>
                          <td colspan="2" class="lbl_campo">
                          <?if(!$busqueda){exit();}?>
                          <table width="245" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6699CC">
                            <tr bgcolor="#6699CC" class="titulo_formulario">
                              <td width="73" bgcolor="#6699CC"><div align="center">Fecha</div></td>
                              <td width="105" bgcolor="#6699CC"><div align="center">D&iacute;a</div></td>
                              <td width="57"><div align="center">Asisti&oacute;</div></td>
                            </tr>
                            <?
                            $qas=mysql_query("select *
                                              from asistencias
                                              where alumno='$uuser'
                                              and month(fecha)=$mes
                                              and year(fecha)=$year
                                              order by fecha");
                            $i=0;
                            while($iasistencia=mysql_fetch_array($qas)){
                            $i++;
                            ?>
                            <tr bgcolor="<?=color_fila($i);?>">
                              <td><div align="center" class="parrafo"><?=fecha($iasistencia[fecha]);?></div></td>
                              <td><div align="center" class="parrafo"><?=dia_letras($iasistencia[fecha]);?></div></td>
                              <td><div align="center"><img src="../images/<?if($iasistencia[asiste]=="S"){echo "si";}else{echo "no";}?>2.gif" width="10" height="15"></div></td>
                            </tr>
                            <?
                            }
                            ?>
                          </table></td>
                        </tr>
                      </table>
                    </form></td>
                  </tr>
                </table>
                &nbsp; </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>