<?
ini_set('error_reporting',1);
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
$id_empresa = $_SESSION['ss_empresa'];
$id_user = $_SESSION['ss_user'];
$id_autoriza=57;
?>
<?
/*Sesiones*/
include("../../../conex.php");
//include("../../conexion/class-sb-conexion.php");
include("../../../autoriza.php");
if ($editar==0)  
{
?>
		<script>
		alert ("No Autorizado");
		parent.location.href = 'index.php';
		</script>
	<? 
	exit();
}
$get_cod_nombres = $_GET["cp"];
$sql_bpro = "SELECT * FROM plan_cuenta WHERE id = $get_cod_nombres";
$res_bpro = mysql_query($sql_bpro,$enlace);
if (mysql_fetch_object ($res_bpro))
	{
	$sql_id = mysql_result($res_bpro, 0, "id");
	$sql_nombre = mysql_result($res_bpro, 0, "descripcion");
	$sql_rut = mysql_result($res_bpro, 0, "cuenta_contable");
	$sql_ubicacion = mysql_result($res_bpro, 0, "cuenta_contable2");
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Mantenimiento Plan cuenta</title>

<style type="text/css">

.Estilo11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; }
body {
	background-color: #FFFFFF;
	margin-left: 0px;
	margin-top: 3px;
	margin-right: 0px;
	margin-bottom: 0px;
}
select {
	clear: right;
	float: left;
	height: auto;
	width: 267px;
}

</style>

</head>

<body>
<script type="text/javascript" src="../../../css/validarut.js"></script>
<form action="guarda.php" method="post" enctype="multipart/form-data" name="form1" target="_self">
  <div align="center">Editar Plan de Cuenta </div>
  <table border="1" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td>Nombre </td>
    <td><input name="nombre" type="text" class="textboxnormal" id="nombre" size="32" maxlength="30" value="<?=$sql_nombre?>"></td>
  </tr>
  <tr>
    <td>Contable</td>
    <td><input name="rut" type="text" class="textboxnormal" id="rut" size="14" maxlength="12" value="<?=$sql_rut?>" onBlur="comprueba()"></td>
  </tr>
  <tr>
    <td>Num.Cta </td>
    <td><input name="ubicacion" type="text" class="textboxnormal" id="ubicacion" size="22" maxlength="20" value="<?=$sql_ubicacion?>"></td>
  </tr>
 
</table>
  <div align="center">
    <input name="Submit" type="button" class="botones" value="GRABAR" onClick="enviar(form1)">
  </div>
  <input name="id" type="text" class="textboxnormal" id="id" size="6" maxlength="6" value="<?=$sql_id?>" style="visibility:hidden">
</form>
</body>
</html>


<script language="javascript">
var nav4 = window.Event ? true : false;
function valida(evt){
var key = nav4 ? evt.which : evt.keyCode;
	if (key==13) document.form1.txtrsoc.focus()
	return (key <= 13 || (key >= 48 && key <= 57) || (key == 107) || (key == 75) || (key == 45) || (key == 46));
	}
function enviar(form)
{
	if (form.nombre.value==0)
		{
		alert ("Ingrese el nombre del vendedor")
		form.nombre.focus();
		return false;
		}

form.submit();	
}	  
function comprueba()
	{
	if (Rut(document.form1.rut.value)) document.form1.rut.focus();
	}
</script>