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: 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("../includes/constantes.php"); |
---|
15 | include_once("../clases/AdoPhp.php"); |
---|
16 | include_once("../includes/HTMLSELECT.php"); |
---|
17 | include_once("../includes/TomaDato.php"); |
---|
18 | include_once("../idiomas/php/".$idioma."/propiedades_imagenes_".$idioma.".php"); |
---|
19 | //________________________________________________________________________________________________________ |
---|
20 | |
---|
21 | $opcion=0; |
---|
22 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
23 | //________________________________________________________________________________________________________ |
---|
24 | |
---|
25 | $idimagen=0; |
---|
26 | $nombreca=""; |
---|
27 | $ruta=""; |
---|
28 | $descripcion=""; |
---|
29 | $idperfilsoft=0; |
---|
30 | $comentarios=""; |
---|
31 | $grupoid=0; |
---|
32 | |
---|
33 | $litamb=""; |
---|
34 | $tipoimg=0; |
---|
35 | |
---|
36 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
37 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; |
---|
38 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
39 | if (isset($_GET["identificador"])) $idimagen=$_GET["identificador"]; |
---|
40 | if (isset($_GET["litamb"])) $litamb=$_GET["litamb"]; |
---|
41 | if (isset($_GET["tipoimg"])) $tipoimg=$_GET["tipoimg"]; |
---|
42 | //________________________________________________________________________________________________________ |
---|
43 | |
---|
44 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
45 | if (!$cmd) |
---|
46 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
47 | if ($opcion!=$op_alta){ |
---|
48 | $resul=TomaPropiedades($cmd,$idimagen); |
---|
49 | if (!$resul) |
---|
50 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
51 | } |
---|
52 | //________________________________________________________________________________________________________ |
---|
53 | ?> |
---|
54 | <HTML> |
---|
55 | <TITLE>Administración web de aulas</TITLE> |
---|
56 | <HEAD> |
---|
57 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
58 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
59 | <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT> |
---|
60 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
61 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> |
---|
62 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
63 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> |
---|
64 | </HEAD> |
---|
65 | <BODY> |
---|
66 | <DIV align=center> |
---|
67 | <FORM name="fdatos" action="../gestores/gestor_imagenes.php" method="post"> |
---|
68 | <INPUT type="hidden" name="opcion" value="<?=$opcion?>"> |
---|
69 | <INPUT type="hidden" name="idimagen" value="<?=$idimagen?>"> |
---|
70 | <INPUT type="hidden" name="grupoid" value="<?=$grupoid?>"> |
---|
71 | <INPUT type="hidden" name="tipoimg" value="<?=$tipoimg?>"> |
---|
72 | <INPUT type="hidden" name="litamb" value="<?=$litamb?>"> |
---|
73 | <? |
---|
74 | switch($tipoimg){ |
---|
75 | case $IMAGENES_MONOLITICAS: |
---|
76 | $lit=$TbMsg[4]; |
---|
77 | break; |
---|
78 | case |
---|
79 | $IMAGENES_BASICAS: |
---|
80 | $lit=$TbMsg[12]; |
---|
81 | break; |
---|
82 | case $IMAGENES_INCREMENTALES: |
---|
83 | $lit=$TbMsg[13]; |
---|
84 | } |
---|
85 | |
---|
86 | ?> |
---|
87 | <P align=center class=cabeceras><?echo $lit?><BR> |
---|
88 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN> |
---|
89 | </P> |
---|
90 | |
---|
91 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
92 | <!--------------------------------------------------------------------------------------> |
---|
93 | <TR> |
---|
94 | <TH align=center> <?echo $TbMsg[11]?> </TD> |
---|
95 | <?if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
96 | echo '<TD style="width:150">'.$nombreca.' |
---|
97 | <INPUT type="hidden" name="nombreca" value="'.$nombreca.'"></TD>'; |
---|
98 | else |
---|
99 | echo '<TD><INPUT class="formulariodatos" name=nombreca style="width:150" type=text value="'.$nombreca.'"></TH>';?> |
---|
100 | </TR> |
---|
101 | <!--------------------------------------------------------------------------------------> |
---|
102 | <TR> |
---|
103 | <TH align=center> <?echo $TbMsg[5]?> </TD> |
---|
104 | <?if ($opcion==$op_eliminacion) |
---|
105 | echo '<TD style="width:300">'.$descripcion.'</TD>'; |
---|
106 | else |
---|
107 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:350" type=text value="'.$descripcion.'"></TH>';?> |
---|
108 | </TR> |
---|
109 | <!--------------------------------------------------------------------------------------> |
---|
110 | <?if($tipoimg==$IMAGENES_INCREMENTALES){?> |
---|
111 | <TR> |
---|
112 | <TH align=center> <?echo $TbMsg[14]?> </TD> |
---|
113 | <? |
---|
114 | if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
115 | echo '<TD>'.TomaDato($cmd,$idcentro,'imagenes',$imagenid,'imagenid','descripcion').' |
---|
116 | <INPUT type="hidden" name="imagenid" value="'.$imagenid.'"></TD>'; |
---|
117 | else |
---|
118 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'imagenes',$imagenid,'idimagen','descripcion',300,"",""," |
---|
119 | tipo=".$IMAGENES_BASICAS,"imagenid").'</TD>'; |
---|
120 | ?> |
---|
121 | </TR> |
---|
122 | <?}?> |
---|
123 | <!--------------------------------------------------------------------------------------> |
---|
124 | <?if($tipoimg!=$IMAGENES_INCREMENTALES){?> |
---|
125 | <TR> |
---|
126 | <TH align=center> <?echo $TbMsg[8]?> </TD> |
---|
127 | <? |
---|
128 | if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
129 | echo '<TD>'.$numpar.' |
---|
130 | <INPUT type="hidden" name="numpar" value="'.$numpar.'"></TD>'; |
---|
131 | else |
---|
132 | echo '<TD><INPUT class="formulariodatos" name=numpar style="width:30" type=text value="'.$numpar.'"></TH>'; |
---|
133 | ?> |
---|
134 | </TR> |
---|
135 | <!--------------------------------------------------------------------------------------> |
---|
136 | <tr> |
---|
137 | <th align="center"> <?php echo $TbMsg[9]?> </th> |
---|
138 | <?php |
---|
139 | if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
140 | echo '<td>'.$tipopar.' |
---|
141 | <INPUT type="hidden" name="codpar" value="'.$codpar.'"></TD>'; |
---|
142 | else |
---|
143 | echo '<td>'.HTMLSELECT($cmd,0,'tipospar',$codpar,'codpar',"CONCAT(tipopar,' (',HEX(codpar),')')",170,"","","clonable=1").'</td>'; |
---|
144 | ?> |
---|
145 | </tr> |
---|
146 | <!--------------------------------------------------------------------------------------> |
---|
147 | <TR> |
---|
148 | <TH align=center> <?echo $TbMsg[10]?> </TD> |
---|
149 | <? |
---|
150 | if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
151 | echo '<TD>'.$nombrerepositorio.' |
---|
152 | <INPUT type="hidden" name="idrepositorio" value="'.$idrepositorio.'"></TD>'; |
---|
153 | else |
---|
154 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',300).'</TD>'; |
---|
155 | ?> |
---|
156 | </TR> |
---|
157 | <!--------------------------------------------------------------------------------------> |
---|
158 | <?if($tipoimg==$IMAGENES_BASICAS){?> |
---|
159 | <TR> |
---|
160 | <TH align=center> <?echo $TbMsg[16]?> </TD> |
---|
161 | <?if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
162 | echo '<TD>'.$ruta.' |
---|
163 | <INPUT type="hidden" name="ruta" value="'.$ruta.'"></TD>'; |
---|
164 | else |
---|
165 | echo '<TD><INPUT class="formulariodatos" name=ruta style="width:350" type=text value="'.$ruta.'"></TH>';?> |
---|
166 | </TR> |
---|
167 | <?}?> |
---|
168 | <!--------------------------------------------------------------------------------------> |
---|
169 | <TR> |
---|
170 | <TH align=center> <?echo $TbMsg[7]?> </TD> |
---|
171 | <?if ($opcion==$op_eliminacion) |
---|
172 | echo '<TD>'.$comentarios.'</TD>'; |
---|
173 | else |
---|
174 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=55>'.$comentarios.'</TEXTAREA></TH>'; |
---|
175 | ?> |
---|
176 | </TR> |
---|
177 | <!--------------------------------------------------------------------------------------> |
---|
178 | |
---|
179 | <TR> |
---|
180 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
181 | <? |
---|
182 | echo '<TD>'.$perfilsoft.' |
---|
183 | <INPUT type="hidden" name="idperfilsoft" value="'.$idperfilsoft.'"></TH>'; |
---|
184 | |
---|
185 | ?> |
---|
186 | </TR> |
---|
187 | <?}?> |
---|
188 | <!--------------------------------------------------------------------------------------> |
---|
189 | </TABLE> |
---|
190 | </FORM> |
---|
191 | |
---|
192 | <? |
---|
193 | if (!empty($idperfilsoft)){ // Nota a pie de página indicando que cuando la imagen tiene perfilsoft no pueden modificarse ciertos campos |
---|
194 | echo ' |
---|
195 | <DIV id="Layer_nota" align=center > |
---|
196 | <SPAN align=center class=notas><I>'.$TbMsg[15].'</I></SPAN> |
---|
197 | </DIV><br>'; |
---|
198 | } |
---|
199 | //________________________________________________________________________________________________________ |
---|
200 | |
---|
201 | include_once("../includes/opcionesbotonesop.php"); |
---|
202 | //________________________________________________________________________________________________________ |
---|
203 | |
---|
204 | ?> |
---|
205 | </BODY> |
---|
206 | </HTML> |
---|
207 | <? |
---|
208 | //________________________________________________________________________________________________________ |
---|
209 | |
---|
210 | // Recupera los datos de una imagen |
---|
211 | // Parametros: |
---|
212 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
213 | // - id: El identificador de la imagen |
---|
214 | //________________________________________________________________________________________________________ |
---|
215 | |
---|
216 | function TomaPropiedades($cmd,$idmagen){ |
---|
217 | global $nombreca; |
---|
218 | global $ruta; |
---|
219 | global $descripcion; |
---|
220 | global $comentarios; |
---|
221 | global $idperfilsoft; |
---|
222 | global $numpar; |
---|
223 | global $codpar; |
---|
224 | global $tipopar; |
---|
225 | global $nombrerepositorio; |
---|
226 | global $idrepositorio; |
---|
227 | global $perfilsoft; |
---|
228 | global $imagenid; |
---|
229 | |
---|
230 | $rs=new Recordset; |
---|
231 | $cmd->texto="SELECT imagenes.*,tipospar.tipopar,repositorios.nombrerepositorio,perfilessoft.descripcion as perfilsoft |
---|
232 | FROM imagenes |
---|
233 | LEFT OUTER JOIN tipospar ON tipospar.codpar=imagenes.codpar |
---|
234 | LEFT OUTER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio |
---|
235 | LEFT OUTER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft |
---|
236 | WHERE imagenes.idimagen=".$idmagen; |
---|
237 | $rs->Comando=&$cmd; |
---|
238 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
239 | $rs->Primero(); |
---|
240 | if (!$rs->EOF){ |
---|
241 | $nombreca=$rs->campos["nombreca"]; |
---|
242 | $ruta=$rs->campos["ruta"]; |
---|
243 | $descripcion=$rs->campos["descripcion"]; |
---|
244 | $idperfilsoft=$rs->campos["idperfilsoft"]; |
---|
245 | $comentarios=$rs->campos["comentarios"]; |
---|
246 | $numpar=$rs->campos["numpar"]; |
---|
247 | $tipopar=$rs->campos["tipopar"]; |
---|
248 | $codpar=$rs->campos["codpar"]; |
---|
249 | $idrepositorio=$rs->campos["idrepositorio"]; |
---|
250 | $nombrerepositorio=$rs->campos["nombrerepositorio"]; |
---|
251 | $perfilsoft=$rs->campos["perfilsoft"]; |
---|
252 | $imagenid=$rs->campos["imagenid"]; |
---|
253 | $rs->Cerrar(); |
---|
254 | return(true); |
---|
255 | } |
---|
256 | else |
---|
257 | return(true); |
---|
258 | } |
---|
259 | ?> |
---|