Tareas #680. No funciona eliminar una oferta
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@82 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
98b05d542f
commit
3b468043b7
@ -30,6 +30,18 @@ class Oferta {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function eliminar() {
|
||||||
|
// eliminamos en la BD
|
||||||
|
$consulta = "DELETE FROM candidato_pedido WHERE oid = ".$this->campos['oid'];
|
||||||
|
|
||||||
|
$bd = new BD();
|
||||||
|
if (!$bd->execQuery($consulta)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function actualizarHistorial($mensaje) {
|
function actualizarHistorial($mensaje) {
|
||||||
$oid = $this->getValor("oid");
|
$oid = $this->getValor("oid");
|
||||||
$usuario = $this->usuario->getValor("nombre");
|
$usuario = $this->usuario->getValor("nombre");
|
||||||
|
|||||||
@ -2,24 +2,18 @@
|
|||||||
|
|
||||||
include("seguridad.php");
|
include("seguridad.php");
|
||||||
include("functions.php");
|
include("functions.php");
|
||||||
//include_once("Objects/Pedido.php");
|
include_once("Objects/Oferta.php");
|
||||||
$idPedido=$_GET['idOferta'];
|
$idOferta=$_GET['idOferta'];
|
||||||
$usuario = $_SESSION["usuario"];
|
$usuario = $_SESSION["usuario"];
|
||||||
$pedido = new Pedido($idPedido,$usuario);
|
$oferta = new Oferta($idOferta,$usuario);
|
||||||
|
|
||||||
// Sólo el gerente del pedido y el admin pueden eliminar
|
/* ELIMINAR_OFERTA.PHP */
|
||||||
if(($pedido->getValor("gerente")!=$usuario->getValor("oid"))
|
|
||||||
&& !$usuario->tieneRol("1")){
|
|
||||||
header("Location: aplicacion.php?e=permiso");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
/* ELIMINAR_PROYECTO.PHP */
|
|
||||||
try{
|
try{
|
||||||
$resultado=$pedido->eliminar();
|
$resultado=$oferta->eliminar();
|
||||||
if($resultado){
|
if($resultado){
|
||||||
header("Location: lista_pedidos.php?msg=1");
|
header("Location: lista_ofertas.php?msg=1");
|
||||||
} else {
|
} else {
|
||||||
header("Location: lista_pedidos.php?msg=2");
|
header("Location: lista_ofertas.php?msg=2");
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$msg=$e->getMessage();
|
$msg=$e->getMessage();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user