[an error occurred while processing this directive] [an error occurred while processing this directive] <% 'ENTRADAS NECESARIAS (CON ESTOS NOMBRES) 'DIA, MES, IDDEPARTAMENTO Const eDomingo = "D" Const eLunes = "L" Const eMartes = "M" Const eMiercoles = "M" Const eJueves = "J" Const eViernes = "V" Const eSabado = "S" Const iDomingo = "S" Const iLunes = "M" Const iMartes = "T" Const iMiercoles = "W" Const iJueves = "T" Const iViernes = "F" Const iSabado = "S" dim ConstMeses(12) dim ConstOcupacion, ConstLibre, ConstOcupado if CookieIdioma = 1 then ConstMeses(1) ="Enero" ConstMeses(2) ="Febrero" ConstMeses(3) ="Marzo" ConstMeses(4) ="Abril" ConstMeses(5) ="Mayo" ConstMeses(6) ="Junio" ConstMeses(7) ="Julio" ConstMeses(8) ="Agosto " ConstMeses(9) ="Septiembre" ConstMeses(10) ="Octubre" ConstMeses(11) ="Noviembre" ConstMeses(12) ="Diciembre" ConstOcupacion ="OCUPACIÓN" ConstLibre ="Libre" ConstOcupado = "Ocupado" else ConstMeses(1) ="January " ConstMeses(2) ="February" ConstMeses(3) ="March" ConstMeses(4) ="April" ConstMeses(5) ="May" ConstMeses(6) ="June" ConstMeses(7) ="July" ConstMeses(8) ="August" ConstMeses(9) ="September" ConstMeses(10) ="October" ConstMeses(11) ="November" ConstMeses(12) ="December" ConstOcupacion ="AVAILABILITY" ConstLibre ="Available" ConstOcupado = "Booked" end if Const Domingo = 1 Const Lunes = 2 Const Martes = 3 Const Miercoles = 4 Const Jueves = 5 Const Viernes = 6 Const Sabado = 7 'La conexion Se supone que ya esta abierta Dim lngMes, lngAnio, LngIdDepartamento, MesAnterior, MesSiguiente, AnioAnterior, AnioSiguiente lngMes = request("Mes") & "" lngAnio = request("Anio") & "" 'lngIdDepartamento = request("IdDepartamento") & "" lngIdDepartamento = Session("IdDepartamento") 'Si no se le manda nada 'response.Write("El DEpartamento: " & lngIdDepartamento) if lngAnio = "" then lngAnio = year(date()) end if If lngMes = "" then lngMes = Month(Date()) end if dim lngdia MesAnterior = lngMes - 1 MesSiguiente = lngMes + 1 If MesAnterior = 0 then MesAnterior = 12 AnioAnterior = lngAnio - 1 AnioSiguiente = lngAnio elseif MesSiguiente = 13 then MesSiguiente =1 AnioAnterior = lngAnio AnioSiguiente = lngAnio + 1 else AnioAnterior = lngAnio AnioSiguiente = lngAnio end if ConexionIniciar() dim RsMes set RsMes = ejecutarText("Select * from Fecha where mes = ? and Anio = ? " , array(lngMes, LngAnio)) Dim RsMesOcupado Set RsMesOcupado = EjecutarText("Select * from DepartamentoFecha where IdDepartamento = ? and Mes = ? and Anio = ? ", array(lngIdDepartamento, lngMes, LngAnio)) 'Datos a tener en cuenta para Diagramar Dim PrimerDia PrimerDia = RsMes("DiaEnSemana") 'Se carga que nombre de dia es el 1ro del mes. Dim CantidadDias CantidadDias = RsMes.Recordcount Dim MatrixMes(7,6) '7 dias por 6 semanas. Dim i 'Recorre para adelante en dias DIm j 'Recorre para abajo Dim Dia Select Case Ucase(PrimerDia) Case "DOMINGO" i=Domingo case "LUNES" i=Lunes case "MARTES" i=Martes case "MIÉRCOLES" i=Miercoles case "JUEVES" i=Jueves case "VIERNES" I=Viernes case "SÁBADO" i=Sabado End Select j=1 Dia=1 Do while j <= 6 and Dia <= CantidadDias Do while i <= 7 and Dia <= CantidadDias 'Se acomoda el recordset para encontrar el Dia ocupado (si existe). RsMesOcupado.Find "Dia=" & Dia If RsMesOcupado.Eof then MatrixMes(i, j)="."&Dia&"" ' MatrixMes(i, j)="" else If cbool(RsMesOcupado("Ocupado")) = true then 'Este lo pone en rojo 'MatrixMes(i, j)="-" & Dia & "" 'Este sin rojo MatrixMes(i, j)="-"& Dia & "" ' MatrixMes(i, j)="" else MatrixMes(i, j)="."&Dia&"" ' MatrixMes(i, j)="" end if end if on error resume next RsMesOcupado.Movefirst on error goto 0 i=i+1 Dia=Dia+1 loop j=j+1 i=1 loop %>
<%=ConstOcupacion%>
  <%=ConstLibre%>           <%=ConstOcupado%>
