[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_centros.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de un centro 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_centros_".$idioma.".php"); |
---|
| 18 | //________________________________________________________________________________________________________ |
---|
| 19 | $opcion=0; |
---|
| 20 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 21 | //________________________________________________________________________________________________________ |
---|
| 22 | $idcentro=0; |
---|
| 23 | $nombrecentro=""; |
---|
| 24 | $identidad=0; |
---|
| 25 | $grupoid=0; |
---|
| 26 | $comentarios=""; |
---|
| 27 | |
---|
| 28 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 29 | if (isset($_GET["idcentro"])) $idcentro=$_GET["idcentro"]; |
---|
| 30 | if (isset($_GET["identidad"])) $identidad=$_GET["identidad"]; |
---|
| 31 | if (isset($_GET["identificador"])) $idcentro=$_GET["identificador"]; |
---|
| 32 | |
---|
| 33 | //________________________________________________________________________________________________________ |
---|
| 34 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 35 | if (!$cmd) |
---|
| 36 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 37 | if ($opcion!=$op_alta){ |
---|
| 38 | $resul=TomaPropiedades($cmd,$idcentro); |
---|
| 39 | if (!$resul) |
---|
| 40 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
| 41 | } |
---|
| 42 | //________________________________________________________________________________________________________ |
---|
| 43 | ?> |
---|
| 44 | <HTML> |
---|
| 45 | <TITLE>Administración web de aulas</TITLE> |
---|
| 46 | <HEAD> |
---|
| 47 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 48 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 49 | <SCRIPT language="javascript" src="../jscripts/propiedades_centros.js"></SCRIPT> |
---|
| 50 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
| 51 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_centros_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 52 | </HEAD> |
---|
| 53 | <BODY> |
---|
| 54 | <FORM name="fdatos" action="../gestores/gestor_centros.php" method="post"> |
---|
| 55 | <INPUT type=hidden name=opcion value="<? echo $opcion?>"> |
---|
| 56 | <INPUT type=hidden name=idcentro value=<?=$idcentro?>> |
---|
| 57 | <INPUT type=hidden name=identidad value=<?=$identidad?>> |
---|
| 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> <?echo $TbMsg[5]?> </TH> |
---|
| 64 | <?if ($opcion==$op_eliminacion){?> |
---|
| 65 | <TD><?echo $nombrecentro?></TD> |
---|
| 66 | <?}else{?> |
---|
| 67 | <TD><INPUT type=text class=cajatexto name="nombrecentro" style="width:350" value="<? echo $nombrecentro?>"> |
---|
| 68 | <?}?> |
---|
| 69 | </TR> |
---|
| 70 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 71 | <TR> |
---|
| 72 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
| 73 | <?if ($opcion==$op_eliminacion) |
---|
| 74 | echo '<TD>'.$comentarios.'</TD>'; |
---|
| 75 | else |
---|
| 76 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=66>'.$comentarios.'</TEXTAREA></TD>'; |
---|
| 77 | ?> |
---|
| 78 | </TR> |
---|
| 79 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 80 | </TABLE> |
---|
| 81 | </FORM> |
---|
| 82 | </DIV> |
---|
| 83 | <? |
---|
| 84 | //________________________________________________________________________________________________________ |
---|
| 85 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 86 | //________________________________________________________________________________________________________ |
---|
| 87 | ?> |
---|
| 88 | </BODY> |
---|
| 89 | </HTML> |
---|
| 90 | <? |
---|
| 91 | //________________________________________________________________________________________________________ |
---|
| 92 | // Recupera los datos de un centro |
---|
| 93 | // Parametros: |
---|
| 94 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 95 | // - id: El identificador del centro |
---|
| 96 | //________________________________________________________________________________________________________ |
---|
| 97 | function TomaPropiedades($cmd,$id){ |
---|
| 98 | global $nombrecentro; |
---|
| 99 | global $comentarios; |
---|
| 100 | |
---|
| 101 | $rs=new Recordset; |
---|
| 102 | $cmd->texto="SELECT * FROM centros WHERE idcentro=".$id; |
---|
| 103 | $rs->Comando=&$cmd; |
---|
| 104 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 105 | $rs->Primero(); |
---|
| 106 | if (!$rs->EOF){ |
---|
| 107 | $nombrecentro=$rs->campos["nombrecentro"]; |
---|
| 108 | $comentarios=$rs->campos["comentarios"]; |
---|
| 109 | $rs->Cerrar(); |
---|
| 110 | return(true); |
---|
| 111 | } |
---|
| 112 | else |
---|
| 113 | return(false); |
---|
| 114 | } |
---|
| 115 | ?> |
---|