Incam_Intranet/eliminar_empresa.php

26 lines
586 B
PHP
Raw Permalink Normal View History

<?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();
?>