<% const ALTOCELDA=21 const ANCHOCELDA =23 %> <% for i = 1 to 7 %> <% next %> <% for i = 1 to 7 %> <% next %> <% for i = 1 to 7 %> <% next %> <% for i = 1 to 7 %> <% next %> <% for i = 1 to 7 %> <% next %> <% for i = 1 to 7 %> <% next %>
<% if CookieIdioma = 1 then%><%= eDomingo %><%else%><%= iDomingo %><%end if%>
<% if CookieIdioma = 1 then%><%= elunes %><%else%><%= ilunes %><%end if%>
<% if CookieIdioma = 1 then%><%= eMartes %><%else%><%= iMartes %><%end if%>
<% if CookieIdioma = 1 then%><%= eMiercoles %><%else%><%= iMiercoles %><%end if%>
<% if CookieIdioma = 1 then%><%= eJueves %><%else%><%= iJueves %><%end if%>
<% if CookieIdioma = 1 then%><%= eViernes %><%else%><%= IViernes %><%end if%>
<% if CookieIdioma = 1 then%><%= eSabado %><%else%><%= iSabado %><%end if%>
"#FF9900"<%else%><% IF MID(MatrixMes(i,1),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,1),1,1)="-" THEN%><%= REPLACE(MatrixMes(i,1),"-","") %><%else%><%= REPLACE(MatrixMes(i,1),".","")%><%end if%> 
"#FF9900"<%else%><% IF MID(MatrixMes(i,2),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,2),1,1)="-" THEN%> <%= REPLACE(MatrixMes(i,2),"-","") %><%else%><%= REPLACE(MatrixMes(i,2),".","")%><%end if%> 
"#FF9900"<%else%><% IF MID(MatrixMes(i,3),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,3),1,1)="-" THEN%><%= REPLACE(MatrixMes(i,3),"-","") %><%else%><%= REPLACE(MatrixMes(i,3),".","")%><%end if%> 
"#FF9900"<%else%><% IF MID(MatrixMes(i,4),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,4),1,1)="-" THEN%><%= REPLACE(MatrixMes(i,4),"-","") %><%else%><%= REPLACE(MatrixMes(i,4),".","")%><%end if%> 
"#FF9900"<%else%><% IF MID(MatrixMes(i,5),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,5),1,1)="-" THEN%><%= REPLACE(MatrixMes(i,5),"-","") %><%else%><%= REPLACE(MatrixMes(i,5),".","")%><%end if%> 
"#FF9900"<%else%><% IF MID(MatrixMes(i,6),1,1)="-" THEN %>"#F4D49C" <%else%>"#FFFFFF"<%end if%><%end if%>>
<%IF MID(MatrixMes(i,6),1,1)="-" THEN%><%= REPLACE(MatrixMes(i,6),"-","") %><%else%><%= REPLACE(MatrixMes(i,6),".","")%><%end if%> 
<% Dim mesactualaa, anioactual mesactualanterior=month(date())-1 anioactualanterior=year(date())-1 if not(MesAnterior =mesactualanterior and AnioAnterior>Anioactualanterior) then%> <%end if%><%= ConstMeses(clng(lngMes)) & " " & lngAnio %>