git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@1 e2b1556b-49f8-d141-9351-52d6861a72d9
32 lines
785 B
PHP
32 lines
785 B
PHP
<?php
|
|
include("seguridad.php");
|
|
include("functions.php");
|
|
// Sólo RRHH y Admin pueden eliminar
|
|
if(!$usuario->tieneRol("4")
|
|
&& !$usuario->tieneRol("1")){
|
|
header("Location: aplicacion.php?e=permiso");
|
|
exit;
|
|
}
|
|
$idCandidato=$_GET['oid'];
|
|
if($_GET['byEstado']!=""){
|
|
$tipoPedidos=stripinput($_GET['byEstado']);
|
|
} else {
|
|
$tipoPedidos="10";
|
|
}
|
|
include_once("Objects/Candidato.php");
|
|
try{
|
|
$candidato=new Candidato($usuario,$idCandidato);
|
|
$resultado=$candidato->eliminar();
|
|
if($resultado){
|
|
header("Location: lista_candidatos.php?msg=1&byEstado=".$tipoPedidos);
|
|
} else {
|
|
header("Location: lista_candidatos.php?msg=2&byEstado=".$tipoPedidos);
|
|
}
|
|
} catch (Exception $e){
|
|
$msg=$e->getMessage();
|
|
include_once("showError.php");
|
|
}
|
|
exit();
|
|
|
|
?>
|