<%@ LANGUAGE=VBSCRIPT %> <% 'Buffer Response.Buffer = True %> <% Response.Expires = -1000 %> <% If Request.Form("AddEvent") = "Add Event" Then Response.Redirect("add_event.asp") End If If Request.Form("EditEvent") = "Edit Event" Then Response.Redirect("edit_event.asp") End If Dim rsactividades set rsactividades = Server.CreateObject("ADODB.Recordset") rsactividades.ActiveConnection = MM_promad_STRING rsactividades.Source = "SELECT * FROM qr_actividades" rsactividades.CursorType = 3 rsactividades.CursorLocation = 2 rsactividades.LockType = 2 rsactividades.Open() rsactividades_numRows = 0 %> <% Function GetDaysInMonth(iMonth, iYear) Select Case iMonth Case 1, 3, 5, 7, 8, 10, 12 GetDaysInMonth = 31 Case 4, 6, 9, 11 GetDaysInMonth = 30 Case 2 If IsDate("February 29, " & iYear) Then GetDaysInMonth = 29 Else GetDaysInMonth = 28 End If End Select End Function Function GetWeekdayMonthStartsOn(iMonth, iYear) GetWeekdayMonthStartsOn = WeekDay(CDate(iMonth & "/1/" & iYear)) End Function Function SubtractOneMonth(dDate) Dim iDay, iMonth, iYear iDay = Day(dDate) iMonth = Month(dDate) iYear = Year(dDate) If iMonth = 1 Then iMonth = 12 iYear = iYear - 1 Else iMonth = iMonth - 1 End If If iDay > GetDaysInMonth(iMonth, iYear) Then iDay = GetDaysInMonth(iMonth, iYear) SubtractOneMonth = CDate(iMonth & "-" & iDay & "-" & iYear) End Function Function AddOneMonth(dDate) Dim iDay, iMonth, iYear iDay = Day(dDate) iMonth = Month(dDate) iYear = Year(dDate) If iMonth = 12 Then iMonth = 1 iYear = iYear + 1 Else iMonth = iMonth + 1 End If If iDay > GetDaysInMonth(iMonth, iYear) Then iDay = GetDaysInMonth(iMonth, iYear) AddOneMonth = CDate(iMonth & "-" & iDay & "-" & iYear) End Function Dim dDate ' Date we're displaying calendar for Dim iDIM ' Days In Month Dim iDOW ' Day Of Week that month starts on Dim iCurrent ' Variable we use to hold current day of month as we write table Dim iPosition ' Variable we use to hold current position in table If IsDate(Request.QueryString("date")) Then dDate = CDate(Request.QueryString("date")) Else If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Else dDate = Date() If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not a valid date. The calendar was set to today's date.

" End If End If End If iDIM = GetDaysInMonth(Month(dDate), Year(dDate)) iDOW = GetWeekdayMonthStartsOn(Month(dDate), Year(dDate)) tempMes = MonthName(Month(dDate)) If tempMes = "January" then Mes = "Enero" If tempMes = "February" then Mes = "Febrero" If tempMes = "March" then Mes = "Marzo" If tempMes = "April" then Mes = "Abril" If tempMes = "May" then Mes = "Mayo" If tempMes = "June" then Mes = "Junio" If tempMes = "July" then Mes = "Julio" If tempMes = "August" then Mes = "Agosto" If tempMes = "September" then Mes = "Septiembre" If tempMes = "October" then Mes = "Octubre" If tempMes = "November" then Mes = "Noviembre" If tempMes = "December" then Mes = "Diciembre" %> Promad - Calendario de Actividades
Calendario
<% If iDOW <> 1 Then Response.Write(vbTab & "" & vbCrLf) iPosition = 1 Do While iPosition < iDOW Response.Write(vbTab & vbTab & "" & vbCrLf) iPosition = iPosition + 1 Loop End If '-- Write days of month in proper day slots -- iCurrent = 1 iPosition = iDOW Do While iCurrent <= iDIM '-- open the table row -- If iPosition = 1 Then Response.Write(vbTab & "" & vbCrLf) End If '-- Write the date and subject -- Response.Write(vbTab & vbTab & "" & vbCrLf) '-- Close the table row -- If iPosition = 7 Then Response.Write vbTab & "" & vbCrLf iPosition = 0 End If '-- Increment variables -- iCurrent = iCurrent + 1 iPosition = iPosition + 1 Loop If iPosition <> 1 Then Do While iPosition <= 7 Response.Write(vbTab & vbTab & "" & vbCrLf) iPosition = iPosition + 1 Loop Response.Write vbTab & "" & vbCrLf End If %>
<-- <%= Mes & " " & Year(dDate) %> -->  
Domingo
Lunes
Martes
Miércoles
Jueves
Viernes
Sábado
 
" & iCurrent & "") If Not rsactividades.BOF Then rsactividades.MoveFirst Do Until rsactividades.EOF If rsactividades("anio") = Year(dDate) Then If rsactividades("mes") = Month(dDate) Then If rsactividades("dia") = iCurrent Then If lasttitulo <> rsactividades("Titulo") then Response.Write(" - "&rsactividades("Titulo"))&"" End If If rsactividades("terminado") = True then actividad = "" & rsactividades("titulo_mensaje") & "" else actividad = rsactividades("titulo_mensaje") End If 'Response.Write("") Response.Write("") Response.Write(" ") Response.Write(" ") Response.Write(" ") Response.Write("
") Response.Write(" " & "" & Encargados(rsactividades("encargado")) & " - " & actividad & "") Response.Write("
") lasttitulo = rsactividades("Titulo") Else lasttitulo = "abc" End If End If End If rsactividades.MoveNext Loop End If Response.Write("
 
<% rsactividades.Close Set rsactividades = Nothing %>