<?

include("../fnc.php");

enlinea_a();



if($idn){

 $id_nv=dec($idn);

 $qver=mysql_query("select * from niveles where id = '$id_nv'");

 if(mysql_num_rows($qver)==0){

  alert("El nivel escolar 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 - Bienvenido</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>

<script type="text/javascript">

 function fc(){

   document.form1.txtnivel.focus();

 }

</script>

<style type="text/css">
<!--
body {
	background-image: url(../images/tema/bg_pagina.png);
}
-->
</style></head>



<body onload="fc();">

<table width="750" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">

  <tr>

    <td bgcolor="#FFFFCC">    <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.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">

        <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 height="20" class="titulo_pagina"><div align="center" class="titulo_pagina">

                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                  <tr>

                    <td width="65" background="../images/tema/bg_contenido.png">&nbsp;</td>

                    <td background="../images/tema/bg_contenido.png"><div align="center" class="titulo_pagina"><strong>ADMINISTRACION DE NIVELES ESCOLARES</strong></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></td>

            </tr>

            <tr>

              <td align="left" valign="top" background="../images/tema/bg_contenido.png" bgcolor="#FFFFCC"><div align="left" class="parrafo">

                <form name="form1" method="post" action="mnt_nivel.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="#6699CC">

                            <td colspan="2" class="titulo_seccion"><div align="left" class="titulo_formulario">
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="5%" background="../images/tema/bg_titulo_frm.png"><img src="../images/tema/ic_formularios.png" width="35" height="32"></td>
                                  <td width="95%" background="../images/tema/bg_titulo_frm.png">Informaci&oacute;n del nivel </td>
                                </tr>
                              </table>
                            </div></td>

                          </tr>

                          <tr>

                            <td width="25%" align="left" valign="middle" bgcolor="#CFDFEF" class="lbl_campo">Nombre del nivel escolar </td>

                            <td width="75%" bgcolor="#ECF2F9"><div align="left">

                              <input name="txtnivel" type="text" class="textbox" id="txtnivel" value="<?=$info[nivel];?>" size="60" maxlength="100">

                              <a href="#" onMouseOver="return overlib('Ingrese un nombre que identifique al nivel.<br><br><strong>Ejemplos:</strong><br>-Pre-Primaria<br>-Básicos<br>-Diversificado');" onmouseout="return nd();"><img src="../images/con_info.png" width="16" height="16" border="0"></a></div></td>

                          </tr>

                          <tr bgcolor="#CFDFEF">

                            <td colspan="2" align="left" valign="middle" class="lbl_campo"><table width="100%"  border="0" cellspacing="1" cellpadding="5">

                              <tr>

                                <td width="20%"><input name="tipo_trn" type="hidden" id="tipo_trn" value="<?=$tipo;?>">

                                  <input name="idn" type="hidden" id="idn" value="<?=$idn;?>"></td>

                                <td width="25%"><div align="center">

                                    <input name="Submit" type="submit" class="boton_guardar" value="<?if($tipo=="Add"){?>Agregar Nivel<?}else{?>Guardar los cambios<?}?>">

                                </div></td>

                                <td width="25%"><div align="center">

                                    <input name="Submit2" type="reset" class="boton_deshacer" value="Deshacer los cambios">

                                </div></td>

                                <td width="20%">&nbsp;</td>

                              </tr>

                            </table></td>

                            </tr>

                      </table></td>

                    </tr>

                  </table>

                  <br>

                </form>

                <p><a href="inicio.php"><img src="../images/regresar_c.png" width="32" height="32" border="0"></a><br>

                    <strong>Salir</strong> </p>

                <table width="85%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">

                  <tr>

                    <td bgcolor="#FFFFCC"><table width="100%"  border="0" cellpadding="0" cellspacing="0">

                      <tr align="center" valign="middle" bgcolor="#6699CC">

                        <td background="../images/tema/bg_titulo_frm.png"><div align="center" class="titulo_formulario">

                          <div align="left">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="14%"><img src="../images/tema/ic_editar.png" width="35" height="32"></td>
                                <td width="86%">Niveles existentes </td>
                              </tr>
                            </table>
                          </div>

                        </div></td>

                        <td colspan="2" background="../images/tema/bg_titulo_frm.png" bgcolor="#6699CC">

                                <div align="right">
                                  <input name="Submit3" type="submit" class="boton_guardar" value="Agregar uno nuevo" onClick="self.location='frm_nivel.php'"> 
                                    
                              </div></td></tr>

                      <?

                      $qnivel=mysql_query("select * from niveles order by id");

                      while($inivel=mysql_fetch_array($qnivel)){

                      ?>

                      <?

                      }

                      ?>

                    </table></td>

                  </tr>

                  <tr>

                    <td bgcolor="#FFFFCC"><table width="100%"  border="0" cellpadding="2" cellspacing="1" bgcolor="#ECF2F9">

                      <?

                      $qnivel=mysql_query("select * from niveles order by id");

                      while($inivel=mysql_fetch_array($qnivel)){

                      ?>

                      <tr>

                        <td width="73%" bgcolor="#FFFFFF"><img src="../images/cuad_1.png" width="9" height="9"><?=$inivel[nivel];?></td>

                        <td width="16%" bgcolor="#FFFFFF"><div align="center"><a href="frm_nivel.php?idn=<?=enc($inivel[id]);?>" class="link_dt_add">Modificar</a> </div></td>

                        <td width="11%" bgcolor="#FFFFFF"><div align="center"><a href="mnt_nivel.php?tipo_trn=Delete&idn=<?=enc($inivel[id]);?>" class="link_dt_delete">Eliminar</a></div></td>

                      </tr>

                      <?

                      }

                      ?>

                    </table></td>

                  </tr>

                </table>

                <p>&nbsp;</p>

              </div></td>

              </tr>

          </table></td>

        </tr>

    </table>    </td>

  </tr>

</table>

</body>

</html>