Incam_Intranet/eliminar_empresa.php
2011-04-04 15:16:10 +00:00

26 lines
586 B
PHP

<?php
include("seguridad.php");
include("functions.php");
// Sólo RRHH y Admin pueden eliminar
if(!$usuario->tieneRol("3")){
header("Location: aplicacion.php?e=permiso");
exit;
}
$idEmpresa=$_GET['oid'];
include_once("Objects/Empresa.php");
try{
$empresa=new Empresa($usuario,$idEmpresa);
$resultado=$empresa->eliminar();
if($resultado){
header("Location: lista_empresas.php?msg=1");
} else {
header("Location: lista_empresas.php?msg=2");
}
} catch (Exception $e) {
$msg=$e->getMessage();
include_once("showError.php");
}
exit();
?>