1 | <?php |
---|
2 | // ************************************************************************************************ |
---|
3 | // Aplicación WEB: ogAdmWebCon |
---|
4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
5 | // Fecha Creaciónn: Año 2009-2010 |
---|
6 | // Fecha Última modificación: Agosto-2010 |
---|
7 | // Nombre del fichero: propiedades_menus.php |
---|
8 | // Descripción : |
---|
9 | // Presenta el formulario de captura de datos de un menu 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/TomaDato.php"); |
---|
15 | include_once("../includes/HTMLSELECT.php"); |
---|
16 | include_once("../includes/HTMLCTESELECT.php"); |
---|
17 | include_once("../includes/tftputils.php"); |
---|
18 | include_once("../clases/AdoPhp.php"); |
---|
19 | include_once("../idiomas/php/".$idioma."/propiedades_menus_".$idioma.".php"); |
---|
20 | include_once("../idiomas/php/".$idioma."/avisos_".$idioma.".php"); |
---|
21 | //________________________________________________________________________________________________________ |
---|
22 | $opcion=0; |
---|
23 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
24 | //________________________________________________________________________________________________________ |
---|
25 | $idmenu=0; |
---|
26 | $descripcion=""; |
---|
27 | $titulo=""; |
---|
28 | $modalidad=0; |
---|
29 | $smodalidad=0; |
---|
30 | $comentarios=""; |
---|
31 | $grupoid=0; |
---|
32 | $htmlmenupub=""; |
---|
33 | $htmlmenupri=""; |
---|
34 | $resolucion=""; |
---|
35 | $idurlimg=0; |
---|
36 | |
---|
37 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
38 | if (isset($_GET["idmenu"])) $idmenu=$_GET["idmenu"]; |
---|
39 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
40 | if (isset($_GET["identificador"])) $idmenu=$_GET["identificador"]; |
---|
41 | //________________________________________________________________________________________________________ |
---|
42 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
43 | if (!$cmd) |
---|
44 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
45 | if ($opcion!=$op_alta){ |
---|
46 | $resul=TomaPropiedades($cmd,$idmenu); |
---|
47 | if (!$resul) |
---|
48 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci�n de datos. |
---|
49 | } |
---|
50 | //________________________________________________________________________________________________________ |
---|
51 | ?> |
---|
52 | <HTML> |
---|
53 | <HEAD> |
---|
54 | <TITLE>Administración web de aulas</TITLE> |
---|
55 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
56 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
57 | <SCRIPT language="javascript" src="../jscripts/propiedades_menus.js"></SCRIPT> |
---|
58 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
59 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_menus_'.$idioma.'.js"></SCRIPT>'?> |
---|
60 | </HEAD> |
---|
61 | <BODY> |
---|
62 | <div align="center"> |
---|
63 | <FORM name="fdatos" action="../gestores/gestor_menus.php" method="post"> |
---|
64 | <INPUT type=hidden name=opcion value=<?php echo $opcion?>> |
---|
65 | <INPUT type=hidden name=idmenu value=<?php echo $idmenu?>> |
---|
66 | <INPUT type=hidden name=grupoid value=<?php echo $grupoid?>> |
---|
67 | <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR> |
---|
68 | <SPAN class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> |
---|
69 | <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos"> |
---|
70 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
71 | <tr> |
---|
72 | <th align="center"> <?php echo $TbMsg[5]?> </th> |
---|
73 | <?php if ($opcion==$op_eliminacion) |
---|
74 | echo '<td style="width:300px">'.$descripcion.'</td>'; |
---|
75 | else |
---|
76 | echo '<td><input class="formulariodatos" name="descripcion" style="width:300px" type="text" value="'.$descripcion.'" /></td>';?> |
---|
77 | </tr> |
---|
78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
79 | <tr> |
---|
80 | <th align=center> <?php echo $TbMsg[6]?> </th> |
---|
81 | <?php if ($opcion==$op_eliminacion) |
---|
82 | echo '<td style="width:300px">'.$titulo.'</td>'; |
---|
83 | else |
---|
84 | echo '<td ><input class="formulariodatos" name="titulo" style="width:300px" type="text" value="'.$titulo.'" /></td>';?> |
---|
85 | </tr> |
---|
86 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
87 | <tr> |
---|
88 | <th align="center"> <?php echo $TbMsg[18]?> </th> |
---|
89 | <?php if ($opcion==$op_eliminacion) |
---|
90 | echo '<td colspan="3">'.TomaDato($cmd,0,'iconos',$idurlimg,'idicono','descripcion').' </td>'; |
---|
91 | else |
---|
92 | echo '<td colspan="3">'.HTMLSELECT($cmd,0,'iconos',$idurlimg,'idicono','descripcion',150,"","","idtipoicono=3").'</td>'; |
---|
93 | ?> |
---|
94 | </tr> |
---|
95 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
96 | <!--<php--> |
---|
97 | |
---|
98 | <tr> |
---|
99 | <th align="center"> <?php echo $TbMsg[17]?> </th> |
---|
100 | <?php if ($opcion==$op_eliminacion){ |
---|
101 | $tbresolucion[788]="800x600 16bits"; |
---|
102 | $tbresolucion[791]="1024x768 16bits"; |
---|
103 | $tbresolucion[355]="1152x864 16bits"; |
---|
104 | $tbresolucion[794]="1280x1024 16bits"; |
---|
105 | $tbresolucion[798]="1600x1200 16bits"; |
---|
106 | $tbresolucion[789]="800x600 24bits"; |
---|
107 | $tbresolucion[792]="1024x768 24bits"; |
---|
108 | $tbresolucion[795]="1280x1024 24bits"; |
---|
109 | $tbresolucion[799]="1600x1200 24bits"; |
---|
110 | $tbresolucion[814]="800x600 32bits"; |
---|
111 | $tbresolucion[824]="1024x768 32bits"; |
---|
112 | $tbresolucion[829]="1280x1024 32bits"; |
---|
113 | $tbresolucion[834]="1600x1200 32bits"; |
---|
114 | if (empty ($tbresolucion[$resolucion])) { |
---|
115 | $res = $resolucion; |
---|
116 | } else { |
---|
117 | $res = $tbresolucion[$resolucion]; |
---|
118 | } |
---|
119 | echo '<td>'.$res.'</td>'; |
---|
120 | } |
---|
121 | else{ |
---|
122 | if (clientKernelVersion() < "3.07") { |
---|
123 | // Kernel anterior a 3.7 usa parámetro "vga". |
---|
124 | $parametros ="788=800x600 16bits".chr(13); |
---|
125 | $parametros.="791=1024x768 16bits".chr(13); |
---|
126 | $parametros.="355=1152x864 16bits".chr(13); |
---|
127 | $parametros.="794=1280x1024 16bits".chr(13); |
---|
128 | $parametros.="798=1600x1200 16bits".chr(13); |
---|
129 | $parametros.="789=800x600 24bits".chr(13); |
---|
130 | $parametros.="792=1024x768 24bits".chr(13); |
---|
131 | $parametros.="795=1280x1024 24bits".chr(13); |
---|
132 | $parametros.="799=1600x1200 24bits".chr(13); |
---|
133 | $parametros.="814=800x600 32bits".chr(13); |
---|
134 | $parametros.="824=1024x768 32bits".chr(13); |
---|
135 | $parametros.="829=1280x1024 32bits".chr(13); |
---|
136 | $parametros.="834=1600x1200 32bits"; |
---|
137 | } else { |
---|
138 | // Kernel 3.7 y superior usa parámetro "video". |
---|
139 | $parametros ="uvesafb:D=".$TbMsg["PROP_DEFAULT"].chr(13); |
---|
140 | $parametros.="uvesafb:800x600-16=800x600, 16bit".chr(13); |
---|
141 | $parametros.="uvesafb:800x600-24=800x600, 24bit".chr(13); |
---|
142 | $parametros.="uvesafb:800x600-32=800x600, 32bit".chr(13); |
---|
143 | $parametros.="uvesafb:1024x768-16=1024x768, 16bit".chr(13); |
---|
144 | $parametros.="uvesafb:1024x768-24=1024x768, 24bit".chr(13); |
---|
145 | $parametros.="uvesafb:1024x768-32=1024x768, 32bit".chr(13); |
---|
146 | $parametros.="uvesafb:1152x864-16=1152x864, 16bit".chr(13); |
---|
147 | $parametros.="uvesafb:1280x1024,16=1280x1024, 16bit".chr(13); |
---|
148 | $parametros.="uvesafb:1280x1024,24=1280x1024, 24bit".chr(13); |
---|
149 | $parametros.="uvesafb:1280x1024,32=1280x1024, 32bit".chr(13); |
---|
150 | $parametros.="uvesafb:1600x1200,16=1600x1200, 16bit".chr(13); |
---|
151 | $parametros.="uvesafb:1600x1200,24=1600x1200, 24bit".chr(13); |
---|
152 | $parametros.="uvesafb:1600x1200,32=1600x1200, 32bit"; |
---|
153 | } |
---|
154 | echo '<td>'.HTMLCTESELECT($parametros,"resolucion","estilodesple","",$resolucion,150).'</td>'; |
---|
155 | } |
---|
156 | ?> |
---|
157 | </tr> |
---|
158 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
159 | <tr> |
---|
160 | <th align="center"> <?php echo $TbMsg[7]?> </th> |
---|
161 | <?php if ($opcion==$op_eliminacion) |
---|
162 | echo '<td>'.$comentarios.' </TD>'; |
---|
163 | else |
---|
164 | echo '<td><textarea class="formulariodatos" name="comentarios" rows="3" cols="55">'.$comentarios.'</textarea></td>'; |
---|
165 | ?> |
---|
166 | </tr> |
---|
167 | </table> |
---|
168 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
169 | <BR> |
---|
170 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
171 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
172 | <TR> |
---|
173 | <TD align=center colspan=2> <b><?php echo $TbMsg[8]?></b> </TD> |
---|
174 | </TR> |
---|
175 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
176 | <TR> |
---|
177 | <TH align=center> <?php echo $TbMsg[11]?> </TH> |
---|
178 | <?php if ($opcion==$op_eliminacion){ |
---|
179 | $tbmodalidad[1]=$TbMsg[13]; |
---|
180 | $tbmodalidad[2]=$TbMsg[14]; |
---|
181 | echo '<TD style="width:100px">'.$tbmodalidad[$modalidad].'</TD>'; |
---|
182 | } |
---|
183 | else{ |
---|
184 | $parametros="1=1".chr(13); |
---|
185 | $parametros.="2=2".chr(13); |
---|
186 | $parametros.="3=3".chr(13); |
---|
187 | $parametros.="4=4".chr(13); |
---|
188 | $parametros.="5=5"; |
---|
189 | echo '<TD>'.HTMLCTESELECT($parametros,"modalidad","estilodesple","",$modalidad,100).'</TD>'; |
---|
190 | } |
---|
191 | ?> |
---|
192 | </TR> |
---|
193 | |
---|
194 | <TR> |
---|
195 | <TH align=center> <?php echo $TbMsg[15]?> </TH> |
---|
196 | <?php if ($opcion==$op_eliminacion) |
---|
197 | echo '<TD colspan=5>'.$htmlmenupub.'</TD>'; |
---|
198 | else |
---|
199 | echo '<TD colspan=5><INPUT class="formulariodatos" name=htmlmenupub style="width:350px" type=text value="'.$htmlmenupub.'"></TD>'; |
---|
200 | ?> |
---|
201 | </TR> |
---|
202 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
203 | <TR> |
---|
204 | <TD align=center colspan=6> <b><?php echo $TbMsg[12]?></b> </TD> |
---|
205 | </TR> |
---|
206 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
207 | <TR> |
---|
208 | <TH align=center> <?php echo $TbMsg[11]?> </TH> |
---|
209 | <?php if ($opcion==$op_eliminacion){ |
---|
210 | $tbmodalidad[1]=$TbMsg[13]; |
---|
211 | $tbmodalidad[2]=$TbMsg[14]; |
---|
212 | echo '<TD style="width:100px">'.$tbmodalidad[$smodalidad].'</TD>'; |
---|
213 | } |
---|
214 | else{ |
---|
215 | $parametros="1=1".chr(13); |
---|
216 | $parametros.="2=2".chr(13); |
---|
217 | $parametros.="3=3".chr(13); |
---|
218 | $parametros.="4=4".chr(13); |
---|
219 | $parametros.="5=5"; |
---|
220 | echo '<TD>'.HTMLCTESELECT($parametros,"smodalidad","estilodesple","",$smodalidad,100).'</TD>'; |
---|
221 | } |
---|
222 | ?> |
---|
223 | </TR> |
---|
224 | <TR> |
---|
225 | <TH align=center> <?php echo $TbMsg[15]?> </TH> |
---|
226 | <?php if ($opcion==$op_eliminacion) |
---|
227 | echo '<TD colspan=5">'.$htmlmenupri.'</TD>'; |
---|
228 | else |
---|
229 | echo '<TD colspan=5><INPUT class="formulariodatos" name=htmlmenupri style="width:350px" type=text value="'.$htmlmenupri.'"></TD>'; |
---|
230 | ?> |
---|
231 | </TR> |
---|
232 | </TABLE> |
---|
233 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
234 | <br> |
---|
235 | <table align="center" border="0" cellpadding="1" cellspacing="1" class="tabla_datos"> |
---|
236 | <?php if ($opcion!=$op_eliminacion) |
---|
237 | echo '<tr><th align="center"> '.$TbMsg["WARN_NOTESOFMENU"].' </th></th>'; |
---|
238 | ?> |
---|
239 | </table> |
---|
240 | </FORM> |
---|
241 | </div> |
---|
242 | <?php |
---|
243 | //________________________________________________________________________________________________________ |
---|
244 | include_once("../includes/opcionesbotonesop.php"); |
---|
245 | //________________________________________________________________________________________________________ |
---|
246 | ?> |
---|
247 | </BODY> |
---|
248 | </HTML> |
---|
249 | <?php |
---|
250 | //________________________________________________________________________________________________________ |
---|
251 | // Recupera los datos de un menu |
---|
252 | // Parametros: |
---|
253 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
254 | // - id: El identificador del menu |
---|
255 | //________________________________________________________________________________________________________ |
---|
256 | function TomaPropiedades($cmd,$id){ |
---|
257 | global $descripcion; |
---|
258 | global $titulo; |
---|
259 | global $modalidad; |
---|
260 | global $smodalidad; |
---|
261 | global $comentarios; |
---|
262 | global $htmlmenupub; |
---|
263 | global $htmlmenupri; |
---|
264 | global $resolucion; |
---|
265 | global $idurlimg; |
---|
266 | |
---|
267 | $rs=new Recordset; |
---|
268 | $cmd->texto="SELECT * FROM menus WHERE idmenu=".$id; |
---|
269 | $rs->Comando=&$cmd; |
---|
270 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
271 | $rs->Primero(); |
---|
272 | if (!$rs->EOF){ |
---|
273 | $descripcion=$rs->campos["descripcion"]; |
---|
274 | $titulo=$rs->campos["titulo"]; |
---|
275 | $modalidad=$rs->campos["modalidad"]; |
---|
276 | $smodalidad=$rs->campos["smodalidad"]; |
---|
277 | $comentarios=$rs->campos["comentarios"]; |
---|
278 | $htmlmenupub=$rs->campos["htmlmenupub"]; |
---|
279 | $htmlmenupri=$rs->campos["htmlmenupri"]; |
---|
280 | $resolucion=$rs->campos["resolucion"]; |
---|
281 | $idurlimg=$rs->campos["idurlimg"]; |
---|
282 | $rs->Cerrar(); |
---|
283 | return(true); |
---|
284 | } |
---|
285 | else |
---|
286 | return(false); |
---|
287 | } |
---|
288 | |
---|