| 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_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 | <TITLE>Administración web de aulas</TITLE> | 
|---|
| 44 | <HEAD> | 
|---|
| 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> | 
|---|
| 50 |         <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_tipohardwares_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 51 | </HEAD> | 
|---|
| 52 | <BODY> | 
|---|
| 53 | <DIV  align=center> | 
|---|
| 54 | <FORM  name="fdatos" action="../gestores/gestor_tipohardwares.php" method="post">  | 
|---|
| 55 |         <INPUT type=hidden name=opcion value=<?=$opcion?>> | 
|---|
| 56 |         <INPUT type=hidden name=idtipohardware value=<?=$idtipohardware?>> | 
|---|
| 57 |         <INPUT type=hidden name=grupoid value=<?=$grupoid?>> | 
|---|
| 58 |         <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> | 
|---|
| 59 |         <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> | 
|---|
| 60 |         <TABLE  align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos > | 
|---|
| 61 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 62 |         <TR> | 
|---|
| 63 |                         <TH align=center> <?echo $TbMsg[5]?> </TD> | 
|---|
| 64 |                         <?if ($opcion==$op_eliminacion) | 
|---|
| 65 |                                         echo '<TD style="width:300">'.$descripcion.'</TD>'; | 
|---|
| 66 |                                 else | 
|---|
| 67 |                                         echo '<TD><INPUT  class="formulariodatos" name=descripcion style="width:300" type=text value="'.$descripcion.'"></TD>';?> | 
|---|
| 68 |                 </TR> | 
|---|
| 69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 70 |                 <TR> | 
|---|
| 71 |                         <TH align=center> <?echo $TbMsg[6]?> </TD> | 
|---|
| 72 |                         <? | 
|---|
| 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 |                 </TR> | 
|---|
| 80 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
| 81 |         </TABLE> | 
|---|
| 82 | </FORM> | 
|---|
| 83 | <? | 
|---|
| 84 | //________________________________________________________________________________________________________ | 
|---|
| 85 | include_once("../includes/opcionesbotonesop.php"); | 
|---|
| 86 | //________________________________________________________________________________________________________ | 
|---|
| 87 | ?> | 
|---|
| 88 | </BODY> | 
|---|
| 89 | </HTML> | 
|---|
| 90 | <? | 
|---|
| 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 | } | 
|---|
| 114 | ?> | 
|---|