<?
if(1==2){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../estilo1.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?
}
  if(!$y || !$m){
	$y=date("Y");
	$m=date("m");
  }

?>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="49"><img src="../images/contenedores/padres/ic_asistencia.gif" width="49" height="35" /></td>
    <td width="177" valign="bottom" background="../images/contenedores/pestana_centro.gif" class="lbl_campo"><div align="left" class="titulo_pagina">Control de asistencias<a name="tareash" id="tareas5"></a></div></td>
    <td width="430" background="../images/contenedores/pestana_bg.gif"><div align="left"><img src="../images/contenedores/pestana_derecha.gif" width="16" height="35" /></div></td>
    <td width="244" background="../images/contenedores/pestana_bg.gif"><div align="right"><img src="../images/contenedores/pestana_curva.gif" width="13" height="35" /></div></td>
  </tr>
  <tr>
    <td colspan="4"><table width="900" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10" background="../images/contenedores/pestana_cont_izq.gif">&nbsp;</td>
        <td width="880" bgcolor="#FFFFFF"><br />
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="24%" align="center" valign="top"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C8D0F3">
                <tr>
                  <td height="20" bgcolor="#99A7E7" class="lbl_campo">Seleccione mes / a&ntilde;o a consultar</td>
                </tr>
               <?
               $qma=runsql("select distinct month(fecha) as mes, year(fecha) as year from asistencias where alumno='$uuser'");
               while($ima=registro($qma)){
               ?>
                <tr bgcolor="<?=color_fila(++$cnt0);?>">
                  <td height="15"><img src="../images/flecha_1.png" width="9" height="9" /><a href="index3.php?op=<?="$op&m=".$ima[mes]."&y=".$ima[year];?>" class="link_parrafo"><?=mes_letras($ima[mes])." ".$ima[year];?></a>
                  </td>
                </tr>
                <?
                }
                ?>
              </table></td>
              <td width="76%" align="center" valign="top"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C8D0F3">
                <tr>
                  <td height="20" colspan="6" bgcolor="#98A6E9" class="lbl_campo">Reporte de asistencias <?=mes_letras($m)." $y";?></td>
                </tr>
                <tr>
                  <td width="15%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">Fecha</div></td>
                  <td width="25%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">D&iacute;a</div></td>
                  <td width="24%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">Hora entrada</div></td>
                  <td width="24%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">Hora salida</div></td>
                  <td width="24%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">Asisti&oacute;</div></td>
                  <td width="36%" bgcolor="#98A6E9" class="lbl_campo"><div align="center">Comentarios</div></td>
                </tr>
                <? 
                      
					
                      $qasistencias=runsql("select * from asistencias where alumno = '$uuser' and year(fecha) = $y and month(fecha) = $m order by fecha");
                      if(registros($qasistencias)==0){
                      ?>
                <tr>
                  <td colspan="6" class="parrafo"><em> <img src="../images/flecha_1.png" width="9" height="9" /></em><span class="lbl_campo">No hay datos de asistencias para el alumno en este mes y a&ntilde;o. </span>
                    <div align="center"></div></td>
                </tr>
                <?
                      }
                      while($iasistencias=registro($qasistencias)){
                      ?>
                <tr bgcolor="<?=color_fila(++$cnt);?>">
                  <td height="20" class="parrafo"><div align="center"><?=fecha($iasistencias[fecha]);?><div></td>
                  <td class="parrafo"><div align="center"><?=dia_letras($iasistencias[fecha]);?></div></td>
                  <td class="parrafo"><div align="center"><?=$iasistencias[hora_entrada];?></div></td>
                  <td class="parrafo"><div align="center"><?=$iasistencias[hora_salida];?></div></td>
                  <td class="parrafo"><div align="center"><img src="../images/<?if($iasistencias[asiste]=="S"){echo "si";}else{echo "no";}?>2.gif" width="10" height="15" /></div></td>
                  <td class="parrafo"><div align="center"><?=$iasistencias[comentario];?></div></td>
                </tr>
                <?
                      }
                      ?>
              </table></td>
            </tr>
          </table>
          <br /></td>
        <td width="10" background="../images/contenedores/pestana_cont_der.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><img src="../images/contenedores/pestana_bott_izq.gif" width="49" height="26" /></td>
    <td background="../images/contenedores/pestana_bott_centro.gif">&nbsp;</td>
    <td background="../images/contenedores/pestana_bott_centro.gif">&nbsp;</td>
    <td background="../images/contenedores/pestana_bott_centro.gif"><div align="right"><img src="../images/contenedores/pestana_bott_der.gif" width="13" height="26" /></div></td>
  </tr>
</table>
<?
if(1==2){
?>
</body>
</html>
<?}?>
