1 | <?php |
---|
2 | // ************************************************************************************************************************************************* |
---|
3 | // Aplicación WEB: ogAdmWebCon |
---|
4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
5 | |
---|
6 | // Fecha Creación: Año 2003-2004 |
---|
7 | // Fecha Última modificación: Noviembre-2005 |
---|
8 | // Nombre del fichero: programaciones.php |
---|
9 | // Descripción : |
---|
10 | // Gestiona la programación de tareas , trabajos y reservas |
---|
11 | // ************************************************************************************************************************************************* |
---|
12 | include_once("../includes/ctrlacc.php"); |
---|
13 | include_once("../clases/AdoPhp.php"); |
---|
14 | include_once("../includes/constantes.php"); |
---|
15 | include_once("../includes/comunes.php"); |
---|
16 | include_once("../includes/CreaComando.php"); |
---|
17 | include_once("../idiomas/php/".$idioma."/clases/Almanaque_".$idioma.".php"); |
---|
18 | include_once("../idiomas/php/".$idioma."/programaciones_".$idioma.".php"); |
---|
19 | //________________________________________________________________________________________________________ |
---|
20 | $idtarea=0; |
---|
21 | $idcomando=0; |
---|
22 | $sesion=0; |
---|
23 | $idreserva=0; |
---|
24 | $descripciontarea=""; |
---|
25 | $descripcioncomando=""; |
---|
26 | $descripcionreserva=""; |
---|
27 | $tipoaccion=""; |
---|
28 | $identificador=0; |
---|
29 | |
---|
30 | if (isset($_GET["idtarea"])) $idtarea=$_GET["idtarea"]; // Recoge parametros |
---|
31 | if (isset($_GET["idcomando"])) $idcomando=$_GET["idcomando"]; // Recoge parametros |
---|
32 | if (isset($_GET["sesion"])) $sesion=$_GET["sesion"]; // Recoge parametros |
---|
33 | if (isset($_GET["idreserva"])) $idreserva=$_GET["idreserva"]; // Recoge parametros |
---|
34 | if (isset($_GET["descripcioncomando"])) $descripcioncomando=$_GET["descripcioncomando"]; // Recoge parametros |
---|
35 | if (isset($_GET["descripciontarea"])) $descripciontarea=$_GET["descripciontarea"]; // Recoge parametros |
---|
36 | if (isset($_GET["descripcionreserva"])) $descripcionreserva=$_GET["descripcionreserva"]; // Recoge parametros |
---|
37 | if (isset($_GET["tipoaccion"])) $tipoaccion=$_GET["tipoaccion"]; // Recoge parametros |
---|
38 | |
---|
39 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
40 | if (!$cmd) |
---|
41 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
42 | //________________________________________________________________________________________________________ |
---|
43 | $rs=new Recordset; // Recupero acciones anidadas |
---|
44 | $rs->Comando=&$cmd; |
---|
45 | switch($tipoaccion){ |
---|
46 | case $EJECUCION_TAREA : |
---|
47 | $textoaccion=$LITEJECUCION_TAREA; |
---|
48 | $urlimg='../images/iconos/tareas.gif'; |
---|
49 | $identificador=$idtarea; |
---|
50 | $descripcion=$descripciontarea; |
---|
51 | $cmd->texto="SELECT * FROM programaciones WHERE identificador=".$identificador." AND tipoaccion=".$EJECUCION_TAREA; |
---|
52 | break; |
---|
53 | case $EJECUCION_COMANDO : |
---|
54 | $textoaccion=$LITEJECUCION_COMANDO; |
---|
55 | $urlimg='../images/iconos/comandos.gif'; |
---|
56 | $identificador=$idcomando; |
---|
57 | $descripcion=$descripcioncomando; |
---|
58 | $cmd->texto="SELECT * FROM programaciones |
---|
59 | WHERE identificador=".$identificador." AND sesion=".$sesion." AND tipoaccion=".$EJECUCION_COMANDO; |
---|
60 | break; |
---|
61 | case $EJECUCION_RESERVA : |
---|
62 | $textoaccion=$LITEJECUCION_RESERVA; |
---|
63 | $urlimg='../images/iconos/reservas.gif'; |
---|
64 | $identificador=$idreserva; |
---|
65 | $descripcion=$descripcionreserva; |
---|
66 | $cmd->texto="SELECT * FROM programaciones WHERE identificador=".$identificador." AND tipoaccion=".$EJECUCION_RESERVA; |
---|
67 | break; |
---|
68 | } |
---|
69 | $numreg=0; |
---|
70 | if (!$rs->Abrir()){ |
---|
71 | $numreg=0; |
---|
72 | $wsw_sus=""; |
---|
73 | } |
---|
74 | else{ |
---|
75 | $numreg=$rs->numeroderegistros; |
---|
76 | if($rs->campos["suspendida"]==1) |
---|
77 | $wsw_sus="checked"; |
---|
78 | else |
---|
79 | $wsw_sus=""; |
---|
80 | } |
---|
81 | $mialmanaque= new Almanaque("tabla_meses"); |
---|
82 | //________________________________________________________________________________________________________ |
---|
83 | ?> |
---|
84 | <HTML> |
---|
85 | <HEAD> |
---|
86 | <TITLE>Administración web de aulas</TITLE> |
---|
87 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
88 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
89 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
90 | <SCRIPT language="javascript" src="../jscripts/programaciones.js"></SCRIPT> |
---|
91 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> |
---|
92 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/programaciones_'.$idioma.'.js"></SCRIPT>'?> |
---|
93 | </HEAD> |
---|
94 | <BODY> |
---|
95 | <P align=center class=cabeceras><?php echo $TbMsg[0]?> <?php echo $textoaccion?> <img src="../images/iconos/reloj.gif"><br> |
---|
96 | <IMG src=<?php echo $urlimg?>> <SPAN align=center class=subcabeceras><?php echo $descripcion?></SPAN> </p> |
---|
97 | <FORM name="fprogramaciones" method="post"> |
---|
98 | <INPUT type=hidden name=tipoaccion value="<?php echo $tipoaccion?>"> |
---|
99 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
100 | <!-- Tabla Tabla con los tiempos y los bloques de programación --> |
---|
101 | <TABLE align=center border=0 cellPadding=0 cellSpacing=0> |
---|
102 | <TR> |
---|
103 | <TD> |
---|
104 | <!-- Tabla con los años dias y semanas --> |
---|
105 | <TABLE border=0 cellPadding=0 cellSpacing=0 style="height: 27px"> |
---|
106 | <TR> |
---|
107 | <TD valign=top> |
---|
108 | <!-- Tabla con la suspension y los años dias y semanas --> |
---|
109 | <TABLE border=0 cellPadding=0 cellSpacing=0> |
---|
110 | <TR class=opciones_ejecucion> |
---|
111 | <TD colspan=6><INPUT id=sw_sus type="checkbox" <?php echo $wsw_sus?> |
---|
112 | onclick="suspender_programacion(<?php echo $identificador?>,<?php echo $tipoaccion?>,<?php echo $sesion?>);)"> |
---|
113 | <SPAN style="COLOR:#999999"><?php echo $TbMsg[1]?></SPAN></TD> |
---|
114 | </TR> |
---|
115 | <TR> |
---|
116 | <TD colspan=6> </TD> |
---|
117 | </TR> |
---|
118 | <TR> |
---|
119 | <TD valign=top> |
---|
120 | <?php $annodesde=date("Y"); |
---|
121 | echo $mialmanaque->Annos(($annodesde-3),($annodesde+3)); // Años?> |
---|
122 | </TD> |
---|
123 | <TD width=10> </TD> |
---|
124 | <TD valign=top> |
---|
125 | <?php echo $mialmanaque->Meses(); // Meses del año?> |
---|
126 | </TD> |
---|
127 | <TD width=10> </TD> |
---|
128 | <TD valign=top width="155"> |
---|
129 | <TABLE id="fechassimples" style="visibility:visible" border=0 cellPadding=0 cellSpacing=0> |
---|
130 | <TR> |
---|
131 | <TD id=tbmesanno> |
---|
132 | <?php $tmarray=getdate(); |
---|
133 | $anoactual=$tmarray["year"]; |
---|
134 | $mesacutal=$tmarray["mon"]; |
---|
135 | echo $mialmanaque->MesAnno($mesacutal,$anoactual); // Calendario del mes?> |
---|
136 | </TD> |
---|
137 | </TR> |
---|
138 | </TABLE> |
---|
139 | </TD> |
---|
140 | <TD width=10> </TD> |
---|
141 | </TR> |
---|
142 | </TABLE> |
---|
143 | </TD> |
---|
144 | <TD> |
---|
145 | <!-- Tabla Dias semenas y dias del mes --> |
---|
146 | <TABLE id="fechasmultiples" style="visibility:hidden" border=0 cellPadding=0 cellSpacing=0 > |
---|
147 | <TR> |
---|
148 | <TD> |
---|
149 | <?php echo $mialmanaque->Dias(); // Dias de la semana?> |
---|
150 | </TD> |
---|
151 | </TR> |
---|
152 | <TR> |
---|
153 | <TD> |
---|
154 | <?php echo $mialmanaque->Semanas(); // Orden de la semanas?> |
---|
155 | </TD> |
---|
156 | </TR> |
---|
157 | <TR> |
---|
158 | <TD> |
---|
159 | <?php echo $mialmanaque->DiasMes(); // Días del mes?> |
---|
160 | </TD> |
---|
161 | </TR> |
---|
162 | </TABLE> |
---|
163 | </TD> |
---|
164 | </TR> |
---|
165 | </TABLE> |
---|
166 | </TD> |
---|
167 | </TR> |
---|
168 | <TR> |
---|
169 | <TD> |
---|
170 | <!-- Tabla Horas--> |
---|
171 | <TABLE border=0 cellPadding=0 cellSpacing=0 style="HEIGHT: 24px; WIDTH: 279px"> |
---|
172 | <TR> |
---|
173 | <TD> |
---|
174 | <?php echo "<BR>".$mialmanaque->Horas(); // Horas?> |
---|
175 | <?php if ($tipoaccion==$EJECUCION_RESERVA){ |
---|
176 | echo $mialmanaque->HorasReserva("1","tabla_horasini","ampmini","minutosini"); // Horas desde; |
---|
177 | echo $mialmanaque->HorasReserva("2","tabla_horasfin","ampmfin","minutosfin"); // Horas hasta; |
---|
178 | } |
---|
179 | ?> |
---|
180 | <br> |
---|
181 | </TD> |
---|
182 | </TR> |
---|
183 | </TABLE> |
---|
184 | </TD> |
---|
185 | </TR> |
---|
186 | <TR> |
---|
187 | <TD> |
---|
188 | <!-- Tabla Bloques--> |
---|
189 | <TABLE border=0 cellPadding=0 cellSpacing=0 > |
---|
190 | <TR> |
---|
191 | <TD valign=top > |
---|
192 | <TABLE border=0 cellPadding=0 cellSpacing=0 > |
---|
193 | <TR> |
---|
194 | <TD > |
---|
195 | <TABLE align=center class="tabla_meses" border=0 cellPadding=0 cellSpacing=2> |
---|
196 | <TR> |
---|
197 | <TH align=center> <?php echo $TbMsg[2]?></TH> |
---|
198 | </TR> |
---|
199 | <TR> |
---|
200 | <TD><input type=text class="cajatexto" id="nombrebloque" |
---|
201 | style="width: 350px; height: 20px" size="20" ></TD> |
---|
202 | </TR> |
---|
203 | </TABLE> |
---|
204 | </TD> |
---|
205 | </TR> |
---|
206 | <TR> |
---|
207 | <TD> |
---|
208 | <?php |
---|
209 | $HTMLSELECT=""; |
---|
210 | $HTMLSELECT.='<SELECT onclick="consulta_programacion();" |
---|
211 | class="estilodesple" id="lista_programaciones" size=2 style="height:100px; width: 350px">' ; |
---|
212 | if ($numreg>0){ |
---|
213 | while (!$rs->EOF){ |
---|
214 | $HTMLSELECT.='<OPTION value="'.$rs->campos["idprogramacion"].'"'; |
---|
215 | $HTMLSELECT.= '>'.$rs->campos["nombrebloque"].'</OPTION>'; |
---|
216 | $rs->Siguiente(); |
---|
217 | } |
---|
218 | } |
---|
219 | $HTMLSELECT.= '</SELECT>'; |
---|
220 | $rs->Cerrar(); |
---|
221 | echo $HTMLSELECT; |
---|
222 | ?> |
---|
223 | </TD> |
---|
224 | </TR> |
---|
225 | </TABLE> |
---|
226 | </TD> |
---|
227 | <TD valign=top width=6> </TD> |
---|
228 | <TD valign=top> |
---|
229 | <TABLE border=0 class=tablaprogramacion border=0 cellPadding=1 cellSpacing=6 width="103"> |
---|
230 | <TR> |
---|
231 | <TD align=center class=botonprogramacion> |
---|
232 | <SPAN id=bt_insertar style="cursor:pointer;visibility:visible;color:#bbbcb9" |
---|
233 | onmouseover="sobreboton(this)" onmouseout="fueraboton(this)" |
---|
234 | onclick="alta_programacion(<?php echo $identificador?>,<?php echo $tipoaccion?>,<?php echo $sesion?>)" |
---|
235 | align=center height="17" width="83">Añadir</SPAN></TD> |
---|
236 | </TR> |
---|
237 | <TR> |
---|
238 | <TD align=center class=botonprogramacion > |
---|
239 | <SPAN id=bt_modificar style="cursor:pointer;visibility:visible;color:#bbbcb9" |
---|
240 | onmouseover="sobreboton(this)" onmouseout="fueraboton(this)" |
---|
241 | onclick="modifica_programacion(<?php echo $identificador?>,<?php echo $tipoaccion?>,<?php echo $sesion?>)" align=center height="17" width="83">Modificar</SPAN></TD> |
---|
242 | </TR> |
---|
243 | <TR> |
---|
244 | <TD align=center class=botonprogramacion > |
---|
245 | <SPAN id=bt_duplicar style="cursor:pointer;visibility:visible;color:#bbbcb9" |
---|
246 | onmouseover="sobreboton(this)" onmouseout="fueraboton(this)" |
---|
247 | onclick="duplicar_programacion()" align=center height="17" width="83">Duplicar</SPAN></TD> |
---|
248 | </TR> |
---|
249 | |
---|
250 | <TR> |
---|
251 | <TD align=center class=botonprogramacion > |
---|
252 | <SPAN id=bt_eliminar style="cursor:pointer;color:#bbbcb9;visibility:visible" |
---|
253 | onmouseover="sobreboton(this)" onmouseout="fueraboton(this)" |
---|
254 | onclick="elimina_programacion()"align=center height="17" width="83">Eliminar</SPAN></TD> |
---|
255 | </TR> |
---|
256 | <TR> |
---|
257 | <TD align=center class=botonprogramacion > |
---|
258 | <SPAN id=bt_cancelar style="cursor:pointer;visibility:visible;color:#bbbcb9" |
---|
259 | onmouseover="sobreboton(this)" onmouseout="fueraboton(this)" |
---|
260 | onclick="cancela_programacion()" align=center height="17" width="83">Cancelar</SPAN></TD> |
---|
261 | </TR> |
---|
262 | </TABLE> |
---|
263 | </TD> |
---|
264 | </TR> |
---|
265 | </TABLE> |
---|
266 | </TD> |
---|
267 | </TR> |
---|
268 | </TABLE> |
---|
269 | </FORM> |
---|
270 | <SCRIPT language="javascript"> |
---|
271 | var lista=document.getElementById("lista_programaciones"); |
---|
272 | var numblo=lista.options.length; |
---|
273 | if(numblo>0){ |
---|
274 | lista.selectedIndex=0; |
---|
275 | consulta_programacion() |
---|
276 | } |
---|
277 | else{ |
---|
278 | nuevo_bloque(); |
---|
279 | } |
---|
280 | </SCRIPT> |
---|
281 | </BODY> |
---|
282 | </HTML> |
---|