[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_perfilhardwares.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de un pefil hardware para insertar,modificar y eliminar |
---|
| 10 | // ************************************************************************************************************************************************* |
---|
| 11 | include_once("../includes/ctrlacc.php"); |
---|
| 12 | include_once("../includes/opciones.php"); |
---|
| 13 | include_once("../includes/CreaComando.php"); |
---|
[b2bd768] | 14 | include_once("../includes/HTMLCTESELECT.php"); |
---|
[3ec149c] | 15 | include_once("../clases/AdoPhp.php"); |
---|
| 16 | include_once("../idiomas/php/".$idioma."/propiedades_perfilhardwares_".$idioma.".php"); |
---|
[ee457e9] | 17 | include_once("../idiomas/php/".$idioma."/avisos_".$idioma.".php"); |
---|
[3ec149c] | 18 | //________________________________________________________________________________________________________ |
---|
| 19 | $opcion=0; |
---|
| 20 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 21 | //________________________________________________________________________________________________________ |
---|
| 22 | $idperfilhard=0; |
---|
| 23 | $descripcion=""; |
---|
| 24 | $comentarios=""; |
---|
| 25 | $grupoid=0; |
---|
[70ed85d] | 26 | $ordenadores=0; // Número de ordenadores que tienen este perfil |
---|
[b2bd768] | 27 | $winboot="reboot"; // Método de arranque para Windows (por defecto, reboot). |
---|
[3ec149c] | 28 | |
---|
| 29 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 30 | if (isset($_GET["idperfilhard"])) $idperfilhard=$_GET["idperfilhard"]; |
---|
| 31 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 32 | if (isset($_GET["identificador"])) $idperfilhard=$_GET["identificador"]; |
---|
| 33 | //________________________________________________________________________________________________________ |
---|
| 34 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 35 | if (!$cmd) |
---|
| 36 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 37 | if ($opcion!=$op_alta){ |
---|
| 38 | $resul=TomaPropiedades($cmd,$idperfilhard); |
---|
| 39 | if (!$resul) |
---|
| 40 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
| 41 | } |
---|
| 42 | //________________________________________________________________________________________________________ |
---|
| 43 | ?> |
---|
[b2bd768] | 44 | <html> |
---|
| 45 | <title>Administración web de aulas</title> |
---|
| 46 | <head> |
---|
| 47 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
---|
| 48 | <link rel="stylesheet" type="text/css" href="../estilos.css" /> |
---|
| 49 | <script language="javascript" src="../jscripts/propiedades_perfilhardwares.js"></script> |
---|
| 50 | <script language="javascript" src="../jscripts/opciones.js"></script> |
---|
| 51 | <?php echo '<script language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_perfilhardwares_'.$idioma.'.js"></script>'?> |
---|
| 52 | </head> |
---|
| 53 | <body> |
---|
| 54 | <div align="center"> |
---|
| 55 | <form name="fdatos" action="../gestores/gestor_perfilhardwares.php" method="post"> |
---|
| 56 | <input type="hidden" name="opcion" value="<?=$opcion?>" /> |
---|
| 57 | <input type="hidden" name="idperfilhard" value="<?=$idperfilhard?>" /> |
---|
| 58 | <input type="hidden" name="ordenadores" value="<?=$ordenadores?>" /> |
---|
| 59 | <input type="hidden" name="grupoid" value="<?=$grupoid?>" /> |
---|
| 60 | <p align="center" class="cabeceras"><?echo $TbMsg["HARD_TITLE"]?><br /> |
---|
| 61 | <span align="center" class="subcabeceras"><? echo $opciones[$opcion]?></span></p> |
---|
| 62 | <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos"> |
---|
[3ec149c] | 63 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[b2bd768] | 64 | <tr> |
---|
[c31a439] | 65 | <th align="center"> <?echo $TbMsg["HARD_NAME"]?> </th> |
---|
[b2bd768] | 66 | <?php if ($opcion==$op_eliminacion) |
---|
| 67 | echo '<td style="width:215">'.$descripcion.'</td>'; |
---|
[3ec149c] | 68 | else |
---|
[b2bd768] | 69 | echo '<td><input class="formulariodatos" name="descripcion" style="width:215" type="text" value="'.$descripcion.'" /></td>'; ?> |
---|
| 70 | <td align="left" rowspan="3"><img border="3" style="border-color:#63676b" src="../images/aula.jpg" /><br /> <?php echo $TbMsg["HARD_COMPUTERS"].": $ordenadores"?></td> |
---|
| 71 | </tr> |
---|
[3ec149c] | 72 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[b2bd768] | 73 | <tr> |
---|
[c31a439] | 74 | <th align="center"> <?php echo $TbMsg["HARD_COMMENTS"]?> </th> |
---|
| 75 | <?php if ($opcion==$op_eliminacion) |
---|
[b2bd768] | 76 | echo '<td>'.$comentarios.'</td>'; |
---|
[3ec149c] | 77 | else |
---|
[b2bd768] | 78 | echo '<td><textarea class="formulariodatos" name="comentarios" rows="3" cols="40">'.$comentarios.'</textarea></td>'; |
---|
| 79 | ?> |
---|
| 80 | </tr> |
---|
| 81 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 82 | <tr> |
---|
[c31a439] | 83 | <th align="center"> <?php echo $TbMsg["HARD_WINBOOT"]?> <sup>*</sup> </th> |
---|
| 84 | <?php if ($opcion==$op_eliminacion) |
---|
[b2bd768] | 85 | echo "<td>$winboot</td>"; |
---|
| 86 | else { |
---|
| 87 | $params = "reboot=".$TbMsg["HARD_REBOOT"].chr(13); |
---|
| 88 | $params.= "kexec=".$TbMsg["HARD_KEXEC"]; |
---|
[c31a439] | 89 | echo "<td>".HTMLCTESELECT($params,"winboot","estilodesple","","$winboot",110)."</td>"; |
---|
[b2bd768] | 90 | } |
---|
[3ec149c] | 91 | ?> |
---|
[b2bd768] | 92 | </tr> |
---|
[3ec149c] | 93 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[b2bd768] | 94 | </table> |
---|
| 95 | </form> |
---|
| 96 | </div> |
---|
[3ec149c] | 97 | <? |
---|
| 98 | //________________________________________________________________________________________________________ |
---|
| 99 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 100 | //________________________________________________________________________________________________________ |
---|
| 101 | ?> |
---|
[b2bd768] | 102 | </body> |
---|
| 103 | </html> |
---|
[3ec149c] | 104 | <? |
---|
| 105 | //________________________________________________________________________________________________________ |
---|
| 106 | // Recupera los datos de un perfil hardware |
---|
| 107 | // Parametros: |
---|
| 108 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 109 | // - id: El identificador del perfil hardware |
---|
| 110 | //________________________________________________________________________________________________________ |
---|
| 111 | function TomaPropiedades($cmd,$id) |
---|
| 112 | { |
---|
| 113 | global $descripcion; |
---|
| 114 | global $comentarios; |
---|
| 115 | global $ordenadores; |
---|
[b2bd768] | 116 | global $winboot; |
---|
[3ec149c] | 117 | $rs=new Recordset; |
---|
[b2bd768] | 118 | $cmd->texto="SELECT perfileshard.*, COUNT(*) AS numordenadores |
---|
| 119 | FROM perfileshard |
---|
| 120 | INNER JOIN ordenadores ON ordenadores.idperfilhard=perfileshard.idperfilhard |
---|
| 121 | WHERE perfileshard.idperfilhard=".$id; |
---|
[3ec149c] | 122 | $rs->Comando=&$cmd; |
---|
| 123 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 124 | $rs->Primero(); |
---|
| 125 | if (!$rs->EOF){ |
---|
| 126 | $descripcion=$rs->campos["descripcion"]; |
---|
| 127 | $comentarios=$rs->campos["comentarios"]; |
---|
| 128 | $ordenadores=$rs->campos["numordenadores"]; |
---|
[b2bd768] | 129 | $winboot=$rs->campos["winboot"]; |
---|
[3ec149c] | 130 | } |
---|
| 131 | $rs->Cerrar(); |
---|
| 132 | return(true); |
---|
| 133 | } |
---|
| 134 | ?> |
---|