close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
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
| Line | |
|---|
| 1 | <? |
|---|
| 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) ************************************************************************************************************************************************* |
|---|
| 15 | function 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.