| [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: Noviembre-2005 | 
|---|
|  | 7 | // Nombre del fichero: propiedades_universidades.php | 
|---|
|  | 8 | // Descripción : | 
|---|
|  | 9 | //               Presenta el formulario de captura de datos de una universidad  para insertar,modificar | 
|---|
|  | 10 | // ************************************************************************************************************************************************* | 
|---|
|  | 11 | include_once("../includes/ctrlacc.php"); | 
|---|
|  | 12 | include_once("../includes/opciones.php"); | 
|---|
|  | 13 | include_once("../includes/constantes.php"); | 
|---|
|  | 14 | include_once("../includes/CreaComando.php"); | 
|---|
|  | 15 | include_once("../includes/TomaDato.php"); | 
|---|
|  | 16 | include_once("../includes/HTMLSELECT.php"); | 
|---|
|  | 17 | include_once("../clases/AdoPhp.php"); | 
|---|
|  | 18 | include_once("../idiomas/php/".$idioma."/propiedades_universidades_".$idioma.".php"); | 
|---|
|  | 19 | //________________________________________________________________________________________________________ | 
|---|
|  | 20 | $opcion=0; | 
|---|
|  | 21 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); | 
|---|
|  | 22 | //________________________________________________________________________________________________________ | 
|---|
|  | 23 | $iduniversidad=0; | 
|---|
|  | 24 | $nombreuniversidad=""; | 
|---|
|  | 25 | $comentarios=""; | 
|---|
|  | 26 |  | 
|---|
|  | 27 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros | 
|---|
|  | 28 | if (isset($_GET["iduniversidad"])) $iduniversidad=$_GET["iduniversidad"]; | 
|---|
|  | 29 | if (isset($_GET["identificador"])) $iduniversidad=$_GET["identificador"]; | 
|---|
|  | 30 | //________________________________________________________________________________________________________ | 
|---|
|  | 31 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando | 
|---|
|  | 32 | if (!$cmd) | 
|---|
|  | 33 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. | 
|---|
|  | 34 | if  ($opcion!=$op_alta){ | 
|---|
|  | 35 | $resul=TomaPropiedades($cmd,$iduniversidad); | 
|---|
|  | 36 | if (!$resul) | 
|---|
|  | 37 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. | 
|---|
|  | 38 | } | 
|---|
|  | 39 | else | 
|---|
|  | 40 | $urlicono="../images/universidad.jpg"; | 
|---|
|  | 41 | //________________________________________________________________________________________________________ | 
|---|
|  | 42 | ?> | 
|---|
|  | 43 | <HTML> | 
|---|
|  | 44 | <TITLE>Administración web de universidades</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_universidades.js"></SCRIPT> | 
|---|
|  | 49 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> | 
|---|
|  | 50 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_universidades_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
|  | 51 | </HEAD> | 
|---|
|  | 52 | <BODY> | 
|---|
|  | 53 | <DIV  align=center> | 
|---|
|  | 54 | <FORM  name="fdatos" action="../gestores/gestor_universidades.php" method="post"> | 
|---|
|  | 55 | <INPUT type=hidden name=opcion value=<?=$opcion?>> | 
|---|
|  | 56 | <INPUT type=hidden name=iduniversidad value=<?=$iduniversidad?>> | 
|---|
|  | 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> | 
|---|
|  | 62 | <TH align=center ><?echo $TbMsg[5]?> </TD> | 
|---|
|  | 63 | <?echo '<TD colspan=3><INPUT  class="formulariodatos" name=nombreuniversidad style="width:350" type=text value="'.$nombreuniversidad.'"></TD>';?> | 
|---|
|  | 64 | </TR> | 
|---|
|  | 65 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
|  | 66 | <TR> | 
|---|
|  | 67 | <TH align=center> <?echo $TbMsg[6]?> </TD> | 
|---|
|  | 68 | <?if ($opcion==$op_eliminacion) | 
|---|
|  | 69 | echo '<TD>'.$comentarios.'</TD>'; | 
|---|
|  | 70 | else | 
|---|
|  | 71 | echo '<TD><TEXTAREA   class="formulariodatos" name=comentarios rows=3 cols=66>'.$comentarios.'</TEXTAREA></TD>'; | 
|---|
|  | 72 | ?> | 
|---|
|  | 73 | </TR> | 
|---|
|  | 74 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> | 
|---|
|  | 75 | </TABLE> | 
|---|
|  | 76 | </FORM> | 
|---|
|  | 77 | </DIV> | 
|---|
|  | 78 | <? | 
|---|
|  | 79 | //________________________________________________________________________________________________________ | 
|---|
|  | 80 | include_once("../includes/opcionesbotonesop.php"); | 
|---|
|  | 81 | //________________________________________________________________________________________________________ | 
|---|
|  | 82 | ?> | 
|---|
|  | 83 | </BODY> | 
|---|
|  | 84 | </HTML> | 
|---|
|  | 85 | <? | 
|---|
|  | 86 | //________________________________________________________________________________________________________ | 
|---|
|  | 87 | //      Recupera los datos de un universidad | 
|---|
|  | 88 | //              Parametros: | 
|---|
|  | 89 | //              - cmd: Una comando ya operativo (con conexión abierta) | 
|---|
|  | 90 | //              - id: El identificador de la universidad | 
|---|
|  | 91 | //________________________________________________________________________________________________________ | 
|---|
|  | 92 | function TomaPropiedades($cmd,$id){ | 
|---|
|  | 93 | global $iduniversidad; | 
|---|
|  | 94 | global $nombreuniversidad; | 
|---|
|  | 95 | global $comentarios; | 
|---|
|  | 96 | $id=1; | 
|---|
|  | 97 | $rs=new Recordset; | 
|---|
|  | 98 | $cmd->texto="SELECT * FROM universidades WHERE iduniversidad=".$id; | 
|---|
|  | 99 | $rs->Comando=&$cmd; | 
|---|
|  | 100 | if (!$rs->Abrir()) return(false); // Error al abrir recordset | 
|---|
|  | 101 | $rs->Primero(); | 
|---|
|  | 102 | if (!$rs->EOF){ | 
|---|
|  | 103 | $nombreuniversidad=$rs->campos["nombreuniversidad"]; | 
|---|
|  | 104 | $comentarios=$rs->campos["comentarios"]; | 
|---|
|  | 105 | } | 
|---|
|  | 106 | $rs->Cerrar(); | 
|---|
|  | 107 | return(true); | 
|---|
|  | 108 | } | 
|---|
|  | 109 | ?> | 
|---|