[043e67d] | 1 | <?php |
---|
[3ec149c] | 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 |
---|
[0bf5390] | 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 |
---|
[3ec149c] | 13 | // ************************************************************************************************************************************************* |
---|
| 14 | include_once("../includes/ctrlacc.php"); |
---|
| 15 | include_once("../includes/opciones.php"); |
---|
| 16 | include_once("../includes/CreaComando.php"); |
---|
[b2bd768] | 17 | include_once("../includes/HTMLCTESELECT.php"); |
---|
[3ec149c] | 18 | include_once("../clases/AdoPhp.php"); |
---|
| 19 | include_once("../idiomas/php/".$idioma."/propiedades_perfilhardwares_".$idioma.".php"); |
---|
[ee457e9] | 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 | $idperfilhard=0; |
---|
| 26 | $descripcion=""; |
---|
| 27 | $comentarios=""; |
---|
| 28 | $grupoid=0; |
---|
[70ed85d] | 29 | $ordenadores=0; // Número de ordenadores que tienen este perfil |
---|
[b2bd768] | 30 | $winboot="reboot"; // Método de arranque para Windows (por defecto, reboot). |
---|
[3ec149c] | 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 | ?> |
---|
[b2bd768] | 47 | <html> |
---|
| 48 | <head> |
---|
[b0d5fb32] | 49 | <title>Administración web de aulas</title> |
---|
[b2bd768] | 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"> |
---|
[043e67d] | 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?>" /> |
---|
[0bf5390] | 63 | <input type="hidden" name="winboot" value="reboot" /> |
---|
[043e67d] | 64 | <p align="center" class="cabeceras"><?php echo $TbMsg["HARD_TITLE"]?><br /> |
---|
[b0d5fb32] | 65 | <span class="subcabeceras"><?php echo $opciones[$opcion]?></span></p> |
---|
[b2bd768] | 66 | <table align="center" border="0" cellPadding="1" cellSpacing="1" class="tabla_datos"> |
---|
[3ec149c] | 67 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[b2bd768] | 68 | <tr> |
---|
[043e67d] | 69 | <th align="center"> <?php echo $TbMsg["HARD_NAME"]?> </th> |
---|
[b2bd768] | 70 | <?php if ($opcion==$op_eliminacion) |
---|
[b0d5fb32] | 71 | echo '<td style="width:215px">'.$descripcion.'</td>'; |
---|
[3ec149c] | 72 | else |
---|
[b0d5fb32] | 73 | echo '<td><input class="formulariodatos" name="descripcion" style="width:215px" type="text" value="'.$descripcion.'" /></td>'; ?> |
---|
| 74 | <td align="left" rowspan="3"><img border="3" style="border-color:#63676b" src="../images/aula.jpg" alt="*" /><br /> <?php echo $TbMsg["HARD_COMPUTERS"].": $ordenadores"?></td> |
---|
[b2bd768] | 75 | </tr> |
---|
[3ec149c] | 76 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[b2bd768] | 77 | <tr> |
---|
[c31a439] | 78 | <th align="center"> <?php echo $TbMsg["HARD_COMMENTS"]?> </th> |
---|
| 79 | <?php if ($opcion==$op_eliminacion) |
---|
[b2bd768] | 80 | echo '<td>'.$comentarios.'</td>'; |
---|
[3ec149c] | 81 | else |
---|
[b2bd768] | 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> |
---|
[043e67d] | 89 | <?php |
---|
[3ec149c] | 90 | //________________________________________________________________________________________________________ |
---|
| 91 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 92 | //________________________________________________________________________________________________________ |
---|
| 93 | ?> |
---|
[b2bd768] | 94 | </body> |
---|
| 95 | </html> |
---|
[043e67d] | 96 | <?php |
---|
[3ec149c] | 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; |
---|
[b2bd768] | 108 | global $winboot; |
---|
[3ec149c] | 109 | $rs=new Recordset; |
---|
[b2bd768] | 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; |
---|
[3ec149c] | 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"]; |
---|
[b2bd768] | 121 | $winboot=$rs->campos["winboot"]; |
---|
[3ec149c] | 122 | } |
---|
| 123 | $rs->Cerrar(); |
---|
| 124 | return(true); |
---|
| 125 | } |
---|
[b0d5fb32] | 126 | |
---|