<?
include("../fnc.php");
enlinea_a();
?>
<!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">
function validar(formulario){
 var respuesta;
 var formulario = document.form2;
 
 if(document.form2.txtdesccargo.value=="SV"){
   alert("Seleccione un cargo");
   document.form2.txtdesccargo.focus();
   return (false);
 }

 if(document.form2.txtvcargo.value==""){
   alert("Ingrese el valor del cargo");
   document.form2.txtvcargo.focus();
   return (false);
 }

 if(document.form2.txtmasculino.checked == false && document.form2.txtfemenino.checked == false){
   alert("Seleccione por lo menos un sexo para hacer el cargo");
   return (false);
 }
 
 if(formulario.m1.checked==false && formulario.m2.checked==false && formulario.m3.checked==false && formulario.m4.checked==false && formulario.m5.checked==false && formulario.m6.checked==false && formulario.m7.checked==false && formulario.m8.checked==false && formulario.m9.checked==false && formulario.m10.checked==false && formulario.m11.checked==false && formulario.m12.checked==false){
   alert("Seleccione al menos un mes a efectuar el cargo");
   return (false);
 }
 
 respuesta=confirm("Está seguro de efectuar el cargo?");
 if(!respuesta){
   return (false);
 }
return (true);
}
</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"> Cargo a alumnos en forma global por grado </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 background="../images/tema/bg_contenido.png"><form name="form1" method="post" action="">
                                  <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr>
                                      <td width="27%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Seleccione un grado </strong></td>
                                      <td width="61%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9">
                                        <select name="txtgrado" class="textbox" id="select">
                                          <option value="SV" selected>Seleccione uno...</option>
                                          <?
                               $qalum=mysql_query("select jornadas.jornada, niveles.nivel, grados.grado, grados.id as idg
                                                   from grados inner join jornadas on jornadas.id = grados.jornada
                                                   inner join niveles on grados.nivel = niveles.id
                                                   order by jornadas.jornada, niveles.id, grados.en_numeros, grados.grado");
                               while($ialum=mysql_fetch_array($qalum)){
                               $sel="";
                               if($txtgrado == $ialum[idg]){
                                $sel="selected class='selected_option'";
                               }
                                echo "<option value='{$ialum[idg]}' $sel>{$ialum[jornada]} | {$ialum[nivel]} | {$ialum[grado]}</option>";
                               }
                               ?>
                                        </select>
                                      </td>
                                      <td width="12%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="Submit" type="submit" class="boton_guardar" value="Continuar"></td>
                                    </tr>
                                  </table>
                                  <?
                          if(!$txtgrado){
                           exit();
                          }
                          if($txtgrado=='SV'){
                            alert("Seleccione un grado","javascript:history.go(-1)");
                          }

                          $qalm=mysql_query("select * from grados where id = '$txtgrado'");
                          if(mysql_num_rows($qalm)==0){
                            alert("ERROR:\\nEl grado no existe","javascript:history.go(-1)");
                          }

                          $qgr=mysql_query("select jornadas.jornada, niveles.nivel, grados.grado, grados.id as idg, grados.vinscripcion, grados.vmensualidad
                                            from grados inner join jornadas on jornadas.id = grados.jornada
                                            inner join niveles on grados.nivel = niveles.id
                                            where grados.id = $txtgrado
                                            order by jornada, niveles.nivel, grado");

                          $igr=mysql_fetch_array($qgr);
                          ?>
                                </form>
                                  <br>
                                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><form name="form2" method="post" action="mnt_cargo_group.php?op=Add&key=<?=enc("grupo");?>&cargo=<?=enc("Otros");?>&idg=<?=enc($txtgrado);?>" onSubmit="return validar(this.form2);">
                                          <br>
                                          <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                                            <tr bgcolor="#CFDFEF">
                                              <td colspan="2" background="../images/tema/bg_frm_campos.png" class="titulo_seccion">Aplicar cargo a todos los alumnos de: <br>                                                
                                              <?=$igr[grado]." , ".$igr[nivel]." , ".$igr[jornada]?></td>
                                            </tr>
                                            <tr bgcolor="#CFDFEF">
                                              <td colspan="2" background="../images/tema/bg_frm_campos.png">&nbsp;</td>
                                            </tr>
                                            <tr align="center" valign="top" bgcolor="#ECF2F9">                                              
                                              <td width="94%" background="../images/tema/bg_frm_campos.png"><div align="left">
                                                <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                                                  <tr bgcolor="#CFDFEF">
                                                    <td colspan="4"><div align="center">
                                                      <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" class="titulo_formulario"><div align="left"><strong>Ingrese la informaci&oacute;n del cargo 
                                                                <input name="idg" type="hidden" id="idg2" value="<?=enc($txtgrado);?>">
                                                          </strong></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)){
                                     ?>
                                                        <option value="<?=$icr[id];?>">
                                                        <?=$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">                                                    </td>
                                                    <td background="../images/tema/bg_frm_campos.png"><input name="txtvcargo" type="text" class="font_red_11" id="txtvcargo" size="6" maxlength="10"></td>
                                                    <td background="../images/tema/bg_frm_campos.png"><input name="txtdpago" type="text" class="font_red_11" id="txtdpago" value="08" size="2" maxlength="2">
                                                        <span class="font_red_11"><br>
                                                        </span><span class="lbl_campo">A&ntilde;o <br>
                                                        <input name="txtyearcargo" type="text" class="textbox" id="txtyearcargo" value="<?=get_ciclo_activo();?>" size="4" maxlength="4">
                                                    </span></td>
                                                  </tr>
                                                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                                                    <td height="30" colspan="3" background="../images/tema/bg_frm_campos.png" class="lbl_campo">El cargo se debe efectuar para [
                                                      <input name="txtmasculino" type="checkbox" id="txtmasculino" value="S">
                                                      Hombres ] [
                                                      <input name="txtfemenino" type="checkbox" id="txtfemenino" value="S">
                                                    Mujeres ]</td>
                                                  </tr>
                                                  <tr align="center" valign="top" bgcolor="#ECF2F9">
                                                    <td height="25" colspan="3" background="../images/tema/bg_frm_campos.png"><span class="lbl_formulario">Seleccione los meses en los que se debe aplicar el cargo</span><br>
                                                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                                          <tr class="parrafo">
                                                            <td width="16%"><div align="center"><strong>ENE</strong></div></td>
                                                            <td width="16%"><div align="center"><strong>FEB</strong></div></td>
                                                            <td width="16%"><div align="center"><strong>MAR</strong></div></td>
                                                            <td width="16%"><div align="center"><strong>ABR</strong></div></td>
                                                            <td width="16%"><div align="center"><strong>MAY</strong></div></td>
                                                            <td width="16%"><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>
                                                  <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="Operar cargo">
                                                    </div></td>
                                                  </tr>
                                                </table>
                                                <br>
                                              </div></td>
                                            </tr>
                                        </table>
                                      </form>                                      </td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <td><table width="100%" border="0" cellpadding="1" cellspacing="1" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF">
                                        <tr>
                                          <td colspan="2" bgcolor="#CFDFEF"><div align="center">
                                            <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_editar.png" width="35" height="32"></td>
                                                <td width="94%" background="../images/tema/bg_titulo_frm.png" class="titulo_formulario"><div align="left"><strong>EL CARGO SERA APLICADO A LOS  SIGUIENTES ALUMNOS </strong></div></td>
                                              </tr>
                                            </table>
                                          </div></td>
                                        </tr>
                                        <tr>
                                          <td width="21%" bgcolor="#CFDFEF" class="parrafo"><div align="left"><strong># CARNET </strong></div></td>
                                          <td width="79%" bgcolor="#CFDFEF" class="parrafo"><div align="left"><strong>NOMBRE DEL ALUMNO </strong></div></td>
                                        </tr>
                                        <?
                                        $qalumnos=mysql_query("select * from alumnos where grado_estudio = '$txtgrado' and year_estudio>0 order by apellido, nombre");
                                        $i=0;
                                        while($ialumno=mysql_fetch_array($qalumnos)){
                                        $i++;
                                        ?>
                                        <tr bgcolor="<?=color_fila($i);?>">
                                          <td><div align="left">
                                            <?=$ialumno[carnet];?>
                                          </div></td>
                                          <td><div align="left">
                                            <?=$ialumno[apellido].", ".$ialumno[nombre];?>
                                          </div></td>
                                        </tr>
                                        <?
                                        }
                                        ?>
                                        <tr bgcolor="<?=color_fila($i);?>">
                                          <td background="../images/tema/bg_frm_campos.png"><div align="left"><strong>TOTAL</strong></div></td>
                                          <td background="../images/tema/bg_frm_campos.png"><div align="left"><strong>
                                            <?=$i;?> 
                                            Alumno(s)
                                          </strong></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>
