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