[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_componentesoftwares.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de un componente software 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_componentesoftwares_".$idioma.".php"); |
---|
| 18 | //________________________________________________________________________________________________________ |
---|
| 19 | $opcion=0; |
---|
| 20 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 21 | //________________________________________________________________________________________________________ |
---|
| 22 | $idsoftware=0; |
---|
| 23 | $descripcion=""; |
---|
| 24 | $idtiposoftware=0; |
---|
| 25 | $idtiposo=0; |
---|
| 26 | $grupoid=0; |
---|
| 27 | |
---|
| 28 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 29 | if (isset($_GET["idsoftware"])) $idsoftware=$_GET["idsoftware"]; |
---|
| 30 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 31 | if (isset($_GET["identificador"])) $idsoftware=$_GET["identificador"]; |
---|
| 32 | //________________________________________________________________________________________________________ |
---|
| 33 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 34 | if (!$cmd) |
---|
| 35 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D. |
---|
| 36 | if ($opcion!=$op_alta){ |
---|
| 37 | $resul=TomaPropiedades($cmd,$idsoftware); |
---|
| 38 | if (!$resul) |
---|
| 39 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci� de datos. |
---|
| 40 | } |
---|
| 41 | //________________________________________________________________________________________________________ |
---|
| 42 | ?> |
---|
| 43 | <HTML> |
---|
| 44 | <TITLE>Administración web de aulas</TITLE> |
---|
| 45 | <HEAD> |
---|
| 46 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 47 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 48 | <SCRIPT language="javascript" src="../jscripts/propiedades_componentesoftwares.js"></SCRIPT> |
---|
| 49 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
| 50 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_componentesoftwares_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 51 | </HEAD> |
---|
| 52 | <BODY> |
---|
| 53 | <FORM name="fdatos" action="../gestores/gestor_componentesoftwares.php" method="post"> |
---|
| 54 | <INPUT type=hidden name=opcion value="<? echo $opcion?>"> |
---|
| 55 | <INPUT type=hidden name=idsoftware value=<?=$idsoftware?>> |
---|
| 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 width="100px" style="display:block"> |
---|
| 62 | <TH width="100px" align=center> <?echo $TbMsg[5]?> </TH> |
---|
| 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:250" type=text value="'.$descripcion.'"></TD>';?> |
---|
| 67 | </TR> |
---|
| 68 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 69 | <TR width="100px" style="display:block" > |
---|
| 70 | <TH width="100px" align=center> <?echo $TbMsg[6]?> </TH> |
---|
| 71 | <? |
---|
| 72 | if ($opcion==$op_eliminacion) |
---|
| 73 | echo '<TD>'.TomaDato($cmd,0,'tiposoftwares',$idtiposoftware,'idtiposoftware','descripcion').'</TD>'; |
---|
| 74 | else |
---|
| 75 | echo '<TD>'.HTMLSELECT($cmd,0,'tiposoftwares',$idtiposoftware,'idtiposoftware','descripcion',250,"seleccion").'</TD>'; |
---|
| 76 | ?> |
---|
| 77 | </TR> |
---|
| 78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 79 | <?if($idtiposoftware!=1) |
---|
| 80 | echo '<TR width="100px" id="tridtiposo" style="display:none">'; |
---|
| 81 | else |
---|
| 82 | echo '<TR width="100px" id="tridtiposo" style="display:block">'; |
---|
| 83 | ?> |
---|
| 84 | <TH width="100px" align=center> <?echo $TbMsg[7]?> </TH> |
---|
| 85 | <? |
---|
| 86 | if ($opcion==$op_eliminacion) |
---|
| 87 | echo '<TD>'.TomaDato($cmd,0,'tiposos',$idtiposo,'idtiposo','descripcion').'</TD>'; |
---|
| 88 | else |
---|
| 89 | echo '<TD>'.HTMLSELECT($cmd,0,'tiposos',$idtiposo,'idtiposo','descripcion',250).'</TD>'; |
---|
| 90 | ?> |
---|
| 91 | </TR> |
---|
| 92 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 93 | </TABLE> |
---|
| 94 | </FORM> |
---|
| 95 | </DIV> |
---|
| 96 | <? |
---|
| 97 | //________________________________________________________________________________________________________ |
---|
| 98 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 99 | //________________________________________________________________________________________________________ |
---|
| 100 | ?> |
---|
| 101 | </BODY> |
---|
| 102 | </HTML> |
---|
| 103 | <? |
---|
| 104 | //________________________________________________________________________________________________________ |
---|
| 105 | // Recupera los datos de un componente software |
---|
| 106 | // Parametros: |
---|
| 107 | // - cmd: Una comando ya operativo (con conexiónabierta) |
---|
| 108 | // - id: El identificador del componente software |
---|
| 109 | //________________________________________________________________________________________________________ |
---|
| 110 | function TomaPropiedades($cmd,$id){ |
---|
| 111 | global $descripcion; |
---|
| 112 | global $idtiposoftware; |
---|
| 113 | global $idtiposo; |
---|
| 114 | $rs=new Recordset; |
---|
| 115 | $cmd->texto="SELECT * FROM softwares WHERE idsoftware=".$id; |
---|
| 116 | $rs->Comando=&$cmd; |
---|
| 117 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 118 | $rs->Primero(); |
---|
| 119 | if (!$rs->EOF){ |
---|
| 120 | $descripcion=$rs->campos["descripcion"]; |
---|
| 121 | $idtiposoftware=$rs->campos["idtiposoftware"]; |
---|
| 122 | $idtiposo=$rs->campos["idtiposo"]; |
---|
| 123 | $rs->Cerrar(); |
---|
| 124 | return(true); |
---|
| 125 | } |
---|
| 126 | else |
---|
| 127 | return(false); |
---|
| 128 | } |
---|
| 129 | ?> |
---|