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
@ -131,7 +131,7 @@ class ListaOfertas {
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
||||
function calculaReferencia($solicitud) {
|
||||
$bd = new BD();
|
||||
$consulta = "select referencia from candidato_pedido where pedido = '$solicitud' order by oid desc limit 1";
|
||||
|
||||
@ -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) {
|
||||
$oid = $this->getValor("oid");
|
||||
$usuario = $this->usuario->getValor("nombre");
|
||||
|
||||
@ -2,24 +2,18 @@
|
||||
|
||||
include("seguridad.php");
|
||||
include("functions.php");
|
||||
//include_once("Objects/Pedido.php");
|
||||
$idPedido=$_GET['idOferta'];
|
||||
include_once("Objects/Oferta.php");
|
||||
$idOferta=$_GET['idOferta'];
|
||||
$usuario = $_SESSION["usuario"];
|
||||
$pedido = new Pedido($idPedido,$usuario);
|
||||
$oferta = new Oferta($idOferta,$usuario);
|
||||
|
||||
// Sólo el gerente del pedido y el admin pueden eliminar
|
||||
if(($pedido->getValor("gerente")!=$usuario->getValor("oid"))
|
||||
&& !$usuario->tieneRol("1")){
|
||||
header("Location: aplicacion.php?e=permiso");
|
||||
exit;
|
||||
}
|
||||
/* ELIMINAR_PROYECTO.PHP */
|
||||
/* ELIMINAR_OFERTA.PHP */
|
||||
try{
|
||||
$resultado=$pedido->eliminar();
|
||||
$resultado=$oferta->eliminar();
|
||||
if($resultado){
|
||||
header("Location: lista_pedidos.php?msg=1");
|
||||
header("Location: lista_ofertas.php?msg=1");
|
||||
} else {
|
||||
header("Location: lista_pedidos.php?msg=2");
|
||||
header("Location: lista_ofertas.php?msg=2");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$msg=$e->getMessage();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user