| 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 | <TITLE>Administración web de aulas</TITLE> |
|---|
| 54 | <HEAD> |
|---|
| 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 | <FORM name="fdatos" action="../gestores/gestor_menus.php" method="post"> |
|---|
| 63 | <INPUT type=hidden name=opcion value=<?php echo $opcion?>> |
|---|
| 64 | <INPUT type=hidden name=idmenu value=<?php echo $idmenu?>> |
|---|
| 65 | <INPUT type=hidden name=grupoid value=<?php echo $grupoid?>> |
|---|
| 66 | <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR> |
|---|
| 67 | <SPAN align=center class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> |
|---|
| 68 | <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos"> |
|---|
| 69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 70 | <tr> |
|---|
| 71 | <th align="center"> <?php echo $TbMsg[5]?> </th> |
|---|
| 72 | <?php 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> <?php echo $TbMsg[6]?> </th> |
|---|
| 80 | <?php if ($opcion==$op_eliminacion) |
|---|
| 81 | echo '<td style="width:300">'.$titulo.'</td>'; |
|---|
| 82 | else |
|---|
| 83 | echo '<td ><input class="formulariodatos" name="titulo" style="width:300" type="text" value="'.$titulo.'" /></td>';?> |
|---|
| 84 | </tr> |
|---|
| 85 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 86 | <tr> |
|---|
| 87 | <th align="center"> <?php echo $TbMsg[18]?> </th> |
|---|
| 88 | <?php if ($opcion==$op_eliminacion) |
|---|
| 89 | echo '<td colspan="3">'.TomaDato($cmd,0,'iconos',$idurlimg,'idicono','descripcion').' </td>'; |
|---|
| 90 | else |
|---|
| 91 | echo '<td colspan="3">'.HTMLSELECT($cmd,0,'iconos',$idurlimg,'idicono','descripcion',150,"","","idtipoicono=3").'</td>'; |
|---|
| 92 | ?> |
|---|
| 93 | </tr> |
|---|
| 94 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 95 | <!--<php--> |
|---|
| 96 | |
|---|
| 97 | <tr> |
|---|
| 98 | <th align="center"> <?php echo $TbMsg[17]?> </th> |
|---|
| 99 | <?php if ($opcion==$op_eliminacion){ |
|---|
| 100 | $tbresolucion[788]="800x600 16bits"; |
|---|
| 101 | $tbresolucion[791]="1024x768 16bits"; |
|---|
| 102 | $tbresolucion[355]="1152x864 16bits"; |
|---|
| 103 | $tbresolucion[794]="1280x1024 16bits"; |
|---|
| 104 | $tbresolucion[798]="1600x1200 16bits"; |
|---|
| 105 | $tbresolucion[789]="800x600 24bits"; |
|---|
| 106 | $tbresolucion[792]="1024x768 24bits"; |
|---|
| 107 | $tbresolucion[795]="1280x1024 24bits"; |
|---|
| 108 | $tbresolucion[799]="1600x1200 24bits"; |
|---|
| 109 | $tbresolucion[814]="800x600 32bits"; |
|---|
| 110 | $tbresolucion[824]="1024x768 32bits"; |
|---|
| 111 | $tbresolucion[829]="1280x1024 32bits"; |
|---|
| 112 | $tbresolucion[834]="1600x1200 32bits"; |
|---|
| 113 | if (empty ($tbresolucion[$resolucion])) { |
|---|
| 114 | $res = $resolucion; |
|---|
| 115 | } else { |
|---|
| 116 | $res = $tbresolucion[$resolucion]; |
|---|
| 117 | } |
|---|
| 118 | echo '<td>'.$res.'</td>'; |
|---|
| 119 | } |
|---|
| 120 | else{ |
|---|
| 121 | if (clientKernelVersion() < "3.07") { |
|---|
| 122 | // Kernel anterior a 3.7 usa parámetro "vga". |
|---|
| 123 | $parametros ="788=800x600 16bits".chr(13); |
|---|
| 124 | $parametros.="791=1024x768 16bits".chr(13); |
|---|
| 125 | $parametros.="355=1152x864 16bits".chr(13); |
|---|
| 126 | $parametros.="794=1280x1024 16bits".chr(13); |
|---|
| 127 | $parametros.="798=1600x1200 16bits".chr(13); |
|---|
| 128 | $parametros.="789=800x600 24bits".chr(13); |
|---|
| 129 | $parametros.="792=1024x768 24bits".chr(13); |
|---|
| 130 | $parametros.="795=1280x1024 24bits".chr(13); |
|---|
| 131 | $parametros.="799=1600x1200 24bits".chr(13); |
|---|
| 132 | $parametros.="814=800x600 32bits".chr(13); |
|---|
| 133 | $parametros.="824=1024x768 32bits".chr(13); |
|---|
| 134 | $parametros.="829=1280x1024 32bits".chr(13); |
|---|
| 135 | $parametros.="834=1600x1200 32bits"; |
|---|
| 136 | } else { |
|---|
| 137 | // Kernel 3.7 y superior usa parámetro "video". |
|---|
| 138 | $parametros ="uvesafb:D=".$TbMsg["PROP_DEFAULT"].chr(13); |
|---|
| 139 | $parametros.="uvesafb:800x600-16=800x600, 16bit".chr(13); |
|---|
| 140 | $parametros.="uvesafb:800x600-24=800x600, 24bit".chr(13); |
|---|
| 141 | $parametros.="uvesafb:800x600-32=800x600, 32bit".chr(13); |
|---|
| 142 | $parametros.="uvesafb:1024x768-16=1024x768, 16bit".chr(13); |
|---|
| 143 | $parametros.="uvesafb:1024x768-24=1024x768, 24bit".chr(13); |
|---|
| 144 | $parametros.="uvesafb:1024x768-32=1024x768, 32bit".chr(13); |
|---|
| 145 | $parametros.="uvesafb:1152x864-16=1152x864, 16bit".chr(13); |
|---|
| 146 | $parametros.="uvesafb:1280x1024,16=1280x1024, 16bit".chr(13); |
|---|
| 147 | $parametros.="uvesafb:1280x1024,24=1280x1024, 24bit".chr(13); |
|---|
| 148 | $parametros.="uvesafb:1280x1024,32=1280x1024, 32bit".chr(13); |
|---|
| 149 | $parametros.="uvesafb:1600x1200,16=1600x1200, 16bit".chr(13); |
|---|
| 150 | $parametros.="uvesafb:1600x1200,24=1600x1200, 24bit".chr(13); |
|---|
| 151 | $parametros.="uvesafb:1600x1200,32=1600x1200, 32bit"; |
|---|
| 152 | } |
|---|
| 153 | echo '<td>'.HTMLCTESELECT($parametros,"resolucion","estilodesple","",$resolucion,150).'</td>'; |
|---|
| 154 | } |
|---|
| 155 | ?> |
|---|
| 156 | </tr> |
|---|
| 157 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 158 | <tr> |
|---|
| 159 | <th align="center"> <?php echo $TbMsg[7]?> </th> |
|---|
| 160 | <?php if ($opcion==$op_eliminacion) |
|---|
| 161 | echo '<td>'.$comentarios.' </TD>'; |
|---|
| 162 | else |
|---|
| 163 | echo '<td><textarea class="formulariodatos" name="comentarios" rows="3" cols="55">'.$comentarios.'</textarea></td>'; |
|---|
| 164 | ?> |
|---|
| 165 | </tr> |
|---|
| 166 | </table> |
|---|
| 167 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 168 | <BR> |
|---|
| 169 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 170 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
|---|
| 171 | <TR> |
|---|
| 172 | <TD align=center colspan=2> <b><?php echo $TbMsg[8]?></b> </TD> |
|---|
| 173 | </TR> |
|---|
| 174 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 175 | <TR> |
|---|
| 176 | <TH align=center> <?php echo $TbMsg[11]?> </TH> |
|---|
| 177 | <?php if ($opcion==$op_eliminacion){ |
|---|
| 178 | $tbmodalidad[1]=$TbMsg[13]; |
|---|
| 179 | $tbmodalidad[2]=$TbMsg[14]; |
|---|
| 180 | echo '<TD style="width:100">'.$tbmodalidad[$modalidad].'</TD>'; |
|---|
| 181 | } |
|---|
| 182 | else{ |
|---|
| 183 | $parametros="1=1".chr(13); |
|---|
| 184 | $parametros.="2=2".chr(13); |
|---|
| 185 | $parametros.="3=3".chr(13); |
|---|
| 186 | $parametros.="4=4".chr(13); |
|---|
| 187 | $parametros.="5=5"; |
|---|
| 188 | echo '<TD>'.HTMLCTESELECT($parametros,"modalidad","estilodesple","",$modalidad,100).'</TD>'; |
|---|
| 189 | } |
|---|
| 190 | ?> |
|---|
| 191 | </TR> |
|---|
| 192 | |
|---|
| 193 | <TR> |
|---|
| 194 | <TH align=center> <?php echo $TbMsg[15]?> </TH> |
|---|
| 195 | <?php if ($opcion==$op_eliminacion) |
|---|
| 196 | echo '<TD colspan=5>'.$htmlmenupub.'</TD>'; |
|---|
| 197 | else |
|---|
| 198 | echo '<TD colspan=5><INPUT class="formulariodatos" name=htmlmenupub style="width:350" type=text value="'.$htmlmenupub.'"></TD>'; |
|---|
| 199 | ?> |
|---|
| 200 | </TR> |
|---|
| 201 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 202 | <TR> |
|---|
| 203 | <TD align=center colspan=6> <b><?php echo $TbMsg[12]?></b> </TD> |
|---|
| 204 | </TR> |
|---|
| 205 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 206 | <TR> |
|---|
| 207 | <TH align=center> <?php echo $TbMsg[11]?> </TH> |
|---|
| 208 | <?php if ($opcion==$op_eliminacion){ |
|---|
| 209 | $tbmodalidad[1]=$TbMsg[13]; |
|---|
| 210 | $tbmodalidad[2]=$TbMsg[14]; |
|---|
| 211 | echo '<TD style="width:100">'.$tbmodalidad[$smodalidad].'</TD>'; |
|---|
| 212 | } |
|---|
| 213 | else{ |
|---|
| 214 | $parametros="1=1".chr(13); |
|---|
| 215 | $parametros.="2=2".chr(13); |
|---|
| 216 | $parametros.="3=3".chr(13); |
|---|
| 217 | $parametros.="4=4".chr(13); |
|---|
| 218 | $parametros.="5=5"; |
|---|
| 219 | echo '<TD>'.HTMLCTESELECT($parametros,"smodalidad","estilodesple","",$smodalidad,100).'</TD>'; |
|---|
| 220 | } |
|---|
| 221 | ?> |
|---|
| 222 | </TR> |
|---|
| 223 | <TR> |
|---|
| 224 | <TH align=center> <?php echo $TbMsg[15]?> </TH> |
|---|
| 225 | <?php if ($opcion==$op_eliminacion) |
|---|
| 226 | echo '<TD colspan=5">'.$htmlmenupri.'</TD>'; |
|---|
| 227 | else |
|---|
| 228 | echo '<TD colspan=5><INPUT class="formulariodatos" name=htmlmenupri style="width:350" type=text value="'.$htmlmenupri.'"></TD>'; |
|---|
| 229 | ?> |
|---|
| 230 | </TR> |
|---|
| 231 | </TABLE> |
|---|
| 232 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
|---|
| 233 | <br> |
|---|
| 234 | <table align="center" border="0" cellpadding="1" cellspacing="1" class="tabla_datos"> |
|---|
| 235 | <?php if ($opcion!=$op_eliminacion) |
|---|
| 236 | echo '<tr><th align="center"> '.$TbMsg["WARN_NOTESOFMENU"].' </th></th>'; |
|---|
| 237 | ?> |
|---|
| 238 | </table> |
|---|
| 239 | </FORM> |
|---|
| 240 | </DIV> |
|---|
| 241 | <?php |
|---|
| 242 | //________________________________________________________________________________________________________ |
|---|
| 243 | include_once("../includes/opcionesbotonesop.php"); |
|---|
| 244 | //________________________________________________________________________________________________________ |
|---|
| 245 | ?> |
|---|
| 246 | </BODY> |
|---|
| 247 | </HTML> |
|---|
| 248 | <?php |
|---|
| 249 | //________________________________________________________________________________________________________ |
|---|
| 250 | // Recupera los datos de un menu |
|---|
| 251 | // Parametros: |
|---|
| 252 | // - cmd: Una comando ya operativo (con conexión abierta) |
|---|
| 253 | // - id: El identificador del menu |
|---|
| 254 | //________________________________________________________________________________________________________ |
|---|
| 255 | function TomaPropiedades($cmd,$id){ |
|---|
| 256 | global $descripcion; |
|---|
| 257 | global $titulo; |
|---|
| 258 | global $modalidad; |
|---|
| 259 | global $smodalidad; |
|---|
| 260 | global $comentarios; |
|---|
| 261 | global $htmlmenupub; |
|---|
| 262 | global $htmlmenupri; |
|---|
| 263 | global $resolucion; |
|---|
| 264 | global $idurlimg; |
|---|
| 265 | |
|---|
| 266 | $rs=new Recordset; |
|---|
| 267 | $cmd->texto="SELECT * FROM menus WHERE idmenu=".$id; |
|---|
| 268 | $rs->Comando=&$cmd; |
|---|
| 269 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
|---|
| 270 | $rs->Primero(); |
|---|
| 271 | if (!$rs->EOF){ |
|---|
| 272 | $descripcion=$rs->campos["descripcion"]; |
|---|
| 273 | $titulo=$rs->campos["titulo"]; |
|---|
| 274 | $modalidad=$rs->campos["modalidad"]; |
|---|
| 275 | $smodalidad=$rs->campos["smodalidad"]; |
|---|
| 276 | $comentarios=$rs->campos["comentarios"]; |
|---|
| 277 | $htmlmenupub=$rs->campos["htmlmenupub"]; |
|---|
| 278 | $htmlmenupri=$rs->campos["htmlmenupri"]; |
|---|
| 279 | $resolucion=$rs->campos["resolucion"]; |
|---|
| 280 | $idurlimg=$rs->campos["idurlimg"]; |
|---|
| 281 | $rs->Cerrar(); |
|---|
| 282 | return(true); |
|---|
| 283 | } |
|---|
| 284 | else |
|---|
| 285 | return(false); |
|---|
| 286 | } |
|---|
| 287 | ?> |
|---|