| 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 2003-2004 |
|---|
| 6 | // Fecha Última modificación: Marzo-2005 |
|---|
| 7 | // Nombre del fichero: gestor_imagenincremental.php |
|---|
| 8 | // Descripción : |
|---|
| 9 | // Gestiona el mantenimiento de la tabla de imagenes_softincremental |
|---|
| 10 | // ************************************************************************************************************************************************* |
|---|
| 11 | include_once("../includes/ctrlacc.php"); |
|---|
| 12 | include_once("../clases/AdoPhp.php"); |
|---|
| 13 | include_once("../includes/CreaComando.php"); |
|---|
| 14 | include_once("../includes/opciones.php"); |
|---|
| 15 | //________________________________________________________________________________________________________ |
|---|
| 16 | $opcion=0; // Inicializa parametros |
|---|
| 17 | $idimagen=0; |
|---|
| 18 | $idsoftincremental=0; |
|---|
| 19 | |
|---|
| 20 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
|---|
| 21 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; |
|---|
| 22 | if (isset($_GET["idsoftincremental"])) $idsoftincremental=$_GET["idsoftincremental"]; |
|---|
| 23 | |
|---|
| 24 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
|---|
| 25 | $resul=false; |
|---|
| 26 | if ($cmd){ |
|---|
| 27 | $resul=Gestiona(); |
|---|
| 28 | $cmd->Conexion->Cerrar(); |
|---|
| 29 | } |
|---|
| 30 | ?> |
|---|
| 31 | <HTML> |
|---|
| 32 | <HEAD> |
|---|
| 33 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
|---|
| 34 | <BODY> |
|---|
| 35 | <? |
|---|
| 36 | $literal=""; |
|---|
| 37 | switch($opcion){ |
|---|
| 38 | case $op_alta : |
|---|
| 39 | $literal="resultado_insertar_imagenincremental"; |
|---|
| 40 | break; |
|---|
| 41 | case $op_eliminacion : |
|---|
| 42 | $literal="resultado_eliminar_imagenincremental"; |
|---|
| 43 | break; |
|---|
| 44 | default: |
|---|
| 45 | break; |
|---|
| 46 | } |
|---|
| 47 | if ($resul){ |
|---|
| 48 | echo '<SCRIPT language="javascript">'.chr(13); |
|---|
| 49 | if ($opcion==$op_alta ) |
|---|
| 50 | echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idsoftincremental.");".chr(13); |
|---|
| 51 | else |
|---|
| 52 | echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idsoftincremental.");".chr(13); |
|---|
| 53 | echo '</SCRIPT>'; |
|---|
| 54 | } |
|---|
| 55 | else{ |
|---|
| 56 | echo '<SCRIPT language="javascript">'; |
|---|
| 57 | echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idsoftincremental.")"; |
|---|
| 58 | echo '</SCRIPT>'; |
|---|
| 59 | } |
|---|
| 60 | ?> |
|---|
| 61 | </BODY> |
|---|
| 62 | </HTML> |
|---|
| 63 | <? |
|---|
| 64 | // ************************************************************************************************************************************************* |
|---|
| 65 | function Gestiona(){ |
|---|
| 66 | global $cmd; |
|---|
| 67 | global $opcion; |
|---|
| 68 | global $idimagen; |
|---|
| 69 | global $idsoftincremental; |
|---|
| 70 | global $op_alta; |
|---|
| 71 | global $op_eliminacion; |
|---|
| 72 | |
|---|
| 73 | $cmd->CreaParametro("@idimagen",$idimagen,1); |
|---|
| 74 | $cmd->CreaParametro("@idsoftincremental",$idsoftincremental,1); |
|---|
| 75 | |
|---|
| 76 | switch($opcion){ |
|---|
| 77 | case $op_alta : |
|---|
| 78 | $cmd->texto="INSERT INTO imagenes_softincremental (idimagen,idsoftincremental) VALUES (@idimagen,@idsoftincremental)"; |
|---|
| 79 | $resul=$cmd->Ejecutar(); |
|---|
| 80 | break; |
|---|
| 81 | case $op_eliminacion : |
|---|
| 82 | $cmd->texto='DELETE FROM imagenes_softincremental WHERE idimagen='.$idimagen.' AND idsoftincremental='.$idsoftincremental; |
|---|
| 83 | $resul=$cmd->Ejecutar(); |
|---|
| 84 | break; |
|---|
| 85 | default: |
|---|
| 86 | break; |
|---|
| 87 | } |
|---|
| 88 | return($resul); |
|---|
| 89 | } |
|---|
| 90 | ?> |
|---|