git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@1 e2b1556b-49f8-d141-9351-52d6861a72d9
26 lines
586 B
PHP
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();
|
|
|
|
?>
|