Incam_Intranet/detalle_candidato.php

106 lines
2.7 KiB
PHP
Raw Permalink Normal View History

<?php
include("seguridad.php");
include("functions.php");
/*
* S<EFBFBD>lo RRHH y Admin
*/
if(!$usuario->tieneRol("4")
&& !$usuario->tieneRol("1")){
header("Location: aplicacion.php?e=permiso");
exit;
}
include_once("Objects/Candidato.php");
try {
$oid = "";
if (isset($_GET['oid'])) {
$oid = stripinput($_GET['oid']);
}
$persona = new Candidato($usuario, $oid);
$mensaje = "";
// Comprobamos mensajes que pueden llegar hasta aqui
switch ($_GET['msg']) {
case "1":$mensaje="<div class=\"aviso ok\">".$locale['1085']."</div>";
break;
default:
break;
}
if($_GET['action']!=""){
$error=false;
switch ($_GET['action']) {
case "cambEst": if($_GET['idEst']!=""){
$camb=$persona->transita($_GET['idEst'], "");
if($camb){
$mensaje.="<div class=\"aviso ok\">".$locale['1087']."</div>";
}else{
$mensaje="<div class=\"aviso error\">".$locale['1088']."</div>";
}
$error=!$camb;
}
break;
case "cambEstObs": if($_POST['idEstado']!=""){
$dias=$_POST['fechObsCamb'];
$diasInt="";
if(is_numeric($dias))
$diasInt="#&dias;".$dias;
$camb=$persona->transita($_POST['idEstado'], $_POST['txtObsCamb'].$diasInt);
if($camb){
$mensaje.="<div class=\"aviso ok\">".$locale['1087'];
if(is_numeric($dias))
$mensaje.=" ".$locale['1092']." ".$dias." ".$locale['1093'];
$mensaje.="</div>";
}else{
$mensaje="<div class=\"aviso error\">".$locale['1088']."</div>";
}
$error=!$camb;
}
break;
default: $error=true;
$mensaje=$locale['1057'];
break;
}
/*
* Si hemos cambiado de estado candidato a empleado, nos vamos a detalle_empleado.php
*
*/
if($persona->getValor("tipo")=="usuario"){
header("Location: detalle_empleado.php?oid=".$persona->getValor("oid")."&msg=2");
exit;
}
}
include_once("html/cabecera.php");
include_once("Objects/HTML.php");
$html=new HTML($locale);
$html->menuCandidatos();
$back="detalle_candidato.php?oid=".stripinput($_GET['oid']);
//Mostramos los detalles de un candidato
$mostrarDetalle = array();
array_push($mostrarDetalle,"personales");
array_push($mostrarDetalle,"laborables");
array_push($mostrarDetalle,"curriculum");
array_push($mostrarDetalle,"candidaturas");
array_push($mostrarDetalle,"historial");
array_push($mostrarDetalle,"addCurriculum");
array_push($mostrarDetalle,"cambEstado");
include_once("detalles_usuario.php");
}catch(Exception $e){
$msg=$e->getMessage();
include_once("showError.php");
}
include_once("html/pie.php");
?>