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