| 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: Agosto-2010 | 
|---|
| 6 | // Fecha Última modificación: Agosto-2010 | 
|---|
| 7 | // Nombre del fichero: barramenu.php | 
|---|
| 8 | // Descripción :Este fichero implementa el menu general de la Aplicación | 
|---|
| 9 | // ******************************************************************************************************** | 
|---|
| 10 | // Compatibilidad | 
|---|
| 11 | $device="";$device = strtolower($_SERVER['HTTP_USER_AGENT']); | 
|---|
| 12 | if(stripos($device,'iphone') !== false ){$device="iphone";} | 
|---|
| 13 | elseif  (stripos($device,'ipad') !== false) {$device="ipad";} | 
|---|
| 14 | elseif (stripos($device,'android') !== false){$device="android";} | 
|---|
| 15 | else{$device=0;} | 
|---|
| 16 | $version=@json_decode(file_get_contents("/opt/opengnsys/doc/VERSION.json"))->version; | 
|---|
| 17 | if(preg_match("/1.0.4/",$version) == TRUE ){$version=4;} | 
|---|
| 18 | // ******************************************************************************************************** | 
|---|
| 19 | include_once("./includes/ctrlacc.php"); | 
|---|
| 20 | include_once("./includes/constantes.php"); | 
|---|
| 21 | include_once("./includes/CreaComando.php"); | 
|---|
| 22 | include_once("./clases/AdoPhp.php"); | 
|---|
| 23 | include_once("./idiomas/php/".$idioma."/barramenu_".$idioma.".php"); | 
|---|
| 24 | //________________________________________________________________________________________________________ | 
|---|
| 25 |  | 
|---|
| 26 | //________________________________________________________________________________________________________ | 
|---|
| 27 | $cmd=CreaComando($cadenaconexion); | 
|---|
| 28 | if (!$cmd) | 
|---|
| 29 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexi�n con servidor B.D. | 
|---|
| 30 | //___________________________________________________________________________________________________ | 
|---|
| 31 | ?> | 
|---|
| 32 | <HTML> | 
|---|
| 33 | <HEAD> | 
|---|
| 34 | <TITLE>Administración web de aulas</TITLE> | 
|---|
| 35 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 
|---|
| 36 | <LINK rel="stylesheet" type="text/css" href="estilos.css"> | 
|---|
| 37 | <SCRIPT language="javascript"> | 
|---|
| 38 | var currentOp=null; | 
|---|
| 39 | //________________________________________________________________________________________________________ | 
|---|
| 40 | function resaltar(o){ | 
|---|
| 41 | if (o==currentOp) return; | 
|---|
| 42 | o.style.borderBottomColor="#808080"; | 
|---|
| 43 | o.style.borderRightColor="#808080"; | 
|---|
| 44 | o.style.borderTopColor="#ffffff"; | 
|---|
| 45 | o.style.borderLeftColor="#ffffff" | 
|---|
| 46 | } | 
|---|
| 47 | //________________________________________________________________________________________________________ | 
|---|
| 48 | function desresaltar(o){ | 
|---|
| 49 | if (o==currentOp) return; | 
|---|
| 50 | o.style.borderBottomColor="#d4d0c8"; | 
|---|
| 51 | o.style.borderRightColor="#d4d0c8"; | 
|---|
| 52 | o.style.borderTopColor="#d4d0c8"; | 
|---|
| 53 | o.style.borderLeftColor="#d4d0c8" | 
|---|
| 54 | } | 
|---|
| 55 | //________________________________________________________________________________________________________ | 
|---|
| 56 | function eleccion(o,op){ | 
|---|
| 57 | var opadre=window.parent; // Toma frame padre | 
|---|
| 58 | opadre.frames["frame_contenidos"].document.location.href="nada.php"; | 
|---|
| 59 | var href; | 
|---|
| 60 | var     href2="nada.php"; | 
|---|
| 61 | var     href3="./api/tree.html"; | 
|---|
| 62 | var     href4="./api/main.html"; | 
|---|
| 63 | var     href5="./principal/ayuda.php"; | 
|---|
| 64 | var     device="<?php echo $device;?>"; | 
|---|
| 65 | var     version="<?php echo $version;?>"; | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 | switch(op){ | 
|---|
| 69 | case 1: | 
|---|
| 70 | if (device!="0"){ | 
|---|
| 71 | href="./principal/aulas.device.php"; | 
|---|
| 72 | break;} | 
|---|
| 73 | else{href="./principal/aulas.php"; | 
|---|
| 74 | break;} | 
|---|
| 75 |  | 
|---|
| 76 | case 2: | 
|---|
| 77 | if (device!="0"){ | 
|---|
| 78 | href="./principal/acciones.device.php"; | 
|---|
| 79 | break;} | 
|---|
| 80 | else{href="./principal/acciones.php"; | 
|---|
| 81 | break;} | 
|---|
| 82 | case 3: | 
|---|
| 83 | if (device!="0"){ | 
|---|
| 84 | if (version=="4"){ | 
|---|
| 85 | href="./principal/imagenes.device4.php"; | 
|---|
| 86 | break;} | 
|---|
| 87 | else{href="./principal/imagenes.device.php"; | 
|---|
| 88 | break;} | 
|---|
| 89 | }else{href="./principal/imagenes.php"; | 
|---|
| 90 | break;} | 
|---|
| 91 | case 4: | 
|---|
| 92 | if (device!="0"){ | 
|---|
| 93 | href="./principal/hardwares.device.php"; | 
|---|
| 94 | break;} | 
|---|
| 95 | else{href="./principal/hardwares.php"; | 
|---|
| 96 | break;} | 
|---|
| 97 | case 5: | 
|---|
| 98 | if (device!="0"){ | 
|---|
| 99 | href="./principal/softwares.device.php"; | 
|---|
| 100 | break;} | 
|---|
| 101 | else{href="./principal/softwares.php"; | 
|---|
| 102 | break;} | 
|---|
| 103 | case 6: | 
|---|
| 104 | if (device!="0"){ | 
|---|
| 105 | href="./principal/repositorios.device.php"; | 
|---|
| 106 | break;} | 
|---|
| 107 | else{href="./principal/repositorios.php"; | 
|---|
| 108 | break;} | 
|---|
| 109 | case 7: | 
|---|
| 110 | if (device!="0"){ | 
|---|
| 111 | href="./principal/menus.device.php"; | 
|---|
| 112 | break;} | 
|---|
| 113 | else{href="./principal/menus.php"; | 
|---|
| 114 | break;} | 
|---|
| 115 | case 8: | 
|---|
| 116 | href="./principal/reservas.php"; | 
|---|
| 117 | break; | 
|---|
| 118 | case 9: | 
|---|
| 119 | if (device!="0"){ | 
|---|
| 120 | href="./principal/administracion.device.php"; | 
|---|
| 121 | break;} | 
|---|
| 122 | else{href="./principal/administracion.php"; | 
|---|
| 123 | break;} | 
|---|
| 124 | case 10: | 
|---|
| 125 | href="./images/L_Iconos.php"; | 
|---|
| 126 | href2="./images/M_Iconos.php"; | 
|---|
| 127 | break; | 
|---|
| 128 | case 11: | 
|---|
| 129 | if (device!="0"){ | 
|---|
| 130 | href="./principal/administracion.device.php"; | 
|---|
| 131 | href2="./principal/boot_grub4dos.php"; | 
|---|
| 132 | break;} | 
|---|
| 133 | else{href="./principal/administracion.php"; | 
|---|
| 134 | href2="./principal/boot_grub4dos.php"; | 
|---|
| 135 | break;} | 
|---|
| 136 | case 13: | 
|---|
| 137 | href="./principal/usuarios.php"; | 
|---|
| 138 | break; | 
|---|
| 139 | case 14: | 
|---|
| 140 | href="./principal/aulas.php"; | 
|---|
| 141 | href2="./varios/buscar.php"; | 
|---|
| 142 | break; | 
|---|
| 143 | } | 
|---|
| 144 | var oldOp=currentOp; | 
|---|
| 145 | currentOp=o; | 
|---|
| 146 | if (oldOp) desresaltar(oldOp); | 
|---|
| 147 | currentOp.style.borderBottomColor="#ffffff"; | 
|---|
| 148 | currentOp.style.borderRightColor="#ffffff"; | 
|---|
| 149 | currentOp.style.borderTopColor="#808080"; | 
|---|
| 150 | currentOp.style.borderLeftColor="#808080"; | 
|---|
| 151 | if(op<20){ | 
|---|
| 152 | opadre.frames["frame_arbol"].document.location.href=href; | 
|---|
| 153 | opadre.frames["frame_contenidos"].document.location.href=href2 | 
|---|
| 154 | } | 
|---|
| 155 | else{ | 
|---|
| 156 | switch(op){ | 
|---|
| 157 | case 21: | 
|---|
| 158 | window.top.location.href="acceso.php"; | 
|---|
| 159 | break; | 
|---|
| 160 | case 22: | 
|---|
| 161 | opadre.frames["frame_contenidos"].document.location.href=href5; | 
|---|
| 162 | break; | 
|---|
| 163 | } | 
|---|
| 164 | } | 
|---|
| 165 | } | 
|---|
| 166 | //________________________________________________________________________________________________________ | 
|---|
| 167 | </SCRIPT> | 
|---|
| 168 | </HEAD> | 
|---|
| 169 | <BODY style="background-color: #d4d0c8;"> | 
|---|
| 170 | <FORM name=fdatos> | 
|---|
| 171 | <TABLE border=0 width=100% style="POSITION:absolute;LEFT:0px;TOP:0px" cellPadding=2 cellSpacing=0> | 
|---|
| 172 | <TR> | 
|---|
| 173 | <TD align=left> | 
|---|
| 174 | <TABLE  class=menupral align=left cellPadding=1 cellSpacing=0 > | 
|---|
| 175 | <TR valign=baseline> | 
|---|
| 176 | <TD width=10><IMG src="./images/iconos/pomo.gif"></TD> | 
|---|
| 177 | <?php if($idtipousuario!=$SUPERADMINISTRADOR){?> | 
|---|
| 178 | <TD onclick=eleccion(this,1); onmouseout=desresaltar(this); onmouseover=resaltar(this)> | 
|---|
| 179 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/centros.gif"> <SPAN class="menupral"><?php echo $TbMsg[0]?></SPAN></A> </TD> | 
|---|
| 180 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 181 | <TD onclick=eleccion(this,2); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 182 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/acciones.gif"> <SPAN class=menupral ><?php echo $TbMsg[1]?></SPAN></A> </TD> | 
|---|
| 183 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 184 | <TD onclick=eleccion(this,3); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 185 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/imagenes.gif"> <SPAN class=menupral ><?php echo $TbMsg[2]?></SPAN></A> </TD> | 
|---|
| 186 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 187 | <TD onclick=eleccion(this,4); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 188 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/confihard.gif"> <SPAN class=menupral ><?php echo  $TbMsg[3] ?></SPAN></A> </TD> | 
|---|
| 189 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 190 | <TD onclick=eleccion(this,5); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 191 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/confisoft.gif"> <SPAN class=menupral ><?php echo  $TbMsg[4] ?></SPAN></A> </TD> | 
|---|
| 192 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 193 | <TD onclick=eleccion(this,6); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 194 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/repositorio.gif"> <SPAN class=menupral ><?php echo  $TbMsg[5] ?></SPAN></A> </TD> | 
|---|
| 195 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 196 | <TD onclick=eleccion(this,7); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 197 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/menus.gif"> <SPAN class=menupral ><?php echo  $TbMsg[6] ?></SPAN></A> </TD> | 
|---|
| 198 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 199 | <td onclick="eleccion(this,14)" onmouseout="desresaltar(this)" onmouseover="resaltar(this)" align="middle"> | 
|---|
| 200 |  <a href="#" style="text-decoration: none"><img border="0" src="./images/iconos/busquedas.gif"> <span class="menupral"><?php echo  $TbMsg[14] ?></span></a> </td> | 
|---|
| 201 | <td width="4" align="middle"><img src="./images/iconos/separitem.gif"></td> | 
|---|
| 202 |  | 
|---|
| 203 | <!--TD  onclick=eleccion(this,8) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle> | 
|---|
| 204 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/reservas.gif"> <SPAN class=menupral ><?php echo  $TbMsg[7] ?></SPAN></A> </TD> | 
|---|
| 205 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD--> | 
|---|
| 206 |  | 
|---|
| 207 | <?php } | 
|---|
| 208 | else{ | 
|---|
| 209 | if($idtipousuario==$SUPERADMINISTRADOR){?> | 
|---|
| 210 | <TD onclick=eleccion(this,9); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle>  | 
|---|
| 211 | <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/administracion.gif"> | 
|---|
| 212 | <SPAN class=menupral ><?php echo  $TbMsg[8] ?></SPAN></A> </TD> | 
|---|
| 213 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 214 |  | 
|---|
| 215 | <TD onclick=eleccion(this,10); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle>  | 
|---|
| 216 | <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/iconos.gif"> | 
|---|
| 217 | <SPAN class=menupral ><?php echo  $TbMsg[9] ?></SPAN></A> </TD> | 
|---|
| 218 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 219 |  | 
|---|
| 220 | <TD onclick=eleccion(this,11); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle>  | 
|---|
| 221 | <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/tablas.gif"> | 
|---|
| 222 | <SPAN class=menupral ><?php echo  $TbMsg[15] ?></SPAN></A> </TD> | 
|---|
| 223 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 224 |  | 
|---|
| 225 |  | 
|---|
| 226 |  | 
|---|
| 227 | <?php }?> | 
|---|
| 228 | <?php }?> | 
|---|
| 229 |  | 
|---|
| 230 | <TD onclick=eleccion(this,22); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 231 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/ayuda.gif"> <SPAN class=menupral ><?php echo  $TbMsg[11] ?></SPAN></A> </TD> | 
|---|
| 232 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 233 |  | 
|---|
| 234 | <TD onclick=eleccion(this,21); onmouseout=desresaltar(this); onmouseover=resaltar(this); align=middle> | 
|---|
| 235 |  <A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/usuarioslog.gif"> <SPAN class=menupral ><?php echo  $TbMsg[10] ?></SPAN></A> </TD> | 
|---|
| 236 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 237 |  | 
|---|
| 238 |  | 
|---|
| 239 | <?php if($idtipousuario!=$SUPERADMINISTRADOR){ ?> | 
|---|
| 240 | <TD> | 
|---|
| 241 | <?php | 
|---|
| 242 | $usuarioactual=$_SESSION["wusuario"]; | 
|---|
| 243 | $cmd->texto="SELECT * FROM centros | 
|---|
| 244 | INNER JOIN administradores_centros ON administradores_centros.idcentro=centros.idcentro | 
|---|
| 245 | INNER JOIN usuarios ON usuarios.idusuario=administradores_centros.idusuario | 
|---|
| 246 | WHERE usuarios.usuario='".$usuarioactual."' | 
|---|
| 247 | AND centros.identidad=".$_SESSION["widentidad"]; | 
|---|
| 248 | $rs=new Recordset; | 
|---|
| 249 | $rs->Comando=&$cmd; | 
|---|
| 250 | if (!$rs->Abrir()) return(true); // Error al abrir recordset | 
|---|
| 251 | $rs->Primero(); | 
|---|
| 252 | while (!$rs->EOF){ | 
|---|
| 253 | $identidad=$rs->campos["identidad"]; | 
|---|
| 254 | $idcentro=$rs->campos["idcentro"]; | 
|---|
| 255 | $nombrecentro=$rs->campos["nombrecentro"]; | 
|---|
| 256 | $numidcentro[]=$idcentro;$numnombrecentro[]=$nombrecentro; | 
|---|
| 257 | $rs->Siguiente(); | 
|---|
| 258 | }//Cierre | 
|---|
| 259 | $rs->Cerrar(); | 
|---|
| 260 | echo '<form></form>'; | 
|---|
| 261 | if (count($numidcentro) > 1) | 
|---|
| 262 | { | 
|---|
| 263 | ?> | 
|---|
| 264 | <form name="fcentros" action="frames.php" target="_parent" method="POST"> | 
|---|
| 265 | <select name="idmicentro" id="idmicentro" > | 
|---|
| 266 | <option value=""> -- <?php echo $_SESSION["wnombrecentro"] ;?> -- </option> | 
|---|
| 267 | <?php | 
|---|
| 268 | for ($i=0;$i<count($numidcentro);$i++) | 
|---|
| 269 | { | 
|---|
| 270 | if ($_SESSION["wnombrecentro"] == $numnombrecentro[$i]) | 
|---|
| 271 | {}else{ | 
|---|
| 272 | echo '<option value="'.$numidcentro[$i].','.$numnombrecentro[$i].'"># - '.$numnombrecentro[$i].'</option>'; | 
|---|
| 273 | } | 
|---|
| 274 | } | 
|---|
| 275 | ?> | 
|---|
| 276 |  | 
|---|
| 277 | </select> | 
|---|
| 278 | <TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 279 | <TD width=4 align=middle><input name="submit" type="submit" value="Cambiar"></TD> | 
|---|
| 280 |  | 
|---|
| 281 | </form> | 
|---|
| 282 | <TD width=0 align=middle><IMG src="./images/iconos/separitem.gif"></TD> | 
|---|
| 283 | <TD><?php echo "Usuario.:.".ucwords($_SESSION["wusuario"]); ?></TD> | 
|---|
| 284 |  | 
|---|
| 285 | <?php } }?> | 
|---|
| 286 |  | 
|---|
| 287 | </TR> | 
|---|
| 288 | </TABLE> | 
|---|
| 289 | </TR> | 
|---|
| 290 | </TABLE> | 
|---|
| 291 | </FORM> | 
|---|
| 292 | </BODY> | 
|---|
| 293 | </HTML> | 
|---|