git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@81 e2b1556b-49f8-d141-9351-52d6861a72d9
99 lines
3.5 KiB
PHP
99 lines
3.5 KiB
PHP
<?php
|
|
//FICHERO DE IDIOMAS
|
|
define("LOCALE", "idiomas/");
|
|
define("LOCALESET", "sp/");
|
|
include LOCALE.LOCALESET."lenguaje.php";
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title><?php echo $locale['Capacidades004'];?></title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
<link rel="shortcut icon" href="css/favicon.ico">
|
|
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/tablas.css" />
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
/**
|
|
* Página que ofrece un formulario para agregar capacidades profesionales
|
|
*
|
|
* Hay que tener cuidado porque todas las variables que se le pasan por post son agregadas.
|
|
*/
|
|
include("seguridad.php");
|
|
include("functions.php");
|
|
include_once("Objects/HTML.php");
|
|
$html=new HTML($locale);
|
|
|
|
$errores=array();
|
|
$id_candidato = $_GET['id_candidato'];
|
|
|
|
//En el caso de añadir
|
|
if(stripinput($_POST['action'])=="add"){
|
|
$id_candidato = $_POST["id_candidato"];
|
|
$perfil = $_POST["id_perfil_tecnico"];
|
|
$tecnologia = $_POST["tecnologia"];
|
|
|
|
if(count($errores)==0){
|
|
$arrayInsert=array();
|
|
$camposQuitar=array();
|
|
$camposQuitar["action"]=stripinput($_POST['action']);
|
|
$camposQuitar["id_candidato"]=stripinput($_POST['id_candidato']);
|
|
$camposQuitar["id_perfil_tecnico"]=stripinput($_POST['id_perfil_tecnico']);
|
|
include_once("Objects/Capacidad_profesional.php");
|
|
$Lista_capacidades = new Lista_capacidades_profesionales($id_candidato,"candidato");
|
|
$camposInsertar=array_diff_assoc($_POST,$camposQuitar);
|
|
$camposInsertar["id_usuario"]=$_POST['id_candidato'];
|
|
$camposInsertar["id_perfil_tecnico"]=$_POST['id_perfil_tecnico'][0]; //Sabemos que siempre va a tener un unico elemento el array ya que no le dejamos seleccionar mas de uno
|
|
foreach($camposInsertar as $nombre_campo => $valor){
|
|
if($valor!="")
|
|
$arrayInsert[$nombre_campo]=$valor;
|
|
}
|
|
|
|
// Insertamos la nueva capacidad
|
|
try{
|
|
$errorInsert=false;
|
|
$idCandidatoNew=$Lista_capacidades->addCapacidad($arrayInsert);
|
|
} catch (Exception $e){
|
|
$tipomsg="error";
|
|
$mensaje=$e->getMessage();
|
|
}
|
|
}
|
|
}
|
|
|
|
echo "<form action=\"addCapacidadProfesional.php\" method=\"POST\" enctype=\"multipart/form-data\">";
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"add\" />";
|
|
echo "<input type=\"hidden\" name=\"id_candidato\" value=\"".$id_candidato."\" />";
|
|
|
|
echo '<div class="encabezado">'.$locale['Capacidades005'].'</div>';
|
|
echo '<table align="center" width="100%">';
|
|
|
|
|
|
echo '<tr align="center">';
|
|
echo '<td ';
|
|
if(in_array("23",$errores)) echo " class=\"errorcampo\"";
|
|
echo ' textalign="right" '.$eper.'><div style="float:left ">'.$locale['121'].' </div><div style="float:left ">';
|
|
$auxiliar = '<option selected value="">'.$locale['ns'].'</option>';
|
|
echo $html->listaSelect("perfil","oid","id","id_perfil_tecnico",array("",$locale['ns']),$_POST['id_perfil_tecnico'],true,false,"1");
|
|
echo '</div></td></tr>';
|
|
|
|
/*
|
|
echo '<tr align="center">';
|
|
echo '<td textalign="right" '.$eper.'><div style="float:left ">'.$locale['122'].' </div><div style="float:left ">';
|
|
$auxiliar = '<option selected value="">'.$locale['ns'].'</option>';
|
|
echo $html->listaSelect("tecnologia","oid","id","tecnologia",array("",$locale['ns']),$_POST['tecnologia'],true,true,"15");
|
|
echo '</div></td></tr>';
|
|
*/
|
|
|
|
echo '</table>';
|
|
|
|
echo '<input type="submit" value="'.$locale['gu'].'" class="button">';
|
|
echo "</form>";
|
|
|
|
|
|
?>
|
|
|
|
</body>
|