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