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: Marzo-2006 |
---|
7 | // Nombre del fichero: propiedades_grupos.php |
---|
8 | // Descripción : |
---|
9 | // Presenta el formulario de captura de datos de un grupo 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/constantes.php"); |
---|
16 | include_once("../idiomas/php/".$idioma."/propiedades_grupos_".$idioma.".php"); |
---|
17 | //________________________________________________________________________________________________________ |
---|
18 | $opcion=0; |
---|
19 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
20 | //________________________________________________________________________________________________________ |
---|
21 | $nombregrupo=""; |
---|
22 | $comentarios=""; |
---|
23 | $grupoid=0; |
---|
24 | $idgrupo=0; |
---|
25 | $tipo=0; |
---|
26 | $literaltipo=""; |
---|
27 | $iduniversidad=0; |
---|
28 | $idaula=0; |
---|
29 | |
---|
30 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
31 | if (isset($_GET["idgrupo"])) $idgrupo=$_GET["idgrupo"]; |
---|
32 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
33 | if (isset($_GET["tipo"])) $tipo=$_GET["tipo"]; |
---|
34 | if (isset($_GET["literaltipo"])) $literaltipo=$_GET["literaltipo"]; |
---|
35 | if (isset($_GET["iduniversidad"])) $iduniversidad=$_GET["iduniversidad"]; |
---|
36 | if (isset($_GET["idaula"])) $idaula=$_GET["idaula"]; |
---|
37 | |
---|
38 | if (isset($_GET["identificador"])) $idgrupo=$_GET["identificador"]; |
---|
39 | //________________________________________________________________________________________________________ |
---|
40 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
41 | if (!$cmd) |
---|
42 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
43 | if ($opcion!=$op_alta){ |
---|
44 | $resul=TomaPropiedades($cmd,$idgrupo); |
---|
45 | if (!$resul) |
---|
46 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
47 | } |
---|
48 | switch($literaltipo){ |
---|
49 | case $LITAMBITO_CENTROS : |
---|
50 | $urlimg='../images/iconos/carpeta.gif'; |
---|
51 | $textambito=$TbMsg[7]; |
---|
52 | break; |
---|
53 | case $LITAMBITO_GRUPOSAULAS : |
---|
54 | $urlimg='../images/iconos/carpeta.gif'; |
---|
55 | $textambito=$TbMsg[7]; |
---|
56 | break; |
---|
57 | case $LITAMBITO_GRUPOSORDENADORES: |
---|
58 | $urlimg='../images/iconos/carpeta.gif'; |
---|
59 | $textambito=$TbMsg[22]; |
---|
60 | break; |
---|
61 | case $LITAMBITO_GRUPOSTAREAS : |
---|
62 | $urlimg='../images/iconos/carpeta.gif'; |
---|
63 | $textambito=$TbMsg[9]; |
---|
64 | break; |
---|
65 | case $LITAMBITO_GRUPOSPROCEDIMIENTOS : |
---|
66 | $urlimg='../images/iconos/carpeta.gif'; |
---|
67 | $textambito=$TbMsg[8]; |
---|
68 | break; |
---|
69 | case $LITAMBITO_GRUPOSTRABAJOS : |
---|
70 | $urlimg='../images/iconos/carpeta.gif'; |
---|
71 | $textambito=$TbMsg[10]; |
---|
72 | break; |
---|
73 | case $LITAMBITO_GRUPOSIMAGENES : |
---|
74 | $urlimg='../images/iconos/carpeta.gif'; |
---|
75 | $textambito=$TbMsg[11]; |
---|
76 | break; |
---|
77 | case $LITAMBITO_GRUPOSCOMPONENTESHARD : |
---|
78 | $urlimg='../images/iconos/carpeta.gif'; |
---|
79 | $textambito=$TbMsg[12]; |
---|
80 | break; |
---|
81 | case $LITAMBITO_GRUPOSCOMPONENTESSOFT : |
---|
82 | $urlimg='../images/iconos/confisoft.gif'; |
---|
83 | $textambito=$TbMsg[13]; |
---|
84 | break; |
---|
85 | case $LITAMBITO_GRUPOSPERFILESHARD : |
---|
86 | $urlimg='../images/iconos/carpeta.gif'; |
---|
87 | $textambito=$TbMsg[14]; |
---|
88 | break; |
---|
89 | case $LITAMBITO_GRUPOSPERFILESSOFT : |
---|
90 | $urlimg='../images/iconos/carpeta.gif'; |
---|
91 | $textambito=$TbMsg[15]; |
---|
92 | break; |
---|
93 | case $LITAMBITO_GRUPOSSOFTINCREMENTAL : |
---|
94 | $urlimg='../images/iconos/softcombi.gif'; |
---|
95 | $textambito=$TbMsg[16]; |
---|
96 | break; |
---|
97 | case $LITAMBITO_GRUPOSSERVIDORESREMBO : |
---|
98 | $urlimg='../images/iconos/carpeta.gif'; |
---|
99 | $textambito=$TbMsg[17]; |
---|
100 | break; |
---|
101 | case $LITAMBITO_GRUPOSSERVIDORESDHCP : |
---|
102 | $urlimg='../images/iconos/carpeta.gif'; |
---|
103 | $textambito=$TbMsg[18]; |
---|
104 | break; |
---|
105 | case $LITAMBITO_GRUPOSMENUS : |
---|
106 | $urlimg='../images/iconos/carpeta.gif'; |
---|
107 | $textambito=$TbMsg[19]; |
---|
108 | break; |
---|
109 | case $LITAMBITO_GRUPOSRESERVAS : |
---|
110 | $urlimg='../images/iconos/carpeta.gif'; |
---|
111 | $textambito=$TbMsg[20]; |
---|
112 | break; |
---|
113 | case $LITAMBITO_GRUPOSENTIDADES : |
---|
114 | $urlimg='../images/iconos/carpeta.gif'; |
---|
115 | $textambito=$TbMsg[21]; |
---|
116 | break; |
---|
117 | default: |
---|
118 | $resul=false; |
---|
119 | } |
---|
120 | //________________________________________________________________________________________________________ |
---|
121 | ?> |
---|
122 | <HTML> |
---|
123 | <TITLE>Administración web de aulas</TITLE> |
---|
124 | <HEAD> |
---|
125 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
126 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
127 | <SCRIPT language="javascript" src="../jscripts/propiedades_grupos.js"></SCRIPT> |
---|
128 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
129 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
130 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_grupos_'.$idioma.'.js"></SCRIPT>'?> |
---|
131 | </HEAD> |
---|
132 | <BODY> |
---|
133 | <DIV align=center> |
---|
134 | <FORM name="fdatos" action="" method=post> |
---|
135 | <INPUT type=hidden name=opcion value=<?=$opcion?>> |
---|
136 | <INPUT type=hidden name=idgrupo value=<?=$idgrupo?>> |
---|
137 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> |
---|
138 | <INPUT type=hidden name=tipo value=<?=$tipo?>> |
---|
139 | <INPUT type=hidden name=literaltipo value="<?=$literaltipo?>"> |
---|
140 | <INPUT type=hidden name=iduniversidad value=<?=$iduniversidad?>> |
---|
141 | <INPUT type=hidden name=idaula value=<?=$idaula?>> |
---|
142 | <P align=center class=cabeceras><IMG src="<? echo $urlimg?>"> <?echo $textambito?><BR> |
---|
143 | <SPAN align=center class=subcabeceras><? echo $opciones[$opcion]?></SPAN></P> |
---|
144 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos > |
---|
145 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
146 | <TR> |
---|
147 | <TH align=center> <?echo $TbMsg[5]?> </TD> |
---|
148 | <?if ($opcion==$op_eliminacion) |
---|
149 | echo '<TD style="width:300">'.$nombregrupo.'</TD>'; |
---|
150 | else |
---|
151 | echo '<TD><INPUT class="formulariodatos" name=nombregrupo style="width:320" type=text value="'.$nombregrupo.'"></TD>';?> |
---|
152 | </TR> |
---|
153 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
154 | <TR> |
---|
155 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
156 | <?if ($opcion==$op_eliminacion) |
---|
157 | echo '<TD>'.$comentarios.'</TD>'; |
---|
158 | else |
---|
159 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=60>'.$comentarios.'</TEXTAREA></TD>'; |
---|
160 | ?> |
---|
161 | </TR> |
---|
162 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
163 | </TABLE> |
---|
164 | </FORM> |
---|
165 | <? |
---|
166 | //________________________________________________________________________________________________________ |
---|
167 | include_once("../includes/opcionesbotonesop.php"); |
---|
168 | //________________________________________________________________________________________________________ |
---|
169 | ?> |
---|
170 | </BODY> |
---|
171 | </HTML> |
---|
172 | <? |
---|
173 | //________________________________________________________________________________________________________ |
---|
174 | // Recupera los datos de una grupo |
---|
175 | // Parametros: |
---|
176 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
177 | // - id: El identificador de la grupo |
---|
178 | //________________________________________________________________________________________________________ |
---|
179 | function TomaPropiedades($cmd,$id){ |
---|
180 | global $nombregrupo; |
---|
181 | global $comentarios; |
---|
182 | global $literaltipo; |
---|
183 | global $LITAMBITO_GRUPOSORDENADORES; |
---|
184 | |
---|
185 | $rs=new Recordset; |
---|
186 | if($literaltipo==$LITAMBITO_GRUPOSORDENADORES) |
---|
187 | $cmd->texto="SELECT * FROM gruposordenadores WHERE idgrupo=".$id; |
---|
188 | else |
---|
189 | $cmd->texto="SELECT * FROM grupos WHERE idgrupo=".$id; |
---|
190 | $rs->Comando=&$cmd; |
---|
191 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
192 | $rs->Primero(); |
---|
193 | if (!$rs->EOF){ |
---|
194 | if($literaltipo==$LITAMBITO_GRUPOSORDENADORES) |
---|
195 | $nombregrupo=$rs->campos["nombregrupoordenador"]; |
---|
196 | else |
---|
197 | $nombregrupo=$rs->campos["nombregrupo"]; |
---|
198 | $comentarios=$rs->campos["comentarios"]; |
---|
199 | $rs->Cerrar(); |
---|
200 | return(true); |
---|
201 | } |
---|
202 | else |
---|
203 | return(false); |
---|
204 | } |
---|
205 | ?> |
---|