<?
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" background="../images/tema/bg_frm_campos.png"><div align="left" class="parrafo">
                <table width="100%"  border="0" cellpadding="1" cellspacing="1" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">
                  <tr bgcolor="#FFFFFF">
                    <td colspan="6" class="titulo_seccion_mn"><?=ggrado_completo($idgrado);?></td>
                  </tr>
                  <tr>
                    <td width="16%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_info_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Informaci&oacute;n <br>
                      General </a></div></td>
                    <td width="20%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_cuotas_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo"><strong>Cargos<br>
  Plan General </strong></a></div></td>
                    <td width="14%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_planespagos_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Planes <br>
                      de pagos </a></div></td>
                    <td width="10%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_secciones_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Secciones</a></div></td>
                    <td width="20%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_unidades_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Unidades<br>
                      acad&eacute;micas </a></div></td>
                    <td width="20%" bgcolor="#ECF2F9"><div align="center"><a href="frm_grado_cursos_v2.php?idgrado=<?=$idgrado;?>" class="link_parrafo">Pensum <br>
                      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">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td width="1%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_formularios.png" width="35" height="32"></td>
                                        <td width="99%" background="../images/tema/bg_titulo_frm.png" class="titulo_formulario"><div align="left">Informaci&oacute;n de matr&iacute;cula / cuotas </div></td>
                                      </tr>
                                    </table>
                                  </div></td>
                                </tr>
                                <tr>
                                  <td width="35%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">Inscripci&oacute;n (Matr&iacute;cula) </td>
                                  <td width="65%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtvinscripcion" type="text" class="textbox" id="txtvinscripcion" dir="rtl" value="<?=$info[vinscripcion];?>" size="10" maxlength="10">
                                    <img src="../images/con_info.png" width="16" height="16" border="0" onMouseOver="return overlib('Ingrese el valor que será cargado al alumno (cargo &uacute;nico a pagar en el mes de enero).');" onmouseout="return nd();"></td>
                                </tr>
                                <tr>
                                  <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">Valor de la mensualidad:</td>
                                  <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="txtvmensualidad" type="text" class="textbox" id="txtvmensualidad" dir="rtl" value="<?=$info[vmensualidad];?>" size="10" maxlength="10">
                                    <img src="../images/con_info.png" width="16" height="16" border="0" onMouseOver="return overlib('Ingrese el valor de la mensualidad.<br><br>Este valor ser&aacute; cargado al alumno en cada uno de los meses que seleccione en la parte de abajo.');" onmouseout="return nd();"></td>
                                </tr>
                                <tr>
                                  <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">Seleccione los meses en los que aplica el cargo de la cuota mensual </td>
                                  <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">ENE</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">FEB</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">MAR</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">ABR</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">MAY</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">JUN</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">JUL</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">AGO</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">SEP</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">OCT</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">NOV</div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><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 background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m1" type="checkbox" id="m1" value="S" <?=$chk_m1;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m2" type="checkbox" id="m2" value="S" <?=$chk_m2;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m3" type="checkbox" id="m3" value="S" <?=$chk_m3;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m4" type="checkbox" id="m4" value="S" <?=$chk_m4;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m5" type="checkbox" id="m5" value="S" <?=$chk_m5;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m6" type="checkbox" id="m6" value="S" <?=$chk_m6;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m7" type="checkbox" id="m7" value="S" <?=$chk_m7;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m8" type="checkbox" id="m8" value="S" <?=$chk_m8;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m9" type="checkbox" id="m9" value="S" <?=$chk_m9;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m10" type="checkbox" id="m10" value="S" <?=$chk_m10;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                          <input name="m11" type="checkbox" id="m11" value="S" <?=$chk_m11;?>>
                                      </div></td>
                                      <td background="../images/tema/bg_frm_campos.png"><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%" background="../images/tema/bg_frm_campos.png">                                        <input name="idgrado" type="hidden" id="idgrado" value="<?=$idgrado;?>">
                                    <input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo;?>"></td><td width="25%" background="../images/tema/bg_frm_campos.png"><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%" background="../images/tema/bg_frm_campos.png"><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%" background="../images/tema/bg_frm_campos.png">&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>
              <hr size="1">
              <?
              $tipo_trn="cargo_gral";
              $id_cg=dec($idcg);
              $qinfocg=mysql_query("select * from cp_cargosgenerales where id = $id_cg");
              if(mysql_num_rows($qinfocg)>0){
              $infocg=mysql_fetch_array($qinfocg);
              $tipo_trn="upd_cargo_gral";
              }
              
              
              ?>
              <form action="mnt_grado_cuotas.php" method="post" name="form2" id="form2">
                <table width="100%"  border="0" cellpadding="1" cellspacing="1" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">
                  <tr bgcolor="#CFDFEF">
                    <td colspan="4" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3"><div align="center">
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="1%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_pagos.png" width="35" height="32"></td>
                          <td width="99%" background="../images/tema/bg_titulo_frm.png" class="titulo_formulario"><div align="left">Agregar nuevo cargo al grado </div></td>
                        </tr>
                      </table>
                    </div></td>
                  </tr>
                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                    <td width="68%" background="../images/tema/bg_frm_campos.png" class="lbl_campo">Seleccione un cargo </td>
                    <td width="6%" background="../images/tema/bg_frm_campos.png" class="lbl_campo">Valor</td>
                    <td width="25%" background="../images/tema/bg_frm_campos.png" class="lbl_campo">D&iacute;a m&aacute;ximo de pago </td>
                  </tr>
                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                    <td background="../images/tema/bg_frm_campos.png"><select name="txtdesccargo" class="lbl_formulario" id="txtdesccargo" onchange="document.form2.txtdescadicional.focus();">
                        <option value="SV">Seleccione un cargo...</option>
                        <?
                        $qcr=mysql_query("select * from cp_tipos_cargos order by descripcion");
                        while($icr=mysql_fetch_array($qcr)){
                          $sel="";
                          if($icr[id]==$infocg[codigo]){
                           $sel="selected class='selected_option'";
                           $descextra=substr($infocg[descripcion],( strlen($infocg[descripcion])-strlen($icr[descripcion])-1)*-1);
                          }
                        ?>
                        <option value="<?=$icr[id];?>" <?=$sel;?>><?=$icr[descripcion];?></option>
                        <?}?>
                      </select>
                        <br>
                        <span class="lbl_campo">Descripci&oacute;n Adicional</span><br>
                        <input name="txtdescadicional" type="text" class="textbox" id="txtdescadicional" size="40" maxlength="40" value="<?=$descextra;?>">
                        <br></td>
                    <td background="../images/tema/bg_frm_campos.png"><input name="txtvcargo" type="text" class="font_red_11" id="txtvcargo3" size="6" maxlength="10" value="<?=$infocg[valor];?>"></td>
                    <td background="../images/tema/bg_frm_campos.png"><input name="txtdpago" type="text" class="font_red_11" id="txtdpago" size="2" maxlength="2" value="<?=$infocg[dia];?>">
                        <span class="font_red_11"> de cada mes <br>
                        <span class="lbl_campo"></span> </span>
                        <hr size="1">
                        <?
                        $chkmsc=$chkfem="";
                        if($infocg[masculino]=="S"){$chkmsc="checked";}
                        if($infocg[femenino]=="S"){$chkfem="checked";}
                        
                        ?>
                        <span class="lbl_campo">Hombres
                        <input name="txth" type="checkbox" id="txth" value="S" <?=$chkmsc;?>>
                        <br>
                        Mujeres
                        <input name="txtm" type="checkbox" id="txtm" value="S" <?=$chkfem;?>>
                        </span></td>
                  </tr>
                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                    <td colspan="3" background="../images/tema/bg_frm_campos.png"><span class="lbl_formulario">Seleccione los meses para aplicar el cargo a todos los alumnos que se inscriban a este grado </span><br>
                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                          <tr class="parrafo">
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>ENE</strong></div></td>
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>FEB</strong></div></td>
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>MAR</strong></div></td>
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>ABR</strong></div></td>
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>MAY</strong></div></td>
                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>JUN</strong></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($infocg[m1]=="S"){$chk_m1="checked";}
                                  if($infocg[m2]=="S"){$chk_m2="checked";}
                                  if($infocg[m3]=="S"){$chk_m3="checked";}
                                  if($infocg[m4]=="S"){$chk_m4="checked";}
                                  if($infocg[m5]=="S"){$chk_m5="checked";}
                                  if($infocg[m6]=="S"){$chk_m6="checked";}
                                  if($infocg[m7]=="S"){$chk_m7="checked";}
                                  if($infocg[m8]=="S"){$chk_m8="checked";}
                                  if($infocg[m9]=="S"){$chk_m9="checked";}
                                  if($infocg[m10]=="S"){$chk_m10="checked";}
                                  if($infocg[m11]=="S"){$chk_m11="checked";}
                                  if($infocg[m12]=="S"){$chk_m12="checked";}
                                  ?>
                          <tr bgcolor="#ECF2F9">
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m1" type="checkbox" id="m1" value="S" <?=$chk_m1;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m2" type="checkbox" id="m2" value="S"  <?=$chk_m2;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m3" type="checkbox" id="m3" value="S"  <?=$chk_m3;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m4" type="checkbox" id="m4" value="S"  <?=$chk_m4;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m5" type="checkbox" id="m5" value="S"  <?=$chk_m5;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m6" type="checkbox" id="m6" value="S"  <?=$chk_m6;?>>
                            </div></td>
                          </tr>
                          <tr bgcolor="#ECF2F9" class="parrafo">
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>JUL</strong></div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>AGO</strong></div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>SEP</strong></div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>OCT</strong></div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>NOV</strong></div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center"><strong>DIC</strong></div></td>
                          </tr>
                          <tr bgcolor="#ECF2F9">
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m7" type="checkbox" id="m7" value="S"  <?=$chk_m7;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m8" type="checkbox" id="m8" value="S"  <?=$chk_m8;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m9" type="checkbox" id="m9" value="S"  <?=$chk_m9;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m10" type="checkbox" id="m10" value="S"  <?=$chk_m10;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m11" type="checkbox" id="m11" value="S" <?=$chk_m11;?>>
                            </div></td>
                            <td background="../images/tema/bg_frm_campos.png"><div align="center">
                                <input name="m12" type="checkbox" id="m12" value="S" <?=$chk_m12;?>>
                            </div></td>
                          </tr>
                      </table></td>
                  </tr>
                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                    <td colspan="3" background="../images/tema/bg_frm_campos.png"><div align="center">
                        <input name="Submit22" type="submit" class="boton_guardar" value="Guardar cargo">
                        <input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo_trn;?>">
                        <input name="idgrado" type="hidden" id="idgrado" value="<?=$idgrado;?>">
                        <input name="idcg" type="hidden" id="idcg" value="<?=$idcg;?>">
                        <?
                        if($idcg){
                        ?>
                        <input name="Submit3" type="button" class="boton_guardar" onClick="self.location='frm_grado_cuotas_v2.php?idgrado=<?=$idgrado;?>'" value="Agregar Nuevo">
                        <?
                        }
                        ?>
                    </div></td>
                  </tr>
                </table>
                    </form>
              <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <tr>
                  <td colspan="6" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="1%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_editar.png" width="35" height="32"></td>
                      <td width="99%" background="../images/tema/bg_titulo_frm.png" class="titulo_formulario"><div align="left">Detalle de cargos asociados al grado  </div></td>
                    </tr>
                  </table></td>
                  </tr>
                <tr>
                  <td width="44%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">Descripci&oacute;n</div></td>
                  <td width="4%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">Valor</div></td>
                  <td width="7%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">D&iacute;a  de pago </div></td>
                  <td width="17%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">El cargo aplica a: </div></td>
                  <td width="17%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">Meses a efectuar el cargo </div></td>
                  <td width="11%" background="../images/tema/bg_frm_campos.png" bgcolor="#AEC9E3" class="lbl_campo"><div align="center">Acciones</div></td>
                </tr>
                <?
                $id_grado = dec($idgrado);
                $qcg=mysql_query("select * from cp_cargosgenerales where grado = '$id_grado' order by descripcion");
                while($icg=mysql_fetch_array($qcg)){
                if($icg[masculino]=="S"){$msc="si";}else{$msc="no";}
                if($icg[femenino]=="S"){$fem="si";}else{$fem="no";}                
                ?>
                <tr>
                  <td bgcolor="#ECF2F9"><div align="justify"><?=$icg[descripcion];?></div></td>
                  <td bgcolor="#ECF2F9"><div align="right"><?=$icg[valor];?></div></td>
                  <td bgcolor="#ECF2F9"><div align="center"><?=$icg[dia];?></div></td>
                  <td bgcolor="#ECF2F9">Hombres: <img src="../images/<?=$msc;?>2.gif" width="10" height="15"><br>
                    Mujeres : <img src="../images/<?=$fem;?>2.gif" width="10" height="15"> </td>
                  <td bgcolor="#ECF2F9">
                  <?
                  for($i=1;$i<=12;$i++){
                    $tmp="m$i";
                    if($icg[$tmp]=="S"){
                      echo substr(mes_letras($i),0,3)." ";
                    }
                  }
                  ?>                  </td>
                  <td bgcolor="#ECF2F9"><div align="center"><a href="<?=$PHP_SELF."?idgrado=$idgrado&idcg=".enc($icg[id]);?>" class="link_parrafo">Modificar</a><br>
                      <a href="#" class="link_parrafo">Eliminar</a></div></td>
                </tr>
                <?
                }
                ?>
              </table>
              </div></td>
              </tr>
          </table></td>
        </tr>
    </table>    </td>
  </tr>
</table>
</body>
</html>
