<?
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
?>
<?
include("../conex.php");
$post_codigo=$_POST["txtcodigo"];
$post_rut=$_POST["txtrut"];
$post_razon_social=$_POST["txtrsoc"];
$post_rubro_giro=$_POST["txtrg"];
$post_region=$_POST["lstreg"];
$post_comuna=$_POST["lstcom"];
$post_ciudad=$_POST["txtciudad"];
$post_direccion=$_POST["txtdireccion"];
$post_fono1=$_POST["txtfono1"];
$post_fax=$_POST["txtfax"];
$post_email=$_POST["txtmail"];
$post_idzona=$_POST["lstzona"];
$post_idvendedor=$_POST["lstvendedor"];

$esql = "UPDATE sucursales SET razon_social = '$post_razon_social', rubro_giro = '$post_rubro_giro', direccion = '$post_direccion', ciudad = '$post_ciudad', comuna = $post_comuna, region = $post_region, fono = '$post_fono1', fax = '$post_fax', email = '$post_email', id_zona=$post_idzona, id_vendedor=$post_idvendedor WHERE id = $post_codigo";
//echo $esql;
	$consulta = mysql_query($esql,$enlace);
?>
<script language="javascript" type="text/javascript">
alert ("<?=$post_razon_social.'\nActualizado Con Exito!';?>");
parent.location.href = 'index.php';
</script>