[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_entidades.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de una entidad para insertar,modificar y eliminar |
---|
[0c86fb7] | 10 | /** |
---|
| 11 | * @file propiedades_entidades.php |
---|
| 12 | * @version 1.1.0 - Se incluye la unidad organizativa como parametro del kernel: ogunit=directorio_unidad (ticket #678) |
---|
| 13 | * @author Irina Gómez - ETSII Universidad de Sevilla |
---|
| 14 | * @date 2015-12-16 |
---|
| 15 | */ |
---|
[3ec149c] | 16 | // ************************************************************************************************************************************************* |
---|
| 17 | include_once("../includes/ctrlacc.php"); |
---|
| 18 | include_once("../includes/opciones.php"); |
---|
| 19 | include_once("../includes/CreaComando.php"); |
---|
| 20 | include_once("../includes/TomaDato.php"); |
---|
| 21 | include_once("../includes/HTMLSELECT.php"); |
---|
| 22 | include_once("../clases/AdoPhp.php"); |
---|
| 23 | include_once("../idiomas/php/".$idioma."/propiedades_entidades_".$idioma.".php"); |
---|
| 24 | //________________________________________________________________________________________________________ |
---|
| 25 | $opcion=0; |
---|
| 26 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 27 | //________________________________________________________________________________________________________ |
---|
| 28 | $identidad=0; |
---|
| 29 | $nombreentidad=""; |
---|
| 30 | $iduniversidad=0; |
---|
| 31 | $grupoid=0; |
---|
| 32 | $comentarios=""; |
---|
[0c86fb7] | 33 | $ogunit=0; |
---|
[3ec149c] | 34 | |
---|
| 35 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 36 | if (isset($_GET["identidad"])) $identidad=$_GET["identidad"]; |
---|
| 37 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 38 | if (isset($_GET["iduniversidad"])) $iduniversidad=$_GET["iduniversidad"]; |
---|
| 39 | if (isset($_GET["identificador"])) $identidad=$_GET["identificador"]; |
---|
| 40 | |
---|
| 41 | //________________________________________________________________________________________________________ |
---|
| 42 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 43 | if (!$cmd) |
---|
| 44 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 45 | if ($opcion!=$op_alta){ |
---|
| 46 | $resul=TomaPropiedades($cmd,$identidad); |
---|
| 47 | if (!$resul) |
---|
| 48 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
| 49 | } |
---|
| 50 | //________________________________________________________________________________________________________ |
---|
| 51 | ?> |
---|
| 52 | <HTML> |
---|
| 53 | <HEAD> |
---|
[0c86fb7] | 54 | <TITLE>Administración web de aulas</TITLE> |
---|
[3ec149c] | 55 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 56 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 57 | <SCRIPT language="javascript" src="../jscripts/propiedades_entidades.js"></SCRIPT> |
---|
| 58 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
[0c86fb7] | 59 | <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT> |
---|
[3ec149c] | 60 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_entidades_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 61 | </HEAD> |
---|
| 62 | <BODY> |
---|
| 63 | <FORM name="fdatos" action="../gestores/gestor_entidades.php" method="post"> |
---|
| 64 | <INPUT type=hidden name=opcion value=<?=$opcion?>> |
---|
| 65 | <INPUT type=hidden name=identidad value=<?=$identidad?>> |
---|
| 66 | <INPUT type=hidden name=iduniversidad value=<?=$iduniversidad?>> |
---|
| 67 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> |
---|
| 68 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> |
---|
| 69 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> |
---|
| 70 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
| 71 | <!--------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 72 | <TR> |
---|
| 73 | <TH> <?echo $TbMsg[5]?> </TH> |
---|
| 74 | <?if ($opcion==$op_eliminacion){?> |
---|
| 75 | <TD><?echo $nombreentidad?></TD> |
---|
| 76 | <?}else{?> |
---|
| 77 | <TD><INPUT type=text class=cajatexto name="nombreentidad" style="width:350" value="<? echo $nombreentidad?>"> |
---|
| 78 | <?}?> |
---|
| 79 | </TR> |
---|
| 80 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 81 | <TR> |
---|
| 82 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
| 83 | <?if ($opcion==$op_eliminacion) |
---|
| 84 | echo '<TD>'.$comentarios.'</TD>'; |
---|
| 85 | else |
---|
| 86 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=66>'.$comentarios.'</TEXTAREA></TD>'; |
---|
| 87 | ?> |
---|
| 88 | </TR> |
---|
| 89 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[0c86fb7] | 90 | <? if ($opcion!=$op_eliminacion) { |
---|
| 91 | ($ogunit == 1) ? $checked = "checked" : $checked = ""; |
---|
| 92 | echo " <TR>\n". |
---|
| 93 | " <TH align=center> ".$TbMsg['OGUNIT']." </TD>\n". |
---|
[7cf3d39] | 94 | " <TD><input class='formulariodatos' name='ogunit' value='1' type='checkbox' $checked onchange='mensaje_ogunit()'> </TD>\n". |
---|
[0c86fb7] | 95 | " </TR>\n"; |
---|
| 96 | } |
---|
| 97 | ?> |
---|
| 98 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
[3ec149c] | 99 | </TABLE> |
---|
| 100 | </FORM> |
---|
| 101 | </DIV> |
---|
| 102 | <? |
---|
| 103 | //________________________________________________________________________________________________________ |
---|
| 104 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 105 | //________________________________________________________________________________________________________ |
---|
| 106 | ?> |
---|
| 107 | </BODY> |
---|
| 108 | </HTML> |
---|
| 109 | <? |
---|
| 110 | //________________________________________________________________________________________________________ |
---|
| 111 | // Recupera los datos de un entidad |
---|
| 112 | // Parametros: |
---|
| 113 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 114 | // - id: El identificador del entidad |
---|
| 115 | //________________________________________________________________________________________________________ |
---|
| 116 | function TomaPropiedades($cmd,$id){ |
---|
| 117 | global $nombreentidad; |
---|
| 118 | global $comentarios; |
---|
[0c86fb7] | 119 | global $ogunit; |
---|
[3ec149c] | 120 | |
---|
| 121 | $rs=new Recordset; |
---|
| 122 | $cmd->texto="SELECT * FROM entidades WHERE identidad=".$id; |
---|
| 123 | $rs->Comando=&$cmd; |
---|
| 124 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 125 | $rs->Primero(); |
---|
| 126 | if (!$rs->EOF){ |
---|
| 127 | $nombreentidad=$rs->campos["nombreentidad"]; |
---|
| 128 | $comentarios=$rs->campos["comentarios"]; |
---|
[0c86fb7] | 129 | $ogunit=$rs->campos["ogunit"]; |
---|
[3ec149c] | 130 | $rs->Cerrar(); |
---|
| 131 | return(true); |
---|
| 132 | } |
---|
| 133 | else |
---|
| 134 | return(false); |
---|
| 135 | } |
---|
| 136 | ?> |
---|