tieneRol("3")){ header("Location: aplicacion.php?e=permiso"); exit; } if($_POST['action']=="add"){ $id=$_POST['id']; $gerente=$_POST['gerente']; $privado=$_POST['privado']; $errores=array(); if($id=="") $errores[]="1"; if($gerente=="") $errores[]="2"; if($privado=="") $errores[]="3"; if(count($errores)==0){ try{ include_once("Objects/ListaEmpresas.php"); $listaEmpresas = new ListaEmpresas($usuario,$locale); $arrayInsert=array(); $arrayInsert["id"]=$id; $arrayInsert["gerente"]=$gerente; $arrayInsert["privado"]=$privado; $idEmpresaNew=$listaEmpresas->addEmpresa($arrayInsert); header("Location: gestion_empresa.php?oid=".$idEmpresaNew); } catch(Exception $e){ $msg=$e->getMessage(); $tipo="error"; } } } include_once("html/cabecera.php"); include_once("Objects/HTML.php"); $html = new HTML($locale); echo $html->menuEmpresas("",""); ?>

".$msg.""; } ?>