source: admin/WebConsole/propiedades/propiedades_menus.php

lgromero-new-oglive
Last change on this file was b0d5fb32, checked in by Ramón M. Gómez <ramongomez@…>, 6 years ago

#834: Fixing more code cleanup: CSS units, HTML syntax and PHP closing tags.

  • Property mode set to 100644
File size: 12.8 KB
RevLine 
[70ed85d]1<?php
[3ec149c]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// **************************************************************************************************
11include_once("../includes/ctrlacc.php");
12include_once("../includes/opciones.php");
13include_once("../includes/CreaComando.php");
14include_once("../includes/TomaDato.php");
15include_once("../includes/HTMLSELECT.php");
16include_once("../includes/HTMLCTESELECT.php");
[6102bcc]17include_once("../includes/tftputils.php");
[3ec149c]18include_once("../clases/AdoPhp.php");
19include_once("../idiomas/php/".$idioma."/propiedades_menus_".$idioma.".php");
[70ed85d]20include_once("../idiomas/php/".$idioma."/avisos_".$idioma.".php");
[3ec149c]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
37if (isset($_GET["opcion"])) $opcion=$_GET["opcion"];  // Recoge parametros
38if (isset($_GET["idmenu"])) $idmenu=$_GET["idmenu"];
39if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"];
40if (isset($_GET["identificador"])) $idmenu=$_GET["identificador"];
41//________________________________________________________________________________________________________
42$cmd=CreaComando($cadenaconexion); // Crea objeto comando
43if (!$cmd)
44        Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
45if  ($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>
[b0d5fb32]54    <TITLE>Administración web de aulas</TITLE>
[3ec149c]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>
[043e67d]59        <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_menus_'.$idioma.'.js"></SCRIPT>'?>
[3ec149c]60</HEAD>
61<BODY>
[b0d5fb32]62<div align="center">
[3ec149c]63<FORM name="fdatos" action="../gestores/gestor_menus.php" method="post"> 
[043e67d]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?>>
[b657326]67        <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR>
[b0d5fb32]68        <SPAN class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P>
[b657326]69        <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos">
[3ec149c]70<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
[b657326]71                <tr>
[043e67d]72                        <th align="center">&nbsp;<?php echo $TbMsg[5]?>&nbsp;</th>
[c31a439]73                        <?php   if ($opcion==$op_eliminacion)
[b0d5fb32]74                                        echo '<td style="width:300px">'.$descripcion.'</td>';
[3ec149c]75                                else
[b0d5fb32]76                                        echo '<td><input class="formulariodatos" name="descripcion" style="width:300px" type="text" value="'.$descripcion.'" /></td>';?>
[b657326]77                </tr>
[3ec149c]78<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
[b657326]79                <tr>
[043e67d]80                        <th  align=center>&nbsp;<?php echo $TbMsg[6]?>&nbsp;</th>
[c31a439]81                        <?php   if ($opcion==$op_eliminacion)
[b0d5fb32]82                                        echo '<td  style="width:300px">'.$titulo.'</td>';
[3ec149c]83                                else
[b0d5fb32]84                                        echo '<td ><input class="formulariodatos" name="titulo" style="width:300px" type="text" value="'.$titulo.'" /></td>';?>
[b657326]85                </tr>
[3ec149c]86<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
[b657326]87                <tr>
[043e67d]88                        <th align="center">&nbsp;<?php echo $TbMsg[18]?>&nbsp;</th>
[b657326]89                        <?php   if ($opcion==$op_eliminacion)
90                                        echo '<td colspan="3">'.TomaDato($cmd,0,'iconos',$idurlimg,'idicono','descripcion').'&nbsp;</td>';
[3ec149c]91                                else
[b657326]92                                        echo '<td colspan="3">'.HTMLSELECT($cmd,0,'iconos',$idurlimg,'idicono','descripcion',150,"","","idtipoicono=3").'</td>';
[3ec149c]93                        ?>
[b657326]94                </tr>
[3ec149c]95<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
[5bac736]96<!--<php-->
97
[6102bcc]98                <tr>
[b657326]99                        <th align="center">&nbsp;<?php echo $TbMsg[17]?>&nbsp;</th>
[6102bcc]100                        <?php   if ($opcion==$op_eliminacion){
[5bac736]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";
[dc5e48a]106                                        $tbresolucion[789]="800x600   24bits";
107                                        $tbresolucion[792]="1024x768  24bits";
108                                        $tbresolucion[795]="1280x1024 24bits";
[5bac736]109                                        $tbresolucion[799]="1600x1200 24bits";
[489ff9e]110                                        $tbresolucion[814]="800x600   32bits";
111                                        $tbresolucion[824]="1024x768  32bits";
112                                        $tbresolucion[829]="1280x1024 32bits";
113                                        $tbresolucion[834]="1600x1200 32bits";
[6102bcc]114                                        if (empty ($tbresolucion[$resolucion])) {
115                                                $res = $resolucion;
116                                        } else {
117                                                $res = $tbresolucion[$resolucion];
118                                        }
119                                        echo '<td>'.$res.'</td>';
[3ec149c]120                                }
121                                else{
[7894c0a]122                                        if (clientKernelVersion() < "3.07") {
[6102bcc]123                                                // Kernel anterior a 3.7 usa parámetro "vga".
[b657326]124                                                $parametros ="788=800x600   16bits".chr(13);
[6102bcc]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);
[489ff9e]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";
[6102bcc]137                                        } else {
138                                                // Kernel 3.7 y superior usa parámetro "video".
[489ff9e]139                                                $parametros ="uvesafb:D=".$TbMsg["PROP_DEFAULT"].chr(13);
140                                                $parametros.="uvesafb:800x600-16=800x600, 16bit".chr(13);
[b657326]141                                                $parametros.="uvesafb:800x600-24=800x600, 24bit".chr(13);
[489ff9e]142                                                $parametros.="uvesafb:800x600-32=800x600, 32bit".chr(13);
[b657326]143                                                $parametros.="uvesafb:1024x768-16=1024x768, 16bit".chr(13);
144                                                $parametros.="uvesafb:1024x768-24=1024x768, 24bit".chr(13);
[489ff9e]145                                                $parametros.="uvesafb:1024x768-32=1024x768, 32bit".chr(13);
[b657326]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);
[489ff9e]149                                                $parametros.="uvesafb:1280x1024,32=1280x1024, 32bit".chr(13);
150                                                $parametros.="uvesafb:1600x1200,16=1600x1200, 16bit".chr(13);
[b657326]151                                                $parametros.="uvesafb:1600x1200,24=1600x1200, 24bit".chr(13);
[489ff9e]152                                                $parametros.="uvesafb:1600x1200,32=1600x1200, 32bit";
[6102bcc]153                                        }
[b657326]154                                        echo '<td>'.HTMLCTESELECT($parametros,"resolucion","estilodesple","",$resolucion,150).'</td>';
[3ec149c]155                                }
156                        ?>
[6102bcc]157                </tr>
[3ec149c]158<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
[6102bcc]159                <tr>
[043e67d]160                        <th align="center">&nbsp;<?php echo $TbMsg[7]?>&nbsp;</th>
[c31a439]161                        <?php   if ($opcion==$op_eliminacion)
[6102bcc]162                                        echo '<td>'.$comentarios.'&nbsp</TD>';
[3ec149c]163                                else
[b657326]164                                        echo '<td><textarea class="formulariodatos" name="comentarios" rows="3" cols="55">'.$comentarios.'</textarea></td>';
[3ec149c]165                        ?>
[6102bcc]166                </tr>
[b657326]167</table>
[3ec149c]168<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
169<BR>
170<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
171        <TABLE  align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
172                <TR>
[043e67d]173                        <TD align=center colspan=2>&nbsp;<b><?php echo $TbMsg[8]?></b>&nbsp;</TD>
[3ec149c]174                </TR>
175<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
176                <TR>
[1a2fa9d8]177                        <TH align=center>&nbsp;<?php echo $TbMsg[11]?>&nbsp;</TH>
178                        <?php   if ($opcion==$op_eliminacion){
[3ec149c]179                                        $tbmodalidad[1]=$TbMsg[13];
180                                        $tbmodalidad[2]=$TbMsg[14];
[b0d5fb32]181                                        echo '<TD style="width:100px">'.$tbmodalidad[$modalidad].'</TD>';
[3ec149c]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>
[043e67d]195                        <TH align=center>&nbsp; <?php echo $TbMsg[15]?>&nbsp;</TH>
196                        <?php if ($opcion==$op_eliminacion)
[3ec149c]197                                        echo '<TD colspan=5>'.$htmlmenupub.'</TD>';
198                                else
[b0d5fb32]199                                        echo '<TD colspan=5><INPUT  class="formulariodatos" name=htmlmenupub style="width:350px" type=text value="'.$htmlmenupub.'"></TD>';
[3ec149c]200                        ?>
201                </TR>
202<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
203                <TR>
[043e67d]204                        <TD align=center colspan=6>&nbsp;<b><?php echo $TbMsg[12]?></b>&nbsp;</TD>
[3ec149c]205                </TR>
206<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
207                <TR>
[1a2fa9d8]208                        <TH align=center>&nbsp;<?php echo $TbMsg[11]?>&nbsp;</TH>
209                                <?php   if ($opcion==$op_eliminacion){
[3ec149c]210                                                $tbmodalidad[1]=$TbMsg[13];
211                                                $tbmodalidad[2]=$TbMsg[14];
[b0d5fb32]212                                                echo '<TD style="width:100px">'.$tbmodalidad[$smodalidad].'</TD>';
[3ec149c]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>
[043e67d]225                        <TH align=center>&nbsp; <?php echo $TbMsg[15]?>&nbsp;</TH>
226                        <?php if ($opcion==$op_eliminacion)
[3ec149c]227                                        echo '<TD colspan=5">'.$htmlmenupri.'</TD>';
228                                else
[b0d5fb32]229                                        echo '<TD colspan=5><INPUT  class="formulariodatos" name=htmlmenupri style="width:350px" type=text value="'.$htmlmenupri.'"></TD>';
[3ec149c]230                        ?>
231                </TR>
232        </TABLE>
[1a2fa9d8]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">&nbsp;'.$TbMsg["WARN_NOTESOFMENU"].'&nbsp;</th></th>';
238                ?>
239        </table>
[3ec149c]240</FORM>
[b0d5fb32]241</div>
[b657326]242<?php
[3ec149c]243//________________________________________________________________________________________________________
244include_once("../includes/opcionesbotonesop.php");
245//________________________________________________________________________________________________________
246?>
247</BODY>
248</HTML>
[b657326]249<?php
[3ec149c]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//________________________________________________________________________________________________________
256function TomaPropiedades($cmd,$id){
257        global  $descripcion;
[6102bcc]258        global  $titulo;
259        global  $modalidad;
260        global  $smodalidad;
[3ec149c]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}
[b0d5fb32]288
Note: See TracBrowser for help on using the repository browser.