Last change
on this file since 5d05b06 was
b6ec162,
checked in by Ramón M. Gómez <ramongomez@…>, 6 years ago
|
#834: Remove all redundant PHP closing tags.
|
-
Property mode set to
100644
|
File size:
1.8 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: imagenes_eliminacion.php |
---|
8 | // Descripción : |
---|
9 | // Elimina en cascada registros de la tabla imagenes |
---|
10 | // Parametros: |
---|
11 | // - cmd:Una comando ya operativo (con conexión abierta) |
---|
12 | // - identificador: El identificador por el que se eliminará la imagen |
---|
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 EliminaImagenes($cmd,$identificador,$nombreid,$swid=1){ |
---|
16 | global $EJECUCION_TAREA; |
---|
17 | if (empty($identificador)) return(true); |
---|
18 | if($swid==0) |
---|
19 | $cmd->texto="SELECT idimagen FROM imagenes WHERE ".$nombreid."='".$identificador."'"; |
---|
20 | else |
---|
21 | $cmd->texto='SELECT idimagen FROM imagenes 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="UPDATE ordenadores_particiones SET idimagen=0 WHERE idimagen=".$rs->campos["idimagen"]; |
---|
29 | $resul=$cmd->Ejecutar(); |
---|
30 | if (!$resul){ |
---|
31 | $rs->Cerrar(); |
---|
32 | return(false); |
---|
33 | } |
---|
34 | $rs->Siguiente(); |
---|
35 | } |
---|
36 | if($swid==0) |
---|
37 | $cmd->texto="DELETE FROM imagenes WHERE ".$nombreid."='".$identificador."'"; |
---|
38 | else |
---|
39 | $cmd->texto='DELETE FROM imagenes WHERE '.$nombreid.'='.$identificador; |
---|
40 | $resul=$cmd->Ejecutar(); |
---|
41 | return($resul); |
---|
42 | } |
---|
43 | |
---|
Note: See
TracBrowser
for help on using the repository browser.