source: admin/WebConsole/gestores/relaciones/trabajos_eliminacion.php @ fa0bb7d

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since fa0bb7d was 043e67d, checked in by pablombg <noreply@…>, 7 years ago

#814: Sustituir las etiquetas cortas de php por el formato largo

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5502 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 2.2 KB
Line 
1<?php
2// *************************************************************************************************************************************************
3// Aplicación WEB: ogAdmWebCon
4// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
5// Fecha Creación: Año 2009-2010
6// Fecha Última modificación: Agosto-2010
7// Nombre del fichero: trabajos_eliminacion.php
8// Descripción :
9//      Elimina en cascada registros de la tabla trabajos
10//              Parametros:
11//              -       cmd:Una comando ya operativo (con conexión abierta) 
12//              -       identificador: El identificador por el que se eliminará el trabajo
13//              -       nombreid: Nombre del campo identificador del registro
14//              -       swid: Indica 0= El identificador es tipo alfanumérico   1= EI identificador es tipo numérico ( valor por defecto) *************************************************************************************************************************************************
15function        EliminaTrabajos($cmd,$identificador,$nombreid,$swid=1){
16        global $EJECUCION_TRABAJO;
17        if (empty($identificador)) return(true);
18        if($swid==0)
19                $cmd->texto="SELECT  idtrabajo  FROM  trabajos WHERE ".$nombreid."='".$identificador."'";
20        else
21                $cmd->texto='SELECT  idtrabajo  FROM trabajos WHERE '.$nombreid.'='.$identificador;
22        $rs=new Recordset;
23        $rs->Comando=&$cmd;
24        if (!$rs->Abrir()) return(false); // Error al abrir recordset
25        if ($rs->numeroderegistros==0) return(true);
26        $rs->Primero();
27        while (!$rs->EOF){
28                $cmd->texto="DELETE FROM  acciones_menus WHERE tipoaccion=".$EJECUCION_TRABAJO." AND idtipoaccion=".$rs->campos["idtrabajo"];
29                $resul=$cmd->Ejecutar();
30                if ($resul){
31                        $cmd->texto="DELETE  FROM programaciones WHERE tipoaccion=".$EJECUCION_TRABAJO." AND identificador=".$rs->campos["idtrabajo"];
32                        $resul=$cmd->Ejecutar();
33                        if ($resul){
34                                $cmd->texto="DELETE  FROM trabajos_tareas WHERE idtrabajo=".$rs->campos["idtrabajo"];
35                                $resul=$cmd->Ejecutar();
36                        }
37                }
38                if (!$resul){
39                        $rs->Cerrar();
40                        return(false);
41                }
42                $rs->Siguiente();
43        }
44        if($swid==0)
45                $cmd->texto="DELETE FROM  trabajos WHERE ".$nombreid."='".$identificador."'";
46        else
47                $cmd->texto='DELETE FROM  trabajos  WHERE '.$nombreid.'='.$identificador;
48        $resul=$cmd->Ejecutar();
49        return($resul);
50}
51?>
Note: See TracBrowser for help on using the repository browser.