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

$qal=mysql_query("select year_estudio, nombre, apellido,grado_estudio, seccion from alumnos where carnet = '$txtcarnet'");
$infoa=mysql_fetch_array($qal);

if ($infoa[year_estudio]<=0){
  alert("El alumno(a) {$infoa[apellido]} {$infoa[nombre]} no esta inscrito(a)","frm_desinscripcion");
}
$qvp=mysql_query("select sum(valor-saldo) as totalm from cp_cargos where carnet='$txtcarnet' and tipo='ME' and year='{$infoa[year_estudio]}'");
$infovp=mysql_fetch_array($qvp);

$qvp2=mysql_query("select sum(valor-saldo) as totaloc from cp_cargos where carnet='$txtcarnet' and tipo<>'ME' and year='{$infoa[year_estudio]}'");
$infovp2=mysql_fetch_array($qvp2);
?>
<!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(){
 var respuesta;
 var objeto;
 var formulario = document.form1;

 objeto=document.form1.txtcarnet;
 if(objeto.value == ""){
  alert("Por favor seleccione un alumno");
  return (false);
 }
 
 objeto=document.form1.txtmotivo;
 if(objeto.value == ""){
  alert("Por favor ingrese el motivo de la desinscripción");
  objeto.focus();
  return (false);
 }

 objeto = formulario.txtreintegro;
 if(objeto.checked == true){
   
   if(eval(formulario.txtvreintegro.value)==0){
     alert("Ingrese el valor del reintegro");
     formulario.txtvreintegro.focus();
     return (false);
   }
   
   if(formulario.txtvreintegro.value==""){
     alert("Por favor ingrese el valor que se le reintegró al alumno");
     formulario.txtvreintegro.focus();
     return (false);
   }
 }

 respuesta=confirm("Está totalmente seguro de DESINSCRIBIR\nal alumno "+document.form1.txtcarnet.value);
 if(respuesta == false){
   return (false);
 }

 return (true)
}
</script>
<?=mascara();?>
</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" background="../images/tema/bg_contenido.png" 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">
                                <p>ALUMNOS<img src="../images/flecha_3.jpg" width="9" height="9"> Desinscripci&oacute;n de alumnos </p>
                              </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"><form name="form1" method="post" action="mnt_desinscripcion.php" onsubmit="return validar();">
                          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td colspan="2" bgcolor="#CFDFEF" class="lbl_campo"><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_formularios.png" width="35" height="32"></td>
                                  <td width="94%" background="../images/tema/bg_titulo_frm.png" class="titulo_formulario"><div align="left">Desinscripci&oacute;n de alumnos </div></td>
                                </tr>
                              </table></td>
                              </tr>
                            <tr>
                              <td width="31%" background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo"><div align="left">Alumno:</div></td>
                              <td width="69%" background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="titulo_pagina"><div align="left"><?=$txtcarnet." ".nombre_usuario($txtcarnet,"Al");?></div></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">&nbsp;</td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9" class="lbl_campo"><?=ggrado_completo(enc($infoa[grado_estudio]),$infoa[seccion]);?></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo"><div align="left">Motivo de la desinscripci&oacute;n:</div></td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="left">
                                <textarea name="txtmotivo" cols="60" rows="5" class="textbox"></textarea>
                                <input name="tipo_trn" type="hidden" id="tipo_trn" value="desinscribir">
                                <input name="txtdesyear" type="hidden" id="txtdesyear" value="<?=$infoa[year_estudio];?>">
                                <input name="txtcarnet" type="hidden" id="txtcarnet" value="<?=$txtcarnet;?>">
</div></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo"><div align="left">Monto total pagado a la fecha: </div></td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="left">
                                <input name="txttotalp" type="text" class="textbox" dir="rtl" value="<?=$infovp[totalm];?>" size="15" maxlength="15">
                              </div></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo"><div align="left">Se le hizo alg&uacute;n reintegro: </div></td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="left">
                                <input name="txtreintegro" type="checkbox" id="txtreintegro" value="S">
                              </div></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo"><div align="left">Valor del reintegro: </div></td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><div align="left">
                                <input name="txtvreintegro" type="text" class="textbox" id="txtvreintegro" size="15" maxlength="15">
                              </div></td>
                            </tr>
                            <tr>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#CFDFEF" class="lbl_campo">&nbsp;</td>
                              <td background="../images/tema/bg_frm_campos.png" bgcolor="#ECF2F9"><input name="Submit" type="submit" class="boton_guardar" value="Desinscribir alumno"></td>
                              </tr>
                          </table>
                        </form></td>
                      </tr>
                    </table>
                </div></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
