[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"); |
---|
| 14 | include_once("../clases/AdoPhp.php"); |
---|
| 15 | include_once("../idiomas/php/".$idioma."/propiedades_perfilhardwares_".$idioma.".php"); |
---|
| 16 | //________________________________________________________________________________________________________ |
---|
| 17 | $opcion=0; |
---|
| 18 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 19 | //________________________________________________________________________________________________________ |
---|
| 20 | $idperfilhard=0; |
---|
| 21 | $descripcion=""; |
---|
| 22 | $comentarios=""; |
---|
| 23 | $grupoid=0; |
---|
| 24 | $ordenadores=0; // Número de ordenador que tienen este perfil |
---|
| 25 | |
---|
| 26 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 27 | if (isset($_GET["idperfilhard"])) $idperfilhard=$_GET["idperfilhard"]; |
---|
| 28 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 29 | if (isset($_GET["identificador"])) $idperfilhard=$_GET["identificador"]; |
---|
| 30 | //________________________________________________________________________________________________________ |
---|
| 31 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 32 | if (!$cmd) |
---|
| 33 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 34 | if ($opcion!=$op_alta){ |
---|
| 35 | $resul=TomaPropiedades($cmd,$idperfilhard); |
---|
| 36 | if (!$resul) |
---|
| 37 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
| 38 | } |
---|
| 39 | //________________________________________________________________________________________________________ |
---|
| 40 | ?> |
---|
| 41 | <HTML> |
---|
| 42 | <TITLE>Administración web de aulas</TITLE> |
---|
| 43 | <HEAD> |
---|
| 44 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 45 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 46 | <SCRIPT language="javascript" src="../jscripts/propiedades_perfilhardwares.js"></SCRIPT> |
---|
| 47 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
| 48 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_perfilhardwares_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 49 | </HEAD> |
---|
| 50 | <BODY> |
---|
| 51 | <DIV align=center> |
---|
| 52 | <FORM name="fdatos" action="../gestores/gestor_perfilhardwares.php" method="post"> |
---|
| 53 | <INPUT type=hidden name=opcion value=<?=$opcion?>> |
---|
| 54 | <INPUT type=hidden name=idperfilhard value=<?=$idperfilhard?>> |
---|
| 55 | <INPUT type=hidden name=ordenadores value=<?=$ordenadores?>> |
---|
| 56 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> |
---|
| 57 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> |
---|
| 58 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> |
---|
| 59 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos > |
---|
| 60 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 61 | <TR> |
---|
| 62 | <TH align=center> <?echo $TbMsg[5]?> </TD> |
---|
| 63 | <?if ($opcion==$op_eliminacion) |
---|
| 64 | echo '<TD style="width:215">'.$descripcion.'</TD>'; |
---|
| 65 | else |
---|
| 66 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:215" type=text value="'.$descripcion.'"></TD>';?> |
---|
| 67 | <TD align=left rowspan=2><IMG border=3 style="border-color:#63676b" src="../images/aula.jpg"><br><center> Ordenadores: <? echo $ordenadores?></center></TD> |
---|
| 68 | </TR> |
---|
| 69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 70 | <TR> |
---|
| 71 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
| 72 | <?if ($opcion==$op_eliminacion) |
---|
| 73 | echo '<TD>'.$comentarios.'</TD>'; |
---|
| 74 | else |
---|
| 75 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=40>'.$comentarios.'</TEXTAREA></TD>'; |
---|
| 76 | ?> |
---|
| 77 | </TR> |
---|
| 78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 79 | </TABLE> |
---|
| 80 | </FORM> |
---|
| 81 | </DIV> |
---|
| 82 | <? |
---|
| 83 | //________________________________________________________________________________________________________ |
---|
| 84 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 85 | //________________________________________________________________________________________________________ |
---|
| 86 | ?> |
---|
| 87 | </BODY> |
---|
| 88 | </HTML> |
---|
| 89 | <? |
---|
| 90 | //________________________________________________________________________________________________________ |
---|
| 91 | // Recupera los datos de un perfil hardware |
---|
| 92 | // Parametros: |
---|
| 93 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 94 | // - id: El identificador del perfil hardware |
---|
| 95 | //________________________________________________________________________________________________________ |
---|
| 96 | function TomaPropiedades($cmd,$id) |
---|
| 97 | { |
---|
| 98 | global $descripcion; |
---|
| 99 | global $comentarios; |
---|
| 100 | global $ordenadores; |
---|
| 101 | $rs=new Recordset; |
---|
| 102 | $cmd->texto="SELECT perfileshard.*, count(*) as numordenadores FROM perfileshard |
---|
| 103 | INNER JOIN ordenadores ON ordenadores.idperfilhard=perfileshard.idperfilhard |
---|
| 104 | WHERE perfileshard.idperfilhard=".$id; |
---|
| 105 | $rs->Comando=&$cmd; |
---|
| 106 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 107 | $rs->Primero(); |
---|
| 108 | if (!$rs->EOF){ |
---|
| 109 | $descripcion=$rs->campos["descripcion"]; |
---|
| 110 | $comentarios=$rs->campos["comentarios"]; |
---|
| 111 | $ordenadores=$rs->campos["numordenadores"]; |
---|
| 112 | } |
---|
| 113 | $rs->Cerrar(); |
---|
| 114 | return(true); |
---|
| 115 | } |
---|
| 116 | ?> |
---|