<?
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_frm1(){
  if(document.form1.txtplan.value=="SV"){
   alert("Seleccione un plan de pago");
   document.form1.txtplan.focus();
   return (false);
  }
  return (true);
}

function validar(formulario){
 var f = document.form2;
 var respuesta;
 
 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);
 }
 
 //alert Math.abs(document.form2.txtvcargo.value);
 if(Math.abs(document.form2.txtvcargo.value)<=0){
   alert("El valor del cargo debe ser mayor que cero");
      document.form2.txtvcargo.focus();
      document.form2.txtvcargo.select();
  return (false);
 }
 
 if(!f.m1.checked && !f.m2.checked && !f.m3.checked && !f.m4.checked && !f.m5.checked && !f.m6.checked && !f.m7.checked && !f.m8.checked && !f.m9.checked && !f.m10.checked && !f.m11.checked && !f.m12.checked){
   alert("Seleccione al menos 1 para aplicar el cargo");
   return (false);
 }
 
 respuesta=confirm("Está seguro de aplicar este 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 </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" 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="<?=$PHP_SELF;?>" onsubmit="return validar_frm1();">
                                  <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
                                    <tr>
                                      <td width="30%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF"><strong>Seleccione un plan de pago </strong></td>
                                      <td width="58%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9">
                                        <select name="txtplan" class="textbox" id="select">
                                          <option value="SV" selected>Seleccione uno...</option>
                                          <?
                               $qalum=mysql_query("select * from cp_planesdepagos order by plan");
                               while($ialum=mysql_fetch_array($qalum)){
                               $sel="";
                               if($txtplan == $ialum[id]){
                                $sel="selected class='selected_option'";
                               }
                                echo "<option value='{$ialum[id]}' $sel>{$ialum[plan]}</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(!$txtplan){
                           exit();
                          }
                          if($txtplan=='SV'){
                            alert("Seleccione un plan de pago","javascript:history.go(-1)");
                          }

                          $qalm=mysql_query("select * from cp_planesdepagos where id = '$txtplan'");
                          if(mysql_num_rows($qalm)==0){
                            alert("ERROR:\\nEl plan de pago no existe","javascript:history.go(-1)");
                          }
                          $iplan=mysql_fetch_array($qalm);
                          ?>
                                </form>
                                  <br>
                                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><form name="form2" method="post" action="mnt_cargo_group.php?idg=A&op=Add&key=<?=enc("por_plan");?>&cargo=<?=enc("Otros");?>&idp=<?=enc($txtplan);?>" onSubmit="return validar(this.form2);">
                                          <br>
                                          <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                                            <tr bgcolor="#CFDFEF">
                                              <td width="100%" class="titulo_seccion">Aplicar cargo a todos los alumnos con plan de pago: <?=$iplan[plan];?>
                                              <input name="id_plan" type="hidden" id="id_plan" value="<?=$txtplan;?>">
                                              <input name="id_key" type="hidden" id="id_key" value="<?=enc("por_plan");?>"></td>
                                            </tr>
                                            <tr bgcolor="#CFDFEF">
                                              <td><table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="#CFDFEF">
                                                <tr bgcolor="#CFDFEF">
                                                  <td colspan="4"><div align="center"><strong>Otros cargos </strong></div></td>
                                                </tr>
                                                <tr align="center" valign="top" bgcolor="#ECF2F9">
                                                  <td width="1%" rowspan="4">&nbsp;</td>
                                                  <td width="68%" class="lbl_campo">Seleccione un cargo </td>
                                                  <td width="6%" class="lbl_campo">Valor</td>
                                                  <td width="25%" class="lbl_campo">D&iacute;a m&aacute;ximo de pago </td>
                                                </tr>
                                                <tr align="center" valign="top" bgcolor="#ECF2F9">
                                                  <td><select name="txtdesccargo" class="lbl_formulario" id="txtdesccargo" onchange="document.form2.txtdescadicional.focus();">
                                                      <option value="SV" selected>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><input name="txtvcargo" type="text" class="font_red_11" id="txtvcargo3" size="6" maxlength="10"></td>
                                                  <td><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 colspan="3"><span class="lbl_formulario">Seleccione los meses para 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><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>
                                                        </tr>
                                                        <tr bgcolor="#ECF2F9" class="parrafo">
                                                          <td><div align="center"><strong>JUL</strong></div></td>
                                                          <td><div align="center"><strong>AGO</strong></div></td>
                                                          <td><div align="center"><strong>SEP</strong></div></td>
                                                          <td><div align="center"><strong>OCT</strong></div></td>
                                                          <td><div align="center"><strong>NOV</strong></div></td>
                                                          <td><div align="center"><strong>DIC</strong></div></td>
                                                        </tr>
                                                        <tr bgcolor="#ECF2F9">
                                                          <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>
                                                <tr align="center" valign="top" bgcolor="#ECF2F9">
                                                  <td colspan="3"><div align="center">
                                                      <input name="Submit22" type="submit" class="boton_guardar" value="Operar cargo">
                                                  </div></td>
                                                </tr>
                                              </table></td>
                                            </tr>
                                          </table>
                                      </form></td>
                                    </tr>
                              </table></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                </div></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
