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