<?
include("../fnc.php");
enlinea_a();
if($idcg){
  $id_cg=dec($idcg);
  $qinfo=mysql_query("select * from cp_cargosgenerales where id = $id_cg");
  if(mysql_num_rows($qinfo)==0){
    param_inc();
  }
  $info=mysql_fetch_array($qinfo);
  $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 - 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">
</script>
<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></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><?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" bgcolor="#FFFFCC"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#333333">
              <tr align="center" valign="middle" bgcolor="#FFFFCC">
                <td height="20" bgcolor="#FFFFCC" class="titulo_pagina"><div align="center" class="titulo_seccion">
                    <div align="left">
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td background="../images/tema/bg_contenido.png"><div align="center" class="titulo_pagina">
                              <div align="left" class="parrafo">CONTROL DE PAGOS <img src="../images/flecha_3.jpg" width="9" height="9"> Cargos Generales a Alumnos </div>
                          </div></td>
                          <td width="65" background="../images/tema/bg_contenido.png"><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>
                      </table>
                    </div>
                </div></td>
              </tr>
              <tr>
                <td align="left" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><div align="left" class="parrafo">
                    <table width="100%"  border="0" cellspacing="0" cellpadding="1">
                      <tr>
                        <td align="left" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td>                                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><form name="form1" method="post" action="mnt_cargosgenerales.php">
                                          <table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                                            <tr bgcolor="#336699">
                                              <td colspan="4" class="titulo_formulario"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                  <td width="6%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_pagos.png" width="35" height="32"></td>
                                                  <td width="94%" background="../images/tema/bg_titulo_frm.png">Agregar nuevo cargo general </td>
                                                </tr>
                                              </table></td>
                                            </tr>
                                            <tr bgcolor="#CFDFEF" class="parrafo">
                                              <td width="57%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Descripci&oacute;n del cargo </strong></div></td>
                                              <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Valor del cargo </strong></div>                                              </td>
                                              <td width="17%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Sexo a Aplicar </strong></div></td>
                                              <td width="10%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Opciones</strong></div></td>
                                            </tr>
                                            <tr>
                                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center">
                                                <input name="idcg" type="hidden" id="idcg" value="<?=$idcg;?>">
                                                <input name="idpp" type="hidden" id="idpp" value="<?=$idpp;?>">
                                                <input name="txtdescrip" type="text" class="textbox" id="txtdescrip" size="60" maxlength="255" value="<?=$info[descripcion];?>">
                                              </div></td>
                                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center">
                                                <input name="txtvalor" type="text" class="textbox" id="txtvalor" size="10" maxlength="10" value="<?=$info[valor];?>">
                                              <input type="hidden" name="tipo_trn" value="<?=$tipo;?>">
                                                </div>
                                              </td>
                                              <?
                                              $chksm=$chksf="";
                                              if($info[masculino]=="S"){
                                               $chksm="checked";
                                              }
                                              if($info[femenino]=="S"){
                                               $chksf="checked";
                                              }
                                              ?>
                                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center">[Masculino
                                                <input name="txtsexom" type="checkbox" id="txtsexom" value="S" <?=$chksm;?>>
                                                ]<br>
                                                [Femenino
                                                <input name="txtsexof" type="checkbox" id="txtsexof" value="S" <?=$chksf;?>>
                                              ]</div></td>
                                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center">
                                                <input name="Submit3" type="submit" class="boton_guardar" value="Guardar">
                                              </div></td>
                                            </tr>
                                            <tr>
                                              <td colspan="4" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><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($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>
                                                </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>
                                        </table>
                                      </form></td>
                                    </tr>
                                  </table>
                                  <hr size="1">
                                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td>
                                      <table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                                          <tr bgcolor="#336699">
                                            <td colspan="6" class="titulo_formulario"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                              <tr>
                                                <td width="2%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_editar.png" width="35" height="32"></td>
                                                <td width="98%" background="../images/tema/bg_titulo_frm.png">Listado de cargos generales para alumnos</td>
                                              </tr>
                                            </table></td>
                                          </tr>
                                          <tr bgcolor="#CFDFEF" class="parrafo">
                                            <td width="41%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Descripci&oacute;n del cargo </strong></div></td>
                                            <td width="8%" background="../images/tema/bg_frm_campos.png" class="parrafo"><div align="center"><strong>Femenino</strong></div></td>
                                            <td width="9%" background="../images/tema/bg_frm_campos.png" class="parrafo"><strong>Masculino</strong></td>
                                            <td width="12%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Valor</strong></div></td>
                                            <td width="16%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Mes a aplicar</strong></div></td>
                                            <td width="14%" background="../images/tema/bg_frm_campos.png"><div align="center"><strong>Opciones</strong></div></td>
                                          </tr>
                                          <?
                                        $i=0;
                                        $qp=mysql_query("select * from cp_cargosgenerales order by id");
                                        while($ipp=mysql_fetch_array($qp)){
                                        $i++;
                                        ?>
                                          <tr bgcolor="<?=color_fila($i);?>">
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><?=$ipp[descripcion];?></td>
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center"><img src="../images/<?if($ipp[femenino]=="S"){echo "si";}else{echo "no";}?>2.gif" width="10" height="15"></div></td>
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center"><img src="../images/<?if($ipp[masculino]=="S"){echo "si";}else{echo "no";}?>2.gif" width="10" height="15"></div></td>
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="right">Q<?=moneda($ipp[valor]);?></div>
                                            <div align="right"></div></td>
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="center">

                                          <?
                                            for($n=1;$n<=12;$n++){
                                              $cmp="m$n";
                                              if($ipp["$cmp"]=="S"){
                                                echo substr(mes_letras($n),0,3)." ";
                                              }
                                            }
                                          ?>

                                            </div>
                                              <div align="center"></div>
                                            <div align="right"></div></td>
                                            <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9">
                                            <div align="center">
                                             <a href="<?=$PHP_SELF."?idcg=".enc($ipp[id]);?>" class="link_parrafo"><strong>Modificar</strong></a><br>
                                             <a href="<?="mnt_cargosgenerales.php?tipo_trn=Delete&idcg=".enc($ipp[id]);?>" class="link_parrafo"><strong>Eliminar</strong></a>
                                            </div></td>
                                          </tr>
                                          <?}?>
                                        </table></td></tr>
                                </table></td></tr>
                        </table></td>
                      </tr>
                    </table>
                </div></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>