| 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: propiedades_imagenes.php | 
|---|
| 8 | // Descripción : | 
|---|
| 9 | //               Presenta el formulario de captura de datos de una imagen para insertar,modificar y eliminar | 
|---|
| 10 | // ************************************************************************************************************************************************* | 
|---|
| 11 | include_once("../includes/ctrlacc.php"); | 
|---|
| 12 | include_once("../includes/opciones.php"); | 
|---|
| 13 | include_once("../includes/CreaComando.php"); | 
|---|
| 14 | include_once("../clases/AdoPhp.php"); | 
|---|
| 15 | include_once("../includes/HTMLSELECT.php"); | 
|---|
| 16 | include_once("../idiomas/php/".$idioma."/propiedades_imagenes_".$idioma.".php"); | 
|---|
| 17 | //________________________________________________________________________________________________________ | 
|---|
| 18 | $opcion=0; | 
|---|
| 19 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); | 
|---|
| 20 | //________________________________________________________________________________________________________ | 
|---|
| 21 | $idimagen=0; | 
|---|
| 22 | $nombreca=""; | 
|---|
| 23 | $descripcion=""; | 
|---|
| 24 | $idperfilsoft=0; | 
|---|
| 25 | $comentarios=""; | 
|---|
| 26 | $grupoid=0; | 
|---|
| 27 |  | 
|---|
| 28 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"];  // Recoge parametros | 
|---|
| 29 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; | 
|---|
| 30 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; | 
|---|
| 31 | if (isset($_GET["identificador"])) $idimagen=$_GET["identificador"]; | 
|---|
| 32 | //________________________________________________________________________________________________________ | 
|---|
| 33 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando | 
|---|
| 34 | if (!$cmd) | 
|---|
| 35 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. | 
|---|
| 36 | if  ($opcion!=$op_alta){ | 
|---|
| 37 | $resul=TomaPropiedades($cmd,$idimagen); | 
|---|
| 38 | if (!$resul) | 
|---|
| 39 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. | 
|---|
| 40 | } | 
|---|
| 41 | //________________________________________________________________________________________________________ | 
|---|
| 42 | ?> | 
|---|
| 43 | <HTML> | 
|---|
| 44 | <TITLE>Administración web de aulas</TITLE> | 
|---|
| 45 | <HEAD> | 
|---|
| 46 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 
|---|
| 47 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> | 
|---|
| 48 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> | 
|---|
| 49 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> | 
|---|
| 50 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 51 | </HEAD> | 
|---|
| 52 | <BODY> | 
|---|
| 53 | <DIV  align=center> | 
|---|
| 54 | <FORM  name="fdatos" action="../gestores/gestor_imagenes.php" method="post"> | 
|---|
| 55 | <INPUT type=hidden name=opcion value=<?=$opcion?>> | 
|---|
| 56 | <INPUT type=hidden name=idimagen value=<?=$idimagen?>> | 
|---|
| 57 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> | 
|---|
| 58 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> | 
|---|
| 59 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> | 
|---|
| 60 | <TABLE  align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> | 
|---|
| 61 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 62 | <TR> | 
|---|
| 63 | <TH align=center> <?echo $TbMsg[11]?> </TD> | 
|---|
| 64 | <?if ($opcion==$op_eliminacion) | 
|---|
| 65 | echo '<TD style="width:150">'.$nombreca.'</TD>'; | 
|---|
| 66 | else | 
|---|
| 67 | echo '<TD><INPUT  class="formulariodatos" name=nombreca style="width:150" type=text value="'.$nombreca.'"></TD>';?> | 
|---|
| 68 | </TR> | 
|---|
| 69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 70 | <TR> | 
|---|
| 71 | <TH align=center> <?echo $TbMsg[5]?> </TD> | 
|---|
| 72 | <?if ($opcion==$op_eliminacion) | 
|---|
| 73 | echo '<TD style="width:300">'.$descripcion.'</TD>'; | 
|---|
| 74 | else | 
|---|
| 75 | echo '<TD><INPUT  class="formulariodatos" name=descripcion style="width:300" type=text value="'.$descripcion.'"></TD>';?> | 
|---|
| 76 | </TR> | 
|---|
| 77 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 78 | <TR> | 
|---|
| 79 | <TH align=center> <?echo $TbMsg[6]?> </TD> | 
|---|
| 80 | <? | 
|---|
| 81 | if ($opcion==$op_eliminacion) | 
|---|
| 82 | echo '<TD>'.$perfilsoft.'</TD>'; | 
|---|
| 83 | else | 
|---|
| 84 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'perfilessoft',$idperfilsoft,'idperfilsoft','descripcion',300).'</TD>'; | 
|---|
| 85 | ?> | 
|---|
| 86 | </TR> | 
|---|
| 87 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 88 | <TR> | 
|---|
| 89 | <TH align=center> <?echo $TbMsg[8]?> </TD> | 
|---|
| 90 | <? | 
|---|
| 91 | if ($opcion==$op_eliminacion) | 
|---|
| 92 | echo '<TD>'.$numpar.'</TD>'; | 
|---|
| 93 | else | 
|---|
| 94 | echo '<TD><INPUT  class="formulariodatos" name=numpar style="width:30" type=text value="'.$numpar.'"></TD>'; | 
|---|
| 95 | ?> | 
|---|
| 96 | </TR> | 
|---|
| 97 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 98 | <TR> | 
|---|
| 99 | <TH align=center> <?echo $TbMsg[9]?> </TD> | 
|---|
| 100 | <? | 
|---|
| 101 | if ($opcion==$op_eliminacion) | 
|---|
| 102 | echo '<TD>'.$tipopar.'</TD>'; | 
|---|
| 103 | else | 
|---|
| 104 | echo '<TD>'.HTMLSELECT($cmd,0,'tipospar',$codpar,'codpar','tipopar',100,"","","clonable=1").'</TD>'; | 
|---|
| 105 | ?> | 
|---|
| 106 | </TR> | 
|---|
| 107 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 108 | <TR> | 
|---|
| 109 | <TH align=center> <?echo $TbMsg[10]?> </TD> | 
|---|
| 110 | <? | 
|---|
| 111 | if ($opcion==$op_eliminacion) | 
|---|
| 112 | echo '<TD>'.$nombrerepositorio.'</TD>'; | 
|---|
| 113 | else | 
|---|
| 114 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',300).'</TD>'; | 
|---|
| 115 | ?> | 
|---|
| 116 | </TR> | 
|---|
| 117 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 118 | <TR> | 
|---|
| 119 | <TH align=center> <?echo $TbMsg[7]?> </TD> | 
|---|
| 120 | <?if ($opcion==$op_eliminacion) | 
|---|
| 121 | echo '<TD>'.$comentarios.'</TD>'; | 
|---|
| 122 | else | 
|---|
| 123 | echo '<TD><TEXTAREA   class="formulariodatos" name=comentarios rows=3 cols=55>'.$comentarios.'</TEXTAREA></TD>'; | 
|---|
| 124 | ?> | 
|---|
| 125 | </TR> | 
|---|
| 126 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 127 | </TABLE> | 
|---|
| 128 | </FORM> | 
|---|
| 129 | <? | 
|---|
| 130 | //________________________________________________________________________________________________________ | 
|---|
| 131 | include_once("../includes/opcionesbotonesop.php"); | 
|---|
| 132 | //________________________________________________________________________________________________________ | 
|---|
| 133 | ?> | 
|---|
| 134 | </BODY> | 
|---|
| 135 | </HTML> | 
|---|
| 136 | <? | 
|---|
| 137 | //________________________________________________________________________________________________________ | 
|---|
| 138 | //      Recupera los datos de una imagen | 
|---|
| 139 | //              Parametros: | 
|---|
| 140 | //              - cmd: Una comando ya operativo (con conexión abierta) | 
|---|
| 141 | //              - id: El identificador de la imagen | 
|---|
| 142 | //________________________________________________________________________________________________________ | 
|---|
| 143 | function TomaPropiedades($cmd,$idmagen){ | 
|---|
| 144 | global $nombreca; | 
|---|
| 145 | global $descripcion; | 
|---|
| 146 | global $comentarios; | 
|---|
| 147 | global $idperfilsoft; | 
|---|
| 148 | global $numpar; | 
|---|
| 149 | global $codpar; | 
|---|
| 150 | global $tipopar; | 
|---|
| 151 | global $nombrerepositorio; | 
|---|
| 152 | global $idrepositorio; | 
|---|
| 153 | global $perfilsoft; | 
|---|
| 154 |  | 
|---|
| 155 | $rs=new Recordset; | 
|---|
| 156 | $cmd->texto="SELECT imagenes.*,tipospar.tipopar,repositorios.nombrerepositorio,perfilessoft.descripcion as perfilsoft FROM imagenes | 
|---|
| 157 | LEFT OUTER JOIN tipospar ON tipospar.codpar=imagenes.codpar | 
|---|
| 158 | LEFT OUTER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio | 
|---|
| 159 | LEFT OUTER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft | 
|---|
| 160 | WHERE imagenes.idimagen=".$idmagen; | 
|---|
| 161 | $rs->Comando=&$cmd; | 
|---|
| 162 | if (!$rs->Abrir()) return(0); // Error al abrir recordset | 
|---|
| 163 | $rs->Primero(); | 
|---|
| 164 | if (!$rs->EOF){ | 
|---|
| 165 | $nombreca=$rs->campos["nombreca"]; | 
|---|
| 166 | $descripcion=$rs->campos["descripcion"]; | 
|---|
| 167 | $idperfilsoft=$rs->campos["idperfilsoft"]; | 
|---|
| 168 | $comentarios=$rs->campos["comentarios"]; | 
|---|
| 169 | $numpar=$rs->campos["numpar"]; | 
|---|
| 170 | $tipopar=$rs->campos["tipopar"]; | 
|---|
| 171 | $codpar=$rs->campos["codpar"]; | 
|---|
| 172 | $idrepositorio=$rs->campos["idrepositorio"]; | 
|---|
| 173 | $nombrerepositorio=$rs->campos["nombrerepositorio"]; | 
|---|
| 174 | $perfilsoft=$rs->campos["perfilsoft"]; | 
|---|
| 175 | $rs->Cerrar(); | 
|---|
| 176 | return(true); | 
|---|
| 177 | } | 
|---|
| 178 | else | 
|---|
| 179 | return(true); | 
|---|
| 180 | } | 
|---|
| 181 | ?> | 
|---|