[3ec149c] | 1 | <? |
---|
| 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_ordenadores.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de un ordenador para insertar,modificar y eliminar |
---|
| 10 | // **************************************************************************************************** |
---|
| 11 | include_once("../includes/ctrlacc.php"); |
---|
| 12 | include_once("../includes/opciones.php"); |
---|
| 13 | include_once("../includes/constantes.php"); |
---|
| 14 | include_once("../includes/CreaComando.php"); |
---|
| 15 | include_once("../includes/TomaDato.php"); |
---|
| 16 | include_once("../includes/HTMLSELECT.php"); |
---|
[58d08a2] | 17 | include_once("../includes/HTMLCTESELECT.php"); |
---|
[3ec149c] | 18 | include_once("../clases/AdoPhp.php"); |
---|
| 19 | include_once("../idiomas/php/".$idioma."/propiedades_ordenadores_".$idioma.".php"); |
---|
[6459703] | 20 | include_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 | $idordenador=0; |
---|
| 26 | $nombreordenador=""; |
---|
| 27 | $ip=""; |
---|
| 28 | $mac=""; |
---|
| 29 | $idperfilhard=0; |
---|
| 30 | $idrepositorio=0; |
---|
| 31 | $idmenu=0; |
---|
| 32 | $idprocedimiento=0; |
---|
| 33 | $idaula=0; |
---|
| 34 | $cache=""; |
---|
| 35 | $grupoid=0; |
---|
[58d08a2] | 36 | ######################## ADV |
---|
| 37 | $netiface=""; |
---|
| 38 | $netdriver=""; |
---|
| 39 | ########################### ADV |
---|
[3ec149c] | 40 | |
---|
| 41 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 42 | if (isset($_GET["idordenador"])) $idordenador=$_GET["idordenador"]; |
---|
| 43 | if (isset($_GET["idaula"])) $idaula=$_GET["idaula"]; |
---|
| 44 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 45 | if (isset($_GET["identificador"])) $idordenador=$_GET["identificador"]; |
---|
| 46 | //________________________________________________________________________________________________________ |
---|
| 47 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 48 | if (!$cmd) |
---|
| 49 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 50 | if ($opcion!=$op_alta){ |
---|
| 51 | $resul=TomaPropiedades($cmd,$idordenador); |
---|
| 52 | if (!$resul) |
---|
| 53 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
| 54 | } |
---|
| 55 | //________________________________________________________________________________________________________ |
---|
| 56 | ?> |
---|
| 57 | <HTML> |
---|
| 58 | <TITLE>Administración web de aulas</TITLE> |
---|
| 59 | <HEAD> |
---|
| 60 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 61 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 62 | <SCRIPT language="javascript" src="../jscripts/propiedades_ordenadores.js"></SCRIPT> |
---|
| 63 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
| 64 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_ordenadores_'.$idioma.'.js"></SCRIPT>'?> |
---|
[5fb6914] | 65 | <script language=javascript> |
---|
| 66 | function abrir_ventana(URL){ |
---|
| 67 | window.open('../images/ver.php','Imagenes','scrollbars=yes,resizable=yes,width=950,height=640') |
---|
| 68 | } |
---|
| 69 | </script> |
---|
| 70 | |
---|
[3ec149c] | 71 | </HEAD> |
---|
| 72 | <BODY> |
---|
[5fb6914] | 73 | <FORM name="fdatos" action="../gestores/gestor_ordenadores.php" method="post" enctype="multipart/form-data"> |
---|
[3ec149c] | 74 | <INPUT type=hidden name=opcion value="<? echo $opcion?>"> |
---|
| 75 | <INPUT type=hidden name=idordenador value="<? echo $idordenador?>"> |
---|
| 76 | <INPUT type=hidden name=grupoid value="<? echo $grupoid?>"> |
---|
| 77 | <INPUT type=hidden name=idaula value="<? echo $idaula?>"> |
---|
| 78 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> |
---|
| 79 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> |
---|
| 80 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[c31a439] | 81 | <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos"> |
---|
[70ed85d] | 82 | <tr> |
---|
[c31a439] | 83 | <th align="center"> <?php echo $TbMsg[5]?> <sup>*</sup> </th> |
---|
[70ed85d] | 84 | <?php $fotomenu=$fotoordenador; |
---|
[3ec149c] | 85 | if ($opcion==$op_eliminacion) |
---|
| 86 | echo '<TD>'.$nombreordenador.'</TD>'; |
---|
| 87 | else |
---|
| 88 | echo '<TD><INPUT class="formulariodatos" name=nombreordenador type=text value="'.$nombreordenador.'"></TD>'; |
---|
| 89 | ?> |
---|
[70ed85d] | 90 | <td colspan="2" valign="top" align="left" rowspan="3"> |
---|
[6459703] | 91 | <img border="2" style="border-color:#63676b" src="<?php |
---|
[5fb6914] | 92 | if ($fotoordenador=="") |
---|
| 93 | { |
---|
| 94 | $fotoordenador="../images/fotos/fotoordenador.gif"; |
---|
| 95 | }else{ |
---|
| 96 | $fotoordenador="../images/fotos/".$fotoordenador; |
---|
| 97 | } |
---|
| 98 | echo $fotoordenador?>"> |
---|
[6459703] | 99 | <br />(150X110)-(jpg - gif) ---- <?php echo $TbMsg[5091]?> |
---|
| 100 | <br /> |
---|
[5fb6914] | 101 | <input name="archivo" type="file" id="archivo" size="16" /> |
---|
[6459703] | 102 | </td> |
---|
| 103 | </tr> |
---|
[3ec149c] | 104 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 105 | <TR> |
---|
[c31a439] | 106 | <th align="center"> <?php echo $TbMsg[6]?> <sup>*</sup> </th> |
---|
[70ed85d] | 107 | <?php |
---|
[3ec149c] | 108 | if ($opcion==$op_eliminacion) |
---|
| 109 | echo '<TD>'.$ip.'</TD>'; |
---|
| 110 | else |
---|
| 111 | echo '<TD><INPUT class="formulariodatos" name=ip type=text value="'.$ip.'"></TD>'; |
---|
| 112 | ?> |
---|
| 113 | </TR> |
---|
| 114 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 115 | <TR> |
---|
[c31a439] | 116 | <th align="center"> <?php echo $TbMsg[7]?> <sup>*</sup> </th> |
---|
[70ed85d] | 117 | <?php |
---|
[3ec149c] | 118 | if ($opcion==$op_eliminacion) |
---|
| 119 | echo '<TD>'.$mac.'</TD>'; |
---|
| 120 | else |
---|
| 121 | echo '<TD><INPUT class="formulariodatos" name=mac type=text value="'. $mac.'"></TD>'; |
---|
| 122 | ?> |
---|
| 123 | </TR> |
---|
[5fb6914] | 124 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 125 | <TR> |
---|
[c31a439] | 126 | <th align=center> <?echo $TbMsg[509]?> </th> |
---|
[5fb6914] | 127 | <? |
---|
| 128 | if ($opcion==$op_eliminacion) |
---|
| 129 | echo '<TD colspan=3>'.$fotoordenador.'</TD>'; |
---|
| 130 | else { |
---|
| 131 | if ($fotoordenador=="") |
---|
| 132 | $fotoordenador="../images/fotos/fotoordenador.gif"; |
---|
| 133 | $fotoordenador; |
---|
| 134 | |
---|
| 135 | ?> |
---|
| 136 | <TD colspan=3><SELECT class="formulariodatos" name="fotoordenador" > |
---|
| 137 | <?php if($fotomenu==""){ |
---|
| 138 | echo '<option value="fotoordenador.gif"></option>';}else{ |
---|
| 139 | echo '<option value="'.$fotomenu.'">'.$fotomenu.'</option>';} |
---|
| 140 | if ($handle = opendir("../images/fotos")) { |
---|
| 141 | while (false !== ($entry = readdir($handle))) { |
---|
| 142 | if ($entry != "." && $entry != "..") {?> |
---|
| 143 | |
---|
| 144 | <option value="<? echo $entry ?>"><? echo $entry ?></option> |
---|
| 145 | <?} |
---|
| 146 | } |
---|
| 147 | closedir($handle); |
---|
| 148 | } |
---|
| 149 | ?> |
---|
| 150 | </SELECT> |
---|
| 151 | <a href="javascript:abrir_ventana('../images/ver.php')" onClick="MM_openBrWindow('../images/ver.php','Imagenes','scrollbars=yes,resizable=yes,width=950,height=640')"><? echo $TbMsg[5092] ?></a> |
---|
| 152 | </TD> |
---|
| 153 | <? |
---|
| 154 | } |
---|
| 155 | ?> |
---|
| 156 | |
---|
| 157 | </TR> |
---|
[3ec149c] | 158 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 159 | <TR> |
---|
[c31a439] | 160 | <th align=center> <?echo $TbMsg[8]?> </th> |
---|
[3ec149c] | 161 | <? |
---|
| 162 | if ($opcion==$op_eliminacion) |
---|
| 163 | echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'perfileshard',$idperfilhard,'idperfilhard','descripcion').'</TD>'; |
---|
| 164 | else |
---|
| 165 | echo '<TD colspan=3>'.HTMLSELECT($cmd,$idcentro,'perfileshard',$idperfilhard,'idperfilhard','descripcion',250).'</TD>'; |
---|
| 166 | ?> |
---|
| 167 | </TR> |
---|
| 168 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 169 | <TR> |
---|
[c31a439] | 170 | <th align=center> <?echo $TbMsg[10]?> </th> |
---|
[3ec149c] | 171 | <? |
---|
| 172 | if ($opcion==$op_eliminacion) |
---|
| 173 | echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio').'</TD>'; |
---|
| 174 | else |
---|
| 175 | echo '<TD colspan=3>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',250).'</TD>'; |
---|
| 176 | ?> |
---|
| 177 | </TR> |
---|
| 178 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 179 | <TR> |
---|
[c31a439] | 180 | <th align=center> <?echo $TbMsg[11]?> </th> |
---|
[3ec149c] | 181 | <? |
---|
| 182 | if ($opcion==$op_eliminacion) |
---|
| 183 | echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'menus',$idmenu,'idmenu','descripcion').'</TD>'; |
---|
| 184 | else |
---|
| 185 | echo '<TD colspan=3>'.HTMLSELECT($cmd,$idcentro,'menus',$idmenu,'idmenu','descripcion',250).'</TD>'; |
---|
| 186 | ?> |
---|
| 187 | </TR> |
---|
| 188 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 189 | <TR> |
---|
[c31a439] | 190 | <th align=center> <?echo $TbMsg[9]?> </th> |
---|
[3ec149c] | 191 | <? |
---|
| 192 | if ($opcion==$op_eliminacion) |
---|
| 193 | echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'procedimientos',$idprocedimiento,'idprocedimiento','descripcion').' </TD>'; |
---|
| 194 | else |
---|
| 195 | echo '<TD colspan=3>'.HTMLSELECT($cmd,$idcentro,'procedimientos',$idprocedimiento,'idprocedimiento','descripcion',250).'</TD>'; |
---|
| 196 | ?> |
---|
| 197 | </TR> |
---|
| 198 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 199 | <TR> |
---|
[c31a439] | 200 | <th align=center> <?echo $TbMsg[12]?> </th> |
---|
[3ec149c] | 201 | <? |
---|
| 202 | if ($opcion==$op_eliminacion) |
---|
| 203 | echo '<TD colspan=3>'.$cache.'</TD>'; |
---|
| 204 | else |
---|
[b735f11c] | 205 | echo '<TD colspan=3><INPUT style="width=250" class="formulariodatos" name="cache" type="text" readonly value="'. $cache.'"></TD>'; |
---|
[3ec149c] | 206 | ?> |
---|
[58d08a2] | 207 | </TR> |
---|
[3ec149c] | 208 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[58d08a2] | 209 | <!-----ADV --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[aa337dc] | 210 | <tr> |
---|
| 211 | <th align=center > <?echo $TbMsg[13]?> </th> |
---|
[58d08a2] | 212 | <? |
---|
[aa337dc] | 213 | echo '<td colspan="3">'; |
---|
[58d08a2] | 214 | $iface="eth0=eth0".chr(13); |
---|
| 215 | $iface.="eth1=eth1".chr(13); |
---|
| 216 | $iface.="eth2=eth2"; |
---|
[aa337dc] | 217 | echo HTMLCTESELECT($iface,"netiface","estilodesple","",$netiface,100).'</td>'; |
---|
[58d08a2] | 218 | ?> |
---|
[aa337dc] | 219 | </tr> |
---|
[58d08a2] | 220 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 221 | |
---|
[aa337dc] | 222 | <tr> |
---|
[cb94611] | 223 | <th align="center"> <?echo $TbMsg[14]?> </th> |
---|
[58d08a2] | 224 | <? |
---|
[aa337dc] | 225 | echo '<td colspan="3">'; |
---|
[58d08a2] | 226 | $driver="generic=generic"; |
---|
[aa337dc] | 227 | echo HTMLCTESELECT($driver,"netdriver","estilodesple","",$netdriver,100).'</td>'; |
---|
[58d08a2] | 228 | ?> |
---|
[aa337dc] | 229 | </tr> |
---|
[58d08a2] | 230 | |
---|
| 231 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[70ed85d] | 232 | <tr> |
---|
[c31a439] | 233 | <th colspan="4" align="center"> <sup>*</sup> <?php echo $TbMsg["WARN_NETBOOT"]?> </th> |
---|
[70ed85d] | 234 | </tr> |
---|
[58d08a2] | 235 | |
---|
[c31a439] | 236 | </table> |
---|
[3ec149c] | 237 | </FORM> |
---|
| 238 | </DIV> |
---|
| 239 | <? |
---|
| 240 | //________________________________________________________________________________________________________ |
---|
| 241 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 242 | //________________________________________________________________________________________________________ |
---|
| 243 | ?> |
---|
| 244 | <BR> |
---|
| 245 | <? |
---|
| 246 | //________________________________________________________________________________________________________ |
---|
| 247 | // |
---|
| 248 | // Frame con la información de la configuración |
---|
| 249 | echo '<DIV align=center>'; |
---|
[4ee35bf] | 250 | echo '<IFRAME scrolling=auto height=500 width=90% frameborder=0 |
---|
[3ec149c] | 251 | src="../principal/configuraciones.php?swp=1&idambito='.$idordenador.'&ambito='.$AMBITO_ORDENADORES.'"></IFRAME>'; |
---|
| 252 | echo '</DIV>'; |
---|
| 253 | //________________________________________________________________________________________________________ |
---|
| 254 | ?> |
---|
| 255 | </BODY> |
---|
| 256 | </HTML> |
---|
| 257 | <? |
---|
| 258 | //________________________________________________________________________________________________________ |
---|
| 259 | // Recupera los datos de un ordenador |
---|
| 260 | // Parametros: |
---|
| 261 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 262 | // - id: El identificador del ordenador |
---|
| 263 | //________________________________________________________________________________________________________ |
---|
| 264 | function TomaPropiedades($cmd,$id){ |
---|
| 265 | global $idordenador; |
---|
| 266 | global $nombreordenador; |
---|
| 267 | global $ip; |
---|
| 268 | global $mac; |
---|
[5fb6914] | 269 | global $fotoordenador; |
---|
[3ec149c] | 270 | global $idperfilhard; |
---|
| 271 | global $idrepositorio; |
---|
| 272 | global $idmenu; |
---|
| 273 | global $idprocedimiento; |
---|
| 274 | global $cache; |
---|
[58d08a2] | 275 | global $netiface; |
---|
| 276 | global $netdriver; |
---|
[3ec149c] | 277 | $rs=new Recordset; |
---|
| 278 | $cmd->texto="SELECT * FROM ordenadores WHERE idordenador=".$id; |
---|
| 279 | $rs->Comando=&$cmd; |
---|
| 280 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 281 | $rs->Primero(); |
---|
| 282 | if (!$rs->EOF){ |
---|
| 283 | $nombreordenador=$rs->campos["nombreordenador"]; |
---|
| 284 | $ip=$rs->campos["ip"]; |
---|
| 285 | $mac=$rs->campos["mac"]; |
---|
| 286 | $idperfilhard=$rs->campos["idperfilhard"]; |
---|
| 287 | $idrepositorio=$rs->campos["idrepositorio"]; |
---|
| 288 | $idmenu=$rs->campos["idmenu"]; |
---|
| 289 | $idprocedimiento=$rs->campos["idproautoexec"]; |
---|
| 290 | $cache=$rs->campos["cache"]; |
---|
[58d08a2] | 291 | $netiface=$rs->campos["netiface"]; |
---|
[5fb6914] | 292 | $fotoordenador=$rs->campos["fotoord"]; //Creado para foto |
---|
[58d08a2] | 293 | $netdriver=$rs->campos["netdriver"]; |
---|
[3ec149c] | 294 | $rs->Cerrar(); |
---|
| 295 | return(true); |
---|
| 296 | } |
---|
| 297 | else |
---|
| 298 | return(false); |
---|
| 299 | } |
---|
| 300 | ?> |
---|