[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_componentehardwares.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de un componente 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("../includes/TomaDato.php"); |
---|
| 15 | include_once("../includes/HTMLSELECT.php"); |
---|
| 16 | include_once("../clases/AdoPhp.php"); |
---|
| 17 | include_once("../idiomas/php/".$idioma."/propiedades_componentehardwares_".$idioma.".php"); |
---|
| 18 | //________________________________________________________________________________________________________ |
---|
| 19 | $opcion=0; |
---|
| 20 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 21 | //________________________________________________________________________________________________________ |
---|
| 22 | $idhardware=0; |
---|
| 23 | $descripcion=""; |
---|
| 24 | $idtipohardware=0; |
---|
| 25 | $grupoid=0; |
---|
| 26 | |
---|
| 27 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 28 | if (isset($_GET["idhardware"])) $idhardware=$_GET["idhardware"]; |
---|
| 29 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 30 | if (isset($_GET["identificador"])) $idhardware=$_GET["identificador"]; |
---|
| 31 | //________________________________________________________________________________________________________ |
---|
| 32 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 33 | if (!$cmd) |
---|
| 34 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D. |
---|
| 35 | if ($opcion!=$op_alta){ |
---|
| 36 | $resul=TomaPropiedades($cmd,$idhardware); |
---|
| 37 | if (!$resul) |
---|
| 38 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci� de datos. |
---|
| 39 | } |
---|
| 40 | //________________________________________________________________________________________________________ |
---|
| 41 | ?> |
---|
| 42 | <HTML> |
---|
| 43 | <HEAD> |
---|
[b0d5fb32] | 44 | <TITLE>Administración web de aulas</TITLE> |
---|
[3ec149c] | 45 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 46 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 47 | <SCRIPT language="javascript" src="../jscripts/propiedades_componentehardwares.js"></SCRIPT> |
---|
| 48 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
[043e67d] | 49 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_componentehardwares_'.$idioma.'.js"></SCRIPT>'?> |
---|
[3ec149c] | 50 | </HEAD> |
---|
| 51 | <BODY> |
---|
[b0d5fb32] | 52 | <div align="center"> |
---|
| 53 | <FORM name="fdatos" action="../gestores/gestor_componentehardwares.php" method="post"> |
---|
[043e67d] | 54 | <INPUT type=hidden name=opcion value="<?php echo $opcion?>"> |
---|
[b0d5fb32] | 55 | <INPUT type=hidden name=idhardware value="<?php echo $idhardware?>"> |
---|
| 56 | <INPUT type=hidden name=grupoid value="<?php echo $grupoid?>"> |
---|
| 57 | <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR> |
---|
| 58 | <SPAN class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> |
---|
[3ec149c] | 59 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
| 60 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 61 | <TR> |
---|
[b0d5fb32] | 62 | <TH align=center> <?php echo $TbMsg[5]?> </TH> |
---|
[043e67d] | 63 | <?php if ($opcion==$op_eliminacion) |
---|
[b0d5fb32] | 64 | echo '<TD style="width:215px">'.$descripcion.'</TD>'; |
---|
[3ec149c] | 65 | else |
---|
[b0d5fb32] | 66 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:250px" type=text value="'.$descripcion.'"></TD>';?> |
---|
[3ec149c] | 67 | </TR> |
---|
| 68 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 69 | <TR> |
---|
[b0d5fb32] | 70 | <TH align=center> <?php echo $TbMsg[6]?> </TH> |
---|
[043e67d] | 71 | <?php |
---|
[3ec149c] | 72 | if ($opcion==$op_eliminacion) |
---|
| 73 | echo '<TD>'.TomaDato($cmd,0,'tipohardwares',$idtipohardware,'idtipohardware','descripcion').'</TD>'; |
---|
| 74 | else |
---|
| 75 | echo '<TD>'.HTMLSELECT($cmd,0,'tipohardwares',$idtipohardware,'idtipohardware','descripcion',250).'</TD>'; |
---|
| 76 | ?> |
---|
| 77 | </TR> |
---|
| 78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 79 | </TABLE> |
---|
| 80 | </FORM> |
---|
[b0d5fb32] | 81 | </div> |
---|
[043e67d] | 82 | <?php |
---|
[3ec149c] | 83 | //________________________________________________________________________________________________________ |
---|
| 84 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 85 | //________________________________________________________________________________________________________ |
---|
| 86 | ?> |
---|
| 87 | </BODY> |
---|
| 88 | </HTML> |
---|
[043e67d] | 89 | <?php |
---|
[3ec149c] | 90 | //________________________________________________________________________________________________________ |
---|
| 91 | // Recupera los datos de un componente hardware |
---|
| 92 | // Parametros: |
---|
| 93 | // - cmd: Una comando ya operativo (con conexiónabierta) |
---|
| 94 | // - id: El identificador del componente hardware |
---|
| 95 | //________________________________________________________________________________________________________ |
---|
| 96 | function TomaPropiedades($cmd,$id){ |
---|
| 97 | global $descripcion; |
---|
| 98 | global $idtipohardware; |
---|
| 99 | $rs=new Recordset; |
---|
| 100 | $cmd->texto="SELECT * FROM hardwares WHERE idhardware=".$id; |
---|
| 101 | $rs->Comando=&$cmd; |
---|
| 102 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 103 | $rs->Primero(); |
---|
| 104 | if (!$rs->EOF){ |
---|
| 105 | $descripcion=$rs->campos["descripcion"]; |
---|
| 106 | $idtipohardware=$rs->campos["idtipohardware"]; |
---|
| 107 | $rs->Cerrar(); |
---|
| 108 | return(true); |
---|
| 109 | } |
---|
| 110 | else |
---|
| 111 | return(false); |
---|
| 112 | } |
---|