<?
include("../fnc.php");
enlinea_a();

if($idgrado){
 $id_grado=dec($idgrado);
// echo $idgrado;
 $qver=mysql_query("select grados.*, niveles.nivel as nnivel, jornadas.jornada as njornada
                    from grados inner join jornadas on jornadas.id = grados.jornada
                    inner join niveles on grados.nivel = niveles.id
                    where grados.id = '$id_grado'");
 if(mysql_num_rows($qver)==0){
  alert("El grado no existe","javascript:history.go(-1)");
 }else{
  $info=mysql_fetch_array($qver);
  $tipo="Update";
 }
}else{
 $tipo="Add";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>e-Ducativo - Administraci&oacute;n grados escolares</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../estilo1.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../jsincludes/overlib.js"></script>
<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></head>

<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr>
    <td>    <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><?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" bgcolor="#FFFFCC">
        <tr>
          <td width="20%" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><?php include("menu.php"); ?>&nbsp;</td>
          <td width="80%" valign="top" background="../images/tema/bg_contenido.png"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#333333">
            <tr align="center" valign="middle" bgcolor="#FFFFCC">
              <td width="8%" height="20" background="../images/tema/bg_contenido.png" class="titulo_pagina"><div align="center" class="titulo_pagina"></div></td>
              <td background="../images/tema/bg_contenido.png" class="titulo_pagina"><strong>ADMINISTRACION DE GRADOS ESCOLARES </strong></td>
              <td width="8%" background="../images/tema/bg_contenido.png" class="titulo_pagina"><div align="right"><a href="inicio.php" class="link_parrafo">Inicio<img src="../images/ic_home.png" width="21" height="21" border="0"></a></div></td>
            </tr>
            <tr bgcolor="#CFDFEF">
              <td colspan="3" align="left" valign="top"><div align="left" class="parrafo">
                <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                  <tr>
                    <td colspan="4" bgcolor="#FFFFFF"><span class="titulo_seccion_mn">
                      <?=ggrado($idgrado)." ".gnivel(enc($info[nivel]))." ".gjornada(enc($info[jornada]));?>
                    </span></td>
                    </tr>
                  <tr>
                    <td width="25%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_info_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Informaci&oacute;n General </a></div></td>
                    <td width="25%" bgcolor="#CFDFEF"><div align="center"><a href="frm_grado_cuotas_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo"><strong>Matr&iacute;cula / Cuotas</strong></a></div></td>
                    <td width="25%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_unidades_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Unidades acad&eacute;micas </a></div></td>
                    <td width="25%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_cursos_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Pensum de cursos </a></div></td>
                  </tr>
                </table>
                <form name="form1" method="post" action="mnt_grado_cuotas.php">
                  <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000099">
                    <tr>
                      <td bgcolor="#ECE9D8"><table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                          <tr bgcolor="#CFDFEF">
                            <td width="100%" align="left" valign="middle" class="lbl_campo"><table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                <tr bgcolor="#336699">
                                  <td colspan="2" class="titulo_seccion"><div align="left" class="titulo_formulario">Matr&iacute;cula / Cuotas </div></td>
                                </tr>
                                <tr>
                                  <td width="25%" bgcolor="#CFDFEF">Valor de inscripci&oacute;n:</td>
                                  <td width="75%" bgcolor="#ECF2F9"><input name="txtvinscripcion" type="text" class="textbox" id="txtvinscripcion" dir="rtl" value="<?=$info[vinscripcion];?>" size="10" maxlength="10"></td>
                                  </tr>
                                <tr>
                                  <td bgcolor="#CFDFEF">Valor de la mensualidad:</td>
                                  <td bgcolor="#ECF2F9"><input name="txtvmensualidad" type="text" class="textbox" id="txtvmensualidad" dir="rtl" value="<?=$info[vmensualidad];?>" size="10" maxlength="10"></td>
                                  </tr>
                                <tr>
                                  <td bgcolor="#CFDFEF"><div align="left">Meses que paga el alumno:</div></td>
                                  <td bgcolor="#CFDFEF"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td><div align="center">ENE</div></td>
                                        <td><div align="center">FEB</div></td>
                                        <td><div align="center">MAR</div></td>
                                        <td><div align="center">ABR</div></td>
                                        <td><div align="center">MAY</div></td>
                                        <td><div align="center">JUN</div></td>
                                        <td><div align="center">JUL</div></td>
                                        <td><div align="center">AGO</div></td>
                                        <td><div align="center">SEP</div></td>
                                        <td><div align="center">OCT</div></td>
                                        <td><div align="center">NOV</div></td>
                                        <td><div align="center">DIC</div></td>
                                      </tr>
                                      <?
                                  $chk_m1="";
                                  $chk_m2="";
                                  $chk_m3="";
                                  $chk_m4="";
                                  $chk_m5="";
                                  $chk_m6="";
                                  $chk_m7="";
                                  $chk_m8="";
                                  $chk_m9="";
                                  $chk_m10="";
                                  $chk_m11="";
                                  $chk_m12="";
                                  if($info[m1]=="S"){$chk_m1="checked";}
                                  if($info[m2]=="S"){$chk_m2="checked";}
                                  if($info[m3]=="S"){$chk_m3="checked";}
                                  if($info[m4]=="S"){$chk_m4="checked";}
                                  if($info[m5]=="S"){$chk_m5="checked";}
                                  if($info[m6]=="S"){$chk_m6="checked";}
                                  if($info[m7]=="S"){$chk_m7="checked";}
                                  if($info[m8]=="S"){$chk_m8="checked";}
                                  if($info[m9]=="S"){$chk_m9="checked";}
                                  if($info[m10]=="S"){$chk_m10="checked";}
                                  if($info[m11]=="S"){$chk_m11="checked";}
                                  if($info[m12]=="S"){$chk_m12="checked";}
                                  ?>
                                      <tr bgcolor="#ECF2F9">
                                        <td>
                                          <div align="center">
                                            <input name="m1" type="checkbox" id="m1" value="S" <?=$chk_m1;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m2" type="checkbox" id="m2" value="S" <?=$chk_m2;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m3" type="checkbox" id="m3" value="S" <?=$chk_m3;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m4" type="checkbox" id="m4" value="S" <?=$chk_m4;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m5" type="checkbox" id="m5" value="S" <?=$chk_m5;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m6" type="checkbox" id="m6" value="S" <?=$chk_m6;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m7" type="checkbox" id="m7" value="S" <?=$chk_m7;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m8" type="checkbox" id="m8" value="S" <?=$chk_m8;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m9" type="checkbox" id="m9" value="S" <?=$chk_m9;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m10" type="checkbox" id="m10" value="S" <?=$chk_m10;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m11" type="checkbox" id="m11" value="S" <?=$chk_m11;?>>
                                        </div></td>
                                        <td><div align="center">
                                            <input name="m12" type="checkbox" id="m12" value="S" <?=$chk_m12;?>>
                                        </div></td>
                                      </tr>
                                  </table></td>
                                  </tr>
                            </table></td>
                          </tr>
                          <tr bgcolor="#CFDFEF">
                            <td align="left" valign="middle" class="lbl_campo"><table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                <tr>
                                  <td width="20%">                                        <input name="idgrado" type="hidden" id="idgrado" value="<?=$idgrado;?>">
                                    <input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo;?>"></td><td width="25%"><div align="center">
                                      <input name="Submit" type="submit" class="boton_guardar" tabindex="4" value="<?if($tipo=="Update"){echo "Guardar los cambios";}else{echo "Agregar";}?>">
                                  </div></td>
                                  <td width="25%"><div align="center">
                                      <input name="Submit2" type="button" class="boton_deshacer" tabindex="5" onClick="self.location='inicio.php'" value="Salir (No guarda los cambios)">
                                  </div></td>
                                  <td width="20%">&nbsp;</td>
                                </tr>
                            </table></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                  <br>
                  <a href="inicio.php"><img src="../images/regresar_c.png" width="32" height="32" border="0"></a> <br>
                  <strong>Salir</strong>
                </form>
              </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>