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