| 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/validators.js"></SCRIPT> |
|---|
| 49 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> |
|---|
| 50 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
|---|
| 51 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> |
|---|
| 52 | </HEAD> |
|---|
| 53 | <BODY> |
|---|
| 54 | <DIV align=center> |
|---|
| 55 | <FORM name="fdatos" action="../gestores/gestor_imagenes.php" method="post"> |
|---|
| 56 | <INPUT type=hidden name=opcion value=<?=$opcion?>> |
|---|
| 57 | <INPUT type=hidden name=idimagen value=<?=$idimagen?>> |
|---|
| 58 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> |
|---|
| 59 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> |
|---|
| 60 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> |
|---|
| 61 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
|---|
| 62 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 63 | <TR> |
|---|
| 64 | <TH align=center> <?echo $TbMsg[11]?> </TD> |
|---|
| 65 | <?if ($opcion==$op_eliminacion) |
|---|
| 66 | echo '<TD style="width:150">'.$nombreca.'</TD>'; |
|---|
| 67 | else |
|---|
| 68 | echo '<TD><INPUT class="formulariodatos" name=nombreca style="width:150" type=text value="'.$nombreca.'"></TD>';?> |
|---|
| 69 | </TR> |
|---|
| 70 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 71 | <TR> |
|---|
| 72 | <TH align=center> <?echo $TbMsg[5]?> </TD> |
|---|
| 73 | <?if ($opcion==$op_eliminacion) |
|---|
| 74 | echo '<TD style="width:300">'.$descripcion.'</TD>'; |
|---|
| 75 | else |
|---|
| 76 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:300" type=text value="'.$descripcion.'"></TD>';?> |
|---|
| 77 | </TR> |
|---|
| 78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 79 | <TR> |
|---|
| 80 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
|---|
| 81 | <? |
|---|
| 82 | if ($opcion==$op_eliminacion) |
|---|
| 83 | echo '<TD>'.$perfilsoft.'</TD>'; |
|---|
| 84 | else |
|---|
| 85 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'perfilessoft',$idperfilsoft,'idperfilsoft','descripcion',300).'</TD>'; |
|---|
| 86 | ?> |
|---|
| 87 | </TR> |
|---|
| 88 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 89 | <TR> |
|---|
| 90 | <TH align=center> <?echo $TbMsg[8]?> </TD> |
|---|
| 91 | <? |
|---|
| 92 | if ($opcion==$op_eliminacion) |
|---|
| 93 | echo '<TD>'.$numpar.'</TD>'; |
|---|
| 94 | else |
|---|
| 95 | echo '<TD><INPUT class="formulariodatos" name=numpar style="width:30" type=text value="'.$numpar.'"></TD>'; |
|---|
| 96 | ?> |
|---|
| 97 | </TR> |
|---|
| 98 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 99 | <TR> |
|---|
| 100 | <TH align=center> <?echo $TbMsg[9]?> </TD> |
|---|
| 101 | <? |
|---|
| 102 | if ($opcion==$op_eliminacion) |
|---|
| 103 | echo '<TD>'.$tipopar.'</TD>'; |
|---|
| 104 | else |
|---|
| 105 | echo '<TD>'.HTMLSELECT($cmd,0,'tipospar',$codpar,'codpar','tipopar',100,"","","clonable=1").'</TD>'; |
|---|
| 106 | ?> |
|---|
| 107 | </TR> |
|---|
| 108 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 109 | <TR> |
|---|
| 110 | <TH align=center> <?echo $TbMsg[10]?> </TD> |
|---|
| 111 | <? |
|---|
| 112 | if ($opcion==$op_eliminacion) |
|---|
| 113 | echo '<TD>'.$nombrerepositorio.'</TD>'; |
|---|
| 114 | else |
|---|
| 115 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',300).'</TD>'; |
|---|
| 116 | ?> |
|---|
| 117 | </TR> |
|---|
| 118 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 119 | <TR> |
|---|
| 120 | <TH align=center> <?echo $TbMsg[7]?> </TD> |
|---|
| 121 | <?if ($opcion==$op_eliminacion) |
|---|
| 122 | echo '<TD>'.$comentarios.'</TD>'; |
|---|
| 123 | else |
|---|
| 124 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=55>'.$comentarios.'</TEXTAREA></TD>'; |
|---|
| 125 | ?> |
|---|
| 126 | </TR> |
|---|
| 127 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 128 | </TABLE> |
|---|
| 129 | </FORM> |
|---|
| 130 | <? |
|---|
| 131 | //________________________________________________________________________________________________________ |
|---|
| 132 | include_once("../includes/opcionesbotonesop.php"); |
|---|
| 133 | //________________________________________________________________________________________________________ |
|---|
| 134 | ?> |
|---|
| 135 | </BODY> |
|---|
| 136 | </HTML> |
|---|
| 137 | <? |
|---|
| 138 | //________________________________________________________________________________________________________ |
|---|
| 139 | // Recupera los datos de una imagen |
|---|
| 140 | // Parametros: |
|---|
| 141 | // - cmd: Una comando ya operativo (con conexión abierta) |
|---|
| 142 | // - id: El identificador de la imagen |
|---|
| 143 | //________________________________________________________________________________________________________ |
|---|
| 144 | function TomaPropiedades($cmd,$idmagen){ |
|---|
| 145 | global $nombreca; |
|---|
| 146 | global $descripcion; |
|---|
| 147 | global $comentarios; |
|---|
| 148 | global $idperfilsoft; |
|---|
| 149 | global $numpar; |
|---|
| 150 | global $codpar; |
|---|
| 151 | global $tipopar; |
|---|
| 152 | global $nombrerepositorio; |
|---|
| 153 | global $idrepositorio; |
|---|
| 154 | global $perfilsoft; |
|---|
| 155 | |
|---|
| 156 | $rs=new Recordset; |
|---|
| 157 | $cmd->texto="SELECT imagenes.*,tipospar.tipopar,repositorios.nombrerepositorio,perfilessoft.descripcion as perfilsoft FROM imagenes |
|---|
| 158 | LEFT OUTER JOIN tipospar ON tipospar.codpar=imagenes.codpar |
|---|
| 159 | LEFT OUTER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio |
|---|
| 160 | LEFT OUTER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft |
|---|
| 161 | WHERE imagenes.idimagen=".$idmagen; |
|---|
| 162 | $rs->Comando=&$cmd; |
|---|
| 163 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
|---|
| 164 | $rs->Primero(); |
|---|
| 165 | if (!$rs->EOF){ |
|---|
| 166 | $nombreca=$rs->campos["nombreca"]; |
|---|
| 167 | $descripcion=$rs->campos["descripcion"]; |
|---|
| 168 | $idperfilsoft=$rs->campos["idperfilsoft"]; |
|---|
| 169 | $comentarios=$rs->campos["comentarios"]; |
|---|
| 170 | $numpar=$rs->campos["numpar"]; |
|---|
| 171 | $tipopar=$rs->campos["tipopar"]; |
|---|
| 172 | $codpar=$rs->campos["codpar"]; |
|---|
| 173 | $idrepositorio=$rs->campos["idrepositorio"]; |
|---|
| 174 | $nombrerepositorio=$rs->campos["nombrerepositorio"]; |
|---|
| 175 | $perfilsoft=$rs->campos["perfilsoft"]; |
|---|
| 176 | $rs->Cerrar(); |
|---|
| 177 | return(true); |
|---|
| 178 | } |
|---|
| 179 | else |
|---|
| 180 | return(true); |
|---|
| 181 | } |
|---|
| 182 | ?> |
|---